"Recommit "[AggressiveInstCombine] Lower Table Based CTTZ""
authorDjordje Todorovic <djordje.todorovic@syrmia.com>
Fri, 9 Sep 2022 07:44:10 +0000 (09:44 +0200)
committerDjordje Todorovic <djordje.todorovic@syrmia.com>
Fri, 9 Sep 2022 08:29:39 +0000 (10:29 +0200)
commitdf868edee561eb973edd85ec9df41c67aa0bff6b
treea2e423328536869064a29781d3c2d5d6ac0b2a2b
parent6f2ed8fd3f234316e3d250174e131f0ce85ca0ae
"Recommit "[AggressiveInstCombine] Lower Table Based CTTZ""

This reverts commit 053841c5624ca7eacd108a26071d8a1cefe1bebd.

We faced a use-after-free after pushing the D113291, since the
foldSqrt() has a call to eraseFromParent(). The function
should be at the end of the main loop that folds the patterns.
This patch fixes that.
llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-basics.ll [new file with mode: 0644]
llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-dereferencing-pointer.ll [new file with mode: 0644]
llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-non-argument-value.ll [new file with mode: 0644]
llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-zero-element.ll [new file with mode: 0644]
llvm/test/Transforms/AggressiveInstCombine/negative-lower-table-based-cttz.ll [new file with mode: 0644]
llvm/test/Transforms/PhaseOrdering/lower-table-based-cttz.ll [new file with mode: 0644]