[llvm] [MachineLICM] Rematerialize instructions that may be hoisted before LICM (PR #158479)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 14 09:13:58 PDT 2025
https://github.com/nikic commented:
Thanks for looking into this.
The terminology used here is a bit confusing. "Rematerialization" in this context usually implies that a *copy* of the instruction is generated in the loop. This is something regalloc can do to avoid spills. As far as I can tell, this is not what you are doing here -- this is plain sinking, not rematerialization.
I'm not particularly familiar with these transforms, so I don't have much to say here. I'm not sure whether this approach of first sinking everything and then trying to hoist again makes sense -- it seems like this would likely end up overshooting in the other direction and end up moving too many calculations into the loop. It's hard to say without seeing how this affects codegen in practice.
https://github.com/llvm/llvm-project/pull/158479
More information about the llvm-commits
mailing list