Without these patterns we would generate a complete LL/SC sequence.
This would be problematic for memory regions marked as WRITE-only or
READ-only, as the instructions LL/SC would read/write to the protected
memory regions correspondingly.
Details
Diff Detail
Event Timeline
LGTM with some minor changes
lib/Target/Mips/MipsISelLowering.cpp | ||
---|---|---|
394 | This ought to be a check for N32/N64 but I'm planning to change the predicate itself later so no need to change this now. | |
lib/Target/Mips/MipsInstrInfo.td | ||
2087–2092 | The multiclass doesn't provide a noticeable benefit here. It's just distributing the RC argument. I'd prefer loads/stores to be defined separately. | |
test/CodeGen/Mips/atomic-load-store.ll | ||
1 | (filename): This kind of minimal single-statement test is what I had in mind when creating the test/CodeGen/Mips/llvm-ir directory. Could you split the load/stores into test/CodeGen/Mips/llvm-ir/{store,load}-atomic.ll | |
test/CodeGen/Mips/atomicSCr6.ll | ||
1 | (filename): Similarly here but with atomicrmx.ll Thanks for tidying this test. |
This bug is resolved in rL252293. In detail it is explained in comment: https://dmz-portal.mips.com/bugz/show_bug.cgi?id=2231
This ought to be a check for N32/N64 but I'm planning to change the predicate itself later so no need to change this now.