Hi Ben,
I'm interested in disabling *all* optimizations across a given machine instruction, not just load/store movement. Basically I'm hoping to limit the scope of optimizations so that at certain points in the application code, the execution state (i.e., registers & stack) can be directly mapped between architecture-specific layouts. Additionally, by putting boundaries around optimizations we can ensure that computation has reached a semantically equivalent point. Optimizations which create architecture-specific live values or which perform code movement make it much harder to find these "equivalence points". If there was a way to put boundaries around instructions, we could programmatically create equivalence points.
I realize that hard boundaries like I'm describing may be too strong of a requirement, so I think I can work around optimizations which create live values known at compile-time, i.e., references to global values/stack objects or immediates. Just as a little more context, I'm using LLVM's
stackmap intrinsic to capture live value locations. The stackmap already restricts memory movement around the intrinsic's location.