[llvm] [VPlan] Try to hoist Previous (and operands), if sinking fails for FORs. (PR #108945)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 12 14:58:51 PDT 2024


https://github.com/ayalz commented:

Nice extension!

Would be good to also check recurrences of order greater than 1 - finding first non-phi 'previous' should work for hoisting as it does for sinking.

Curious if there are cases where sinking all users or hoisting previous along with all relevant operands fail, but some code motion in both directions succeeds, possibly with multiple FORs. A general approach would be to add dependences between users and previous of each FOR (possibly also with splices introduced), and then topologically sort the data-dependence graph having all dependences - included memory based ones. Handling each FOR separately by either only sinking its users or only hoisting its previous might be too restricted. 

https://github.com/llvm/llvm-project/pull/108945


More information about the llvm-commits mailing list