Skip to content

Commit 83012ac

Browse files
committed
[ValueTracking] Range of cmp intrinsics are -1, 0, and 1
1 parent 7c25db3 commit 83012ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9785,6 +9785,10 @@ static ConstantRange getRangeForIntrinsic(const IntrinsicInst &II,
97859785
unsigned Width = II.getType()->getScalarSizeInBits();
97869786
const APInt *C;
97879787
switch (II.getIntrinsicID()) {
9788+
case Intrinsic::scmp:
9789+
case Intrinsic::ucmp:
9790+
return ConstantRange::getNonEmpty(APInt::getAllOnes(Width),
9791+
APInt::getOneBitSet(Width, 0));
97889792
case Intrinsic::ctlz:
97899793
case Intrinsic::cttz: {
97909794
APInt Upper(Width, Width);

0 commit comments

Comments
 (0)