[PATCH] D89665: [LSR] ignore profitable chain optimization when instruction number is the major cost

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 00:58:10 PDT 2020


samparker added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfo.h:619
+  /// return false, otherwise return true.
+  bool isRegisterNumberMajorCost() const;
+
----------------
Probably a good idea to including LSR in the name, like the other queries.


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:2841
+  // example instruction number.
+  if (!TTI.isRegisterNumberMajorCost())
+    return false;
----------------
This can potentially interfere with the calls to isProfitableLSRChainElement, which also isn't specifically interested in register uses. It will require more cycles to process but how about moving this to after the for loop below?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89665



More information about the llvm-commits mailing list