[PATCH] D21078: [Thumb] Select a BIC instead of AND if the immediate can be encoded more optimally negated

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 06:56:51 PDT 2016


jmolloy added inline comments.

================
Comment at: lib/Target/ARM/ARMISelDAGToDAG.cpp:2801
@@ +2800,3 @@
+    auto *N1C = dyn_cast<ConstantSDNode>(N->getOperand(1));
+    if (N1C && N1C->hasOneUse() && Subtarget->isThumb()) {
+      uint32_t Imm = (uint32_t) N1C->getZExtValue();
----------------
sbaranga wrote:
> If the constant ends up as an immediate, why limit it to only having one use?
The constant doesn't end up as an immediate. That's what the "ImmTransform" check below is doing - if it would just be promoted to an immediate, don't bother and bail out.

But if it can't be an immediate, then do the transform. And in that case we don't want to create more constants.


Repository:
  rL LLVM

http://reviews.llvm.org/D21078





More information about the llvm-commits mailing list