You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Robustify upstream LICM for zero-trip count loops and other loop kinds #18759
This allows hoisting out of scf.forall ops which are distributed loops. Whether this operation ends up as a loop depends on the processor ID mapping attached to the op which is resolved later in compilation, so hoisting is not possible until then. Additionally, hoisting out of distributed loops complicates determining memory spaces for bufferization because it becomes harder to determine where a write conflict is occurring.
Hoisting any operation out of a zero-trip count loop causes the hoisted operation to potentially do work that wasn't needed. Hoisting needs to either have a guarantee that the loop has at least one trip or wrap the loop in a scf.if (loop_will_happen) { hoisted_code; loop }.
Activity
Rajveer100 commentedon Oct 19, 2024
@qedawkins
If I understand correctly, we need the check here?
https://github.com/llvm/llvm-project/blob/3d84b74cb3543428c35fc39e889684497286d482/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp#L59