[llvm] [CodeGen] Treat hasOrderedMemoryRef as implying arbitrary loads or stores (PR #182000)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 07:27:48 PST 2026


jayfoad wrote:

> could you check a few tests that changed (e.g., the AMDGPU one) and comment on whether the optimized code that doing something potentially dangerous and if not, i.e., the code motion is valid, what makes it valid in this case?

To summarize the remaining test diffs, the new code is always safer in that machine-sink is refusing to sink a load past a side-effecting instruction. The side-effecting instructions in question are:

- For AArch64, ADJCALLSTACKDOWN and ADJCALLSTACKUP
- For AMDGPU, IGLP_OPT and SCHED_GROUP_BARRIER
- For ARM/Thumb, t2WhileLoopSetup and t2WhileLoopStart

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


More information about the llvm-commits mailing list