[PATCH] D51112: [ValueTracking] Teach computeNumSignBits to understand min/max clamp patterns with constant/splat values

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 22 13:29:20 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Analysis/ValueTracking.cpp:2385
+
+        if (CLow->sle(*CHigh)) {
+          Tmp = ComputeNumSignBits(LHS2, Depth + 1, Q);
----------------
craig.topper wrote:
> efriedma wrote:
> > CLow and CHigh have to be constants so you can perform this "sle" check?
> Maybe we could use computeKnownBits to prove an ordering of Low/High in some other cases using leading zeros/ones?
Yes, that would work... but probably best to leave that out for now, until someone finds a case where it matters.


https://reviews.llvm.org/D51112





More information about the llvm-commits mailing list