Skip to content

Commit f318e55

Browse files
committed
Update variable name and comment
1 parent e97dceb commit f318e55

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5932,13 +5932,12 @@ Instruction *InstCombinerImpl::foldICmpWithTrunc(ICmpInst &ICmp) {
59325932
return nullptr;
59335933

59345934
// This matches patterns corresponding to tests of the signbit as well as:
5935-
// (trunc X) u< C --> (X & -C) == 0 (are all masked-high-bits clear?)
5936-
// (trunc X) u> C --> (X & ~C) != 0 (are any masked-high-bits set?)
5935+
// (trunc X) pred C2 --> (X & Mask) == C
59375936
if (auto Res = decomposeBitTestICmp(Op0, Op1, Pred, /*WithTrunc=*/true,
59385937
/*AllowNonZeroC=*/true)) {
59395938
Value *And = Builder.CreateAnd(Res->X, Res->Mask);
5940-
Constant *Zero = ConstantInt::get(Res->X->getType(), Res->C);
5941-
return new ICmpInst(Res->Pred, And, Zero);
5939+
Constant *C = ConstantInt::get(Res->X->getType(), Res->C);
5940+
return new ICmpInst(Res->Pred, And, C);
59425941
}
59435942

59445943
unsigned SrcBits = X->getType()->getScalarSizeInBits();

0 commit comments

Comments
 (0)