[PATCH] D12338: Make `llvm::expandAtomicRMWToCmpXchg`'s initial load atomic.

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 14:54:34 PDT 2015


jfb added a comment.

I talked to @jyasskin in person: signal fence would work but isn't quite what we want. We would want a new type of atomic that participates in ordering, but is allowed to tear. This doesn't exist, but we can emulate it by:

1. Changing the pass to be parameterize with "largest efficient atomic operation for this target". This is effectively the widest is_lock_free value.
2. Passing this number when initializing the target's pass list.
3. Having the pass explicitly tear too-wide loads into sub-loads of the type from 1., and reassembling the value from that.

This would manually create the tearing (tests would be the same as before) but the load would be atomic.

@morisset, does that sounds good?


http://reviews.llvm.org/D12338





More information about the llvm-commits mailing list