Skip to content

Commit 4e0c6d3

Browse files
author
Andy Kaylor
authored
Fix build warning caused by mixed signed/unsigned compare (llvm#69797)
1 parent 972709a commit 4e0c6d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Utils/SimplifyIndVar.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,11 +659,11 @@ bool SimplifyIndvar::replaceFloatIVWithIntegerIV(Instruction *UseInst) {
659659
Instruction *IVOperand = cast<Instruction>(UseInst->getOperand(0));
660660
// Get the symbolic expression for this instruction.
661661
const SCEV *IV = SE->getSCEV(IVOperand);
662-
unsigned MaskBits;
662+
int MaskBits;
663663
if (UseInst->getOpcode() == CastInst::SIToFP)
664-
MaskBits = SE->getSignedRange(IV).getMinSignedBits();
664+
MaskBits = (int)SE->getSignedRange(IV).getMinSignedBits();
665665
else
666-
MaskBits = SE->getUnsignedRange(IV).getActiveBits();
666+
MaskBits = (int)SE->getUnsignedRange(IV).getActiveBits();
667667
int DestNumSigBits = UseInst->getType()->getFPMantissaWidth();
668668
if (MaskBits <= DestNumSigBits) {
669669
for (User *U : UseInst->users()) {

0 commit comments

Comments
 (0)