[Mlir-commits] [mlir] [MLIR][SideEffects][MemoryEffects] Modified LICM to be more aggressive when checking movability of ops with MemWrite effects (PR #155344)
Mo Bagherbeik
llvmlistbot at llvm.org
Fri Sep 5 07:53:58 PDT 2025
mbagherbeikTT wrote:
Significantly changed LICM pass
- reduced complexity to O(n)
- I had to remove the isZeroTrip() check for now as that ended up being a much deeper rabbit hole than initially thought (e.g. have to use different functions to get bound/step information from loopLikeOpInterface of "affine.for" and "scf.for")
- pass first maps out if sequence of Memory Effects on resources result in conflicts on each resource
- Op can be LICM’d if:
- isSpeculatable()
- AND all of the op's Memory Effect resources are conflict free within the loop under analysis
- A resource has a conflict within the loop under analysis if any of the following occur within the loop:
- Within an op that takes a loop-variant input: MemWrite on the resource (input could be data source for write)
- Within an op: a MemRead on any resource precedes a MemWrite on a resource (read data could be source for write)
- MemAlloc or MemFree on the resource by any op
- MemRead on the resource by one op that is followed by another op with a MemWrite on that resource
https://github.com/llvm/llvm-project/pull/155344
More information about the Mlir-commits
mailing list