================
@@ -2541,6 +2542,66 @@ bool
AArch64InstructionSelector::earlySelect(MachineInstr &I) {
I.eraseFromParent();
return true;
}
+ case TargetOpcode::G_STORE: {
+ GStore &St = cast<GStore>(I);
+ auto MMO = St.getMMO();
+ LLT PtrTy = MRI.getType(St.getPointerReg());
+
+ // Only for handling atomic store with hint.
+ // Can only handle AddressSpace 0, 64-bit pointers.
+ if (!St.isAtomic() || PtrTy != LLT::pointer(0, 64)) {
+ return false;
+ }
+
+ AArch64AtomicStoreHint Hint = TII.decodeAtomicHintFlags(MMO.getFlags());
----------------
kmclaughlin-arm wrote:
I added it this way as I thought it made some of the places where the meaning
of the hint value is important a bit easier to understand. For example, I think
returning false if the hint is found to be`HINT_NONE` instead of 0 is clearer.
Similarly, I think this might end up more confusing if `HINT_STSHH_KEEP` is
replaced with `1` later on:
```
unsigned HintImm = Hint == AArch64AtomicStoreHint::HINT_STSHH_KEEP ? 0 : 1;
```
I can change this and add comments instead though, if you still think that
would be better?
https://github.com/llvm/llvm-project/pull/198316
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits