[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:53 PDT 2024
================
@@ -147,14 +147,57 @@ exit:
}
; This test has two FORs (for.x and for.y) where incoming value from the previous
-; iteration (for.x.prev) of one FOR (for.y) depends on another FOR (for.x). Due to
-; this dependency all uses of the former FOR (for.y) should be sunk after
-; incoming value from the previous iteration (for.x.prev) of te latter FOR (for.y).
-; That means side-effecting user (store i64 %for.y.i64, ptr %gep) of the latter
-; FOR (for.y) should be moved which is not currently supported.
+; iteration (for.x.prev) of one FOR (for.y) depends on another FOR (for.x).
+; Sinking would require moving a recipe with side effects (store). Instead,
+; for.x.prev can be hoisted.
----------------
ayalz wrote:
"Instead, for.x.prev can be hoisted" - is it important to hoist for.x.prev? (swapping places with the gep)
for.x requires code motion, as its first user for.x.prev precedes its previous for.x.next.
for.y does not require code motion, as its first user for.y.i64 succeeds its previous for.x.prev.
To handle for.x, we avoid sinking its user for.x.prev, because of its role as previous for for.y. Instead, we hoist its previous for.x.next above its user (and all the way out of the loop).
https://github.com/llvm/llvm-project/pull/108945
More information about the llvm-commits
mailing list