Skip to content

Commit af64a82

Browse files
brandonxindtcxzyw
andauthored
[InstComine] Use getNonEmpty to handle edge case
Co-authored-by: Yingwei Zheng <[email protected]>
1 parent f306854 commit af64a82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5804,7 +5804,7 @@ Instruction *InstCombinerImpl::foldICmpWithClamp(ICmpInst &I, Value *X,
58045804
return nullptr;
58055805
}
58065806

5807-
ConstantRange CR(*Lo, *Hi + 1);
5807+
ConstantRange CR = ConstantRange::getNonEmpty(*Lo, *Hi + 1);
58085808
ICmpInst::Predicate Pred;
58095809
APInt C, Offset;
58105810
if (I.getPredicate() == ICmpInst::ICMP_EQ)

0 commit comments

Comments
 (0)