Skip to content

Commit 7175cff

Browse files
committed
[Polly] Reuse multiple uses in operand tree.
Recursively traversing the operand tree leads to an exponential blowup if instructions are used multiple times due to every path leading to an additional copy of the instructions after forwarding. This problem was marked as a TODO in the code and was reported as a bug in llvm.org/PR47340. Fix by caching already visited instructions and returning the cached version when already visited. Instead of calling forwardTree() twice, return a ForwardingAction structure that contains a lambda which will carry-out the forwarding when requested. The lambdas are executed in reverse-postorder to mimic the previous recursive calls unless there is a reuse. Fixes llvm.org/PR47340
1 parent be8e4de commit 7175cff

File tree

3 files changed

+442
-250
lines changed

3 files changed

+442
-250
lines changed

0 commit comments

Comments
 (0)