SIL: Treat -1 as signed when using it to construct an "all bits set" llvm::APInt

This should enable us to revert
73c70ee338.
This commit is contained in:
Anthony Latsis
2025-08-27 15:18:14 +01:00
parent 26540ca439
commit 2bfe2bd587
6 changed files with 21 additions and 14 deletions

View File

@@ -2976,7 +2976,8 @@ static SILValue testAllControlVariableBits(SILLocation Loc,
if (IVType->getFixedWidth() == 1)
return CondVal;
SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), -1);
SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), -1,
/*treatAsSigned=*/true);
if (!CmpEqFn.get())
CmpEqFn = getBinaryFunction("cmp_eq", CondVal->getType(),
B.getASTContext());