[clang] [CIR] Handle proper hoisting of const variables with InvariantGroupOp (PR #175037)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 9 11:25:05 PST 2026


andykaylor wrote:

> Hmm... perhaps this approach is misguided then. I'm beginning to question the idea of hoisting at all, what is the purpose here if we end up not being able to keep its read/write consistency? Should we just skip hoisting for constants?

As I mentioned offline earlier, I think we need to hoist the allocas for consistency with classic codegen and to have the stack space for the variables allocated at function entry. So, I think hoisting the allocas is good, but I'm not so certain about the invariant handling. 

https://github.com/llvm/llvm-project/pull/175037


More information about the cfe-commits mailing list