[PATCH] D73728: [SCEV] SCEVExpander::isHighCostExpansionHelper(): cost-model add/mul

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 21:33:31 PST 2020


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolutionExpander.cpp:2238
+    Type *OpType = NAry->getType();
+    int PairCost = TTI.getOperationCost(Opcode, OpType);
+
----------------
This is a very rough approximation for Mul, because of Bin Pow algorithm used in Expander. See https://github.com/llvm-mirror/llvm/blob/master/lib/Analysis/ScalarEvolutionExpander.cpp#L781. You might want to factor it in in the future, but what you did is fine for the 1st step. Please add a TODO for that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73728





More information about the llvm-commits mailing list