Skip to content

Commit da1b1d0

Browse files
el-evdtcxzyw
andcommitted
Update llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
Co-authored-by: Yingwei Zheng <[email protected]>
1 parent e854101 commit da1b1d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,8 @@ Instruction *InstCombinerImpl::foldICmpWithZero(ICmpInst &Cmp) {
13031303
// where f(X) == 0 if and only if X == 0
13041304
if (ICmpInst::isEquality(Pred))
13051305
if (Value *Stripped = stripNullTest(Cmp.getOperand(0)))
1306-
return new ICmpInst(Pred, Stripped, Cmp.getOperand(1));
1306+
return new ICmpInst(Pred, Stripped,
1307+
Constant::getNullValue(Stripped->getType()));
13071308

13081309
return nullptr;
13091310
}

0 commit comments

Comments
 (0)