[PATCH] D32098: [InstCombine] Use less bitwise operations to handle Instruction::SExt in SimplifyDemandedUseBits. Other improvements.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 15:45:48 PDT 2017


craig.topper added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:437
+    // If the input sign bit is known zero, convert this into a zero extension.
+    if (InputKnownZero.isNegative()) {
       // Convert to ZExt cast
----------------
majnemer wrote:
> Using isNegative on InputKnownZero is a little confusing because we are testing to see if the sign bit is clear.
Yeah, I'd really like to say "getSignBit()"  Maybe I should at that as an alias in APInt.    Assuming its not confusing with the separate APInt::getSignBit(unsigned BitWidth)  that creates a new APInt with just the sign bit set. Which is kind of terribly named in itself. Should be getSignBitMask.


https://reviews.llvm.org/D32098





More information about the llvm-commits mailing list