[llvm-commits] [llvm] r162733 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h include/llvm/Target/TargetSelectionDAG.td lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/Hexagon/newvaluejump.ll test/CodeGen/Hexagon/newvaluestore.l

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Aug 29 14:01:52 PDT 2012


On Aug 29, 2012, at 1:58 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> On Wed, 29 Aug 2012 13:52:05 -0700
> Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
> 
>> 
>> On Aug 29, 2012, at 11:45 AM, Eli Friedman <eli.friedman at gmail.com>
>> wrote:
>> 
>>>> +  unsigned Flags = MachineMemOperand::MOVolatile;
>>>> +  if (Opcode != ISD::ATOMIC_STORE)
>>>> +    Flags |= MachineMemOperand::MOLoad;
>>>> +  if (Opcode != ISD::ATOMIC_LOAD)
>>>> +    Flags |= MachineMemOperand::MOStore;
>>> 
>>> I'm not sure this is safe; I suppose it depends on how exactly
>>> "volatile" is defined, though.  Specifically, it's unsafe to move an
>>> arbitrary load from after an "acquire" load to before it.
>> 
>> OK, r162857 should bring us back to the old behavior.
>> 
>> MachineInstr::isSafeToMove() now treats volatile and atomic loads as
>> if they were 'stores'. Here, 'store' means a barrier for moving a
>> load instruction.
> 
> Should these semantics be documented somewhere in the language
> reference?

The LLVM IR reference has sections about atomics and volatiles.

These concepts haven't fully made it into the backends yet, we've been depending on 'volatile'.

/jakob




More information about the llvm-commits mailing list