We used to have this magic "hasLLSC()" callback, which really meant two things:
- expand cmpxchg (to ll/sc).
- expand atomic loads using ll/sc (rather than cmpxchg).
Instead, introduce explicit callbacks:
- bool shouldExpandAtomicCmpXchgInIR(inst)
- AtomicExpansionKind shouldExpandAtomicLoadInIR(inst)
and rename AtomicRMWExpansionKind into AtomicExpansionKind (done in a separate patch, for readability).
In addition to being IMO clearer, this gives TLI more flexibility when deciding which loads/cmpxchgs to expand, and how.
If folks think this is a positive change, I'll update the other backends before committing. Thanks!
If ResultingLoad is not null but tryExpandAtomicLoad(ResultingLoad) failed, This method returns true in despite of invalidated RMWI.