[PATCH] D47041: [ValueTracking] Teach computeKnownBits that the result of an absolute value pattern that uses nsw flag is always positive.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 05:11:01 PDT 2018


dmgreen added inline comments.


================
Comment at: lib/Analysis/ValueTracking.cpp:1085
+      // will be 0 because that makes abs(INT_MIN) undefined.
+      if (cast<Instruction>(RHS)->hasNoSignedWrap())
+        MaxHighZeros = 1;
----------------
Can't RHS be a const?


https://reviews.llvm.org/D47041





More information about the llvm-commits mailing list