[PATCH] D76273: [NFCI][SCEV] Avoid recursion in SCEVExpander::isHighCostExpansion*()

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 18 04:19:04 PDT 2020


lebedev.ri marked 3 inline comments as done.
lebedev.ri added a comment.

In D76273#1928590 <https://reviews.llvm.org/D76273#1928590>, @mkazantsev wrote:

> LGTM


Thank you for the review!

In D76273#1928615 <https://reviews.llvm.org/D76273#1928615>, @mkazantsev wrote:

> As a suggestion: since this helper doesn't create new code, it doesn't seem to be important whether it is FIFO or LIFO. If that is so, I'd suggest using SmallVector and LIFO algorithm instead. It should have better memory footprint. OK if it does as follow-up.


I agree the order doesn't matter for correctness.
Currently we seem to be doing depth-first traversal (since we recurse before looking at other operands).
I don't have any evidence which approach is better in the sense that it would exhaust the budget faster,
so i'll go back to simple smallvector with back-insertion/extraction.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76273





More information about the llvm-commits mailing list