[PATCH] D76273: [NFCI][SCEV] Avoid recursion in SCEVExpander::isHighCostExpansion*()
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 18 03:46:23 PDT 2020
mkazantsev accepted this revision.
mkazantsev added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:195
+ while (!Worklist.empty()) {
+ const SCEV *S = Worklist.front();
+ Worklist.pop_front(); // FIFO
----------------
mkazantsev wrote:
> I'm not getting why do you need a worklist. On the 1st iteration of this loop, you put one value to the WorkList and then remove it. `isHighCostExpansionHelper` always puts one element to the worklist and then returns. Therefore the size of your FIFO is either 0 or 1. Do you really need to use deque for it?
Sorry, I misread the code. It may put multiple elements into it.
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