[llvm] r294993 - GlobalISel: represent atomic loads & stores via the MachineMemOperand.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 12:49:28 PST 2017


On 14 Feb 2017, at 12:41, Ahmed Bougacha <ahmed.bougacha at gmail.com> wrote:
> In existing Machine passes, it's always correct to drop the MMO,
> right?  I'm worried relying on it for semantic meaning could cause
> weird miscompiles if we ever try to use them.

Bother. The information it contains is almost identical to what we actually need for ISel, so I'd prefer not to reinvent it.

It seems like we could either tighten up the constraints on generic instructions: one MemOperand, which must not be dropped. It'd be pretty easy to verify that (except in the face of a pass mangling-without-dropping it, which seems unlikely).

Otherwise, we could add an official MachineOperand kind that just wraps a MachineMemOperand somehow. That'd definitely not be droppable (because nothing else knows about it yet and we'd stomp on anyone that tries), though it'd bake the MachineInstr interface substantially more confusing IMO.

I *think* I favour the first. Thoughts?

Tim.


More information about the llvm-commits mailing list