Details
- Reviewers
- rengolin 
Diff Detail
Event Timeline
A few inline comments.
I would also suggest tests for atomic loads/stores/fences and not just atomicRMW.
| lib/Target/ARM/ARMISelLowering.cpp | ||
|---|---|---|
| 752 | single threded -> single threaded | |
| 757 | This repetition of the test for ThreadModel::Single looks unnecessary to me. Why not test for it first, then put the rest in an else block ? if (TM.Options>ThreadModel == ThreadModel::Single) {
  setOperationAction(ISD::ATOMIC_FENCE,  MVT::Other, Expand);
else if (Subtarget->hasAnyDataBarrier() && !Subtarget->isThumb1Only()) {
...As a bonus, it makes the logic simpler, avoiding setting insertFencesForAtomic (which is a no-op in that case I believe, since all atomic operations will have been lowered before). | |
| lib/Target/ARM/ARMTargetMachine.cpp | ||
| 161 | Shouldn't this pass be disabled when the ThreadModel is single? Especially as it runs first, I expect it will turn for example atomicrmw add in a loop of ldrex/strex instead of a simple add instruction (whenever the subtarget does not disable it at least). | |
I wasn't following the atomics discussion, but this patch looks good. If Morisset is happy with your changer, LGTM.
thanks,
--renato
I added a couple load, store, and fence tests, and committed this as r216182.
Thanks for the review!
Jon
single threded -> single threaded