[PATCH] D24857: [ARM] Assign cost of scaling used in addressing mode for ARM cores

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 09:50:09 PDT 2016


rengolin added a comment.

Whenever @jmolloy is happy, I'm happy. Thanks for the changes.



================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:11608
+  }
+  return -1;
+}
----------------
javed.absar wrote:
> rengolin wrote:
> > I guess -1 here means illegal, though without seeing the code that is using it, I can't assume.
> You are right. The same is mentioned in Analysis/TargetTransformInfo.h wherein it is stated "If the AM is not supported, it returns a negative value". 
Right, ok.


================
Comment at: lib/Target/ARM/ARMISelLowering.h:299
+    /// If the AM is not supported, the return value must be negative.
+    int getScalingFactorCost(const DataLayout &DL, const AddrMode &AM, Type *Ty,
+                             unsigned AS) const override;
----------------
javed.absar wrote:
> rengolin wrote:
> > Where is this being used?
> It is used in LoopStrengthReduce, where decisions to transform a loop is taken based on a cost-model that takes scaling-factor cost into consideration. 
Oh, right, I missed the "override".


https://reviews.llvm.org/D24857





More information about the llvm-commits mailing list