[PATCH] D28928: [ValueTracking] Implement SignBitMustBeZero correctly for sqrt.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 16:53:45 PST 2017


jlebar added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2681-2683
+      if (ConstantInt *Exponent = dyn_cast<ConstantInt>(I->getOperand(1))) {
         // powi(x,n) is non-negative if n is even.
+        if (Exponent->getBitWidth() <= 64 && Exponent->getSExtValue() % 2u == 0)
----------------
arsenm wrote:
> Unrelated changes
I introduced the variable "CI" above, and I did not want to shadow it here.

I could split out this variable rename into a separate patch if you really think that's necessary?


https://reviews.llvm.org/D28928





More information about the llvm-commits mailing list