[llvm] [GlobalISel] Add G_ABS computeKnownBits, add ComputeKnownBitsCache assertion to computeNumSignBits (PR #154413)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 00:33:53 PDT 2025


================
@@ -2058,7 +2067,10 @@ unsigned GISelValueTracking::computeNumSignBits(Register R, unsigned Depth) {
   LLT Ty = MRI.getType(R);
   APInt DemandedElts =
       Ty.isFixedVector() ? APInt::getAllOnes(Ty.getNumElements()) : APInt(1, 1);
-  return computeNumSignBits(R, DemandedElts, Depth);
+  assert(ComputeKnownBitsCache.empty() && "Cache should be empty");
----------------
davemgreen wrote:

If the computeNumSignBits with DemandElts is called directly, do we need to invalidate the cache there too?  Do we need a computeNumSignBitsImpl?

https://github.com/llvm/llvm-project/pull/154413


More information about the llvm-commits mailing list