[PATCH] D100564: [TTI] NFC: Change getScalingFactorCost to return InstructionCost

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 05:01:56 PDT 2021


paulwalker-arm accepted this revision.
paulwalker-arm added a comment.
This revision is now accepted and ready to land.

One comment about preexisting possibly redundant code so the patch looks good to me.



================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1782-1783
 
     assert(ScaleCostMinOffset >= 0 && ScaleCostMaxOffset >= 0 &&
+           ScaleCostMinOffset.isValid() && ScaleCostMaxOffset.isValid() &&
            "Legal addressing mode has an illegal cost!");
----------------
I can see that `TargetTransformInfo::getScalingFactorCost` already performs the `>=0` test and so I'm wondering if at this point you only need to assert the costs are valid?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100564/new/

https://reviews.llvm.org/D100564



More information about the llvm-commits mailing list