================
@@ -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());
+    if (Hint == AArch64AtomicStoreHint::HINT_NONE)
+      return false;
+
+    unsigned HintOpc;
+    unsigned StoreSize = St.getMemSizeInBits().getValue();
+    Register ValueReg = St.getValueReg();
+    switch (StoreSize) {
+    case 8:
+      HintOpc = AArch64::ATOMIC_STORE_HINT_B;
+      break;
+    case 16: {
+      Register CastReg;
+      if (mi_match(ValueReg, MRI, m_GBitcast(m_Reg(CastReg)))) {
----------------
Lukacma wrote:

Can you explaint why addint these nodes is necessary ?

https://github.com/llvm/llvm-project/pull/198316
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to