[PATCH] D89541: [IRCE] Do not transform is loop has small number of iterations

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 18 22:31:19 PDT 2020


ebrevnov added a comment.

I think it makes sense to introduce the proposed heuristic since there is no easy way to estimate cost of the code generated by SCEVExpander at the moment.

FYI, there is on going work (https://reviews.llvm.org/D75980) which enables vectorizer to evaluate cost of the code SCEVExpander "would" generate. Looks like there is an additional use case for that. Also this may be useful for LoopPredication since it does similar thing to IRCE. Taking that we might need to make this functionality publicly available. @fahn what do you think?

Thanks
Evgeniy



================
Comment at: llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:1903
+  // Profitability check.
+  if (!SkipProfitabilityChecks && GetBFI.hasValue()) {
+    BlockFrequencyInfo &BFI = (*GetBFI)();
----------------
There is an existing utility function inside the vectorizer (getSmallBestKnownTC) which estimates loop's trip count. Can this be used (if made public) instead of BFI?


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

https://reviews.llvm.org/D89541



More information about the llvm-commits mailing list