[llvm] [LICM] Promote conditional, loop-invariant memory accesses to scalars with intrinsic (PR #93999)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 1 03:44:47 PDT 2024
https://github.com/nikic commented:
Just some high level comments:
* Is this really a universally profitable transform? This adds extra phi nodes to track the condition, plus a conditional store after the loop. This seems like it would be non-profitable at least in the case where the store was originally inside a cold block in the loop.
* It seems like you are lowering the new conditional.store intrinsic immediately after LICM by scheduling an additional pass. That seems pretty pointless to me. If you are going to do that, you may as well directly update the CFG in LICM. If you're going to introduce that kind of intrinsic, I would expect it to be lowered in the early backend.
* Of course, if you do that, then we also need some middle-end optimization support for the intrinsic.
Mostly though I'm not really convinced that we want to do this transform at all, at least not as an unconditional canonicalization transform.
https://github.com/llvm/llvm-project/pull/93999
More information about the llvm-commits
mailing list