[PATCH] D110171: [VectorCombine] Switch to using a worklist.
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 21 09:35:33 PDT 2021
lebedev.ri added a comment.
In D110171#3012936 <https://reviews.llvm.org/D110171#3012936>, @fhahn wrote:
> In D110171#3012911 <https://reviews.llvm.org/D110171#3012911>, @lebedev.ri wrote:
>
>> Hmm, but this still doesn't do instcombine-style whole-function reprocessing ("iteration"), but only reprocesses the ones explicitly added to worklist.
>> This is intentional?
>
> At the moment, the first combining round is done by iterating over the function without the worklist. Only if something gets simplified, the modified instructions are added. Is this what you are referring to? I did not add all instructions to the worklist up front intentionally.
>
> The number of combines is quite limited at the moment and I expect there are a lot of functions where no combine triggers at all. In those cases, adding everything to the worklist first seems a bit of unnecessary overhead.
Instcombine roughly does the following:
1. add all instructions into worklist
2. pop from worklist until it's empty
3. if made any changes, goto 1.
This essentially does 1. and 2., but not 3.
This may either be an oversight, or an intentional improvement that guarantees that in this pass we don't repeat instcombine's mistake
of relying on 3., but consistently add everything we want reprocessed into worklist.
Thus, i'm asking.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110171/new/
https://reviews.llvm.org/D110171
More information about the llvm-commits
mailing list