[llvm] dba8acd - Revert "[ValueTracking] Drop ucmp/scmp from getIntrinsicRange() (NFCI)"

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 06:20:17 PDT 2025


Author: Hans Wennborg
Date: 2025-04-22T15:19:49+02:00
New Revision: dba8acde6d6a320dad42cdbfe7c8261938348e23

URL: https://github.com/llvm/llvm-project/commit/dba8acde6d6a320dad42cdbfe7c8261938348e23
DIFF: https://github.com/llvm/llvm-project/commit/dba8acde6d6a320dad42cdbfe7c8261938348e23.diff

LOG: Revert "[ValueTracking] Drop ucmp/scmp from getIntrinsicRange() (NFCI)"

This does seem to cause some functionality to change, see comment on
https://github.com/llvm/llvm-project/commit/278c429d11e63bc709ea8c537b23c4e350ce2a07

This reverts commit 278c429d11e63bc709ea8c537b23c4e350ce2a07.

Added: 
    

Modified: 
    llvm/lib/Analysis/ValueTracking.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 1d3f8b7207a63..cdf7f052943c8 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -10146,6 +10146,10 @@ static ConstantRange getRangeForIntrinsic(const IntrinsicInst &II,
     if (!II.getParent() || !II.getFunction())
       break;
     return getVScaleRange(II.getFunction(), Width);
+  case Intrinsic::scmp:
+  case Intrinsic::ucmp:
+    return ConstantRange::getNonEmpty(APInt::getAllOnes(Width),
+                                      APInt(Width, 2));
   default:
     break;
   }


        


More information about the llvm-commits mailing list