[XCore] Use the newly introduced generic MEMBARRIER node [not quite nfc]
authorPhilip Reames <preames@rivosinc.com>
Tue, 10 Jan 2023 01:41:31 +0000 (17:41 -0800)
committerPhilip Reames <listmail@philipreames.com>
Tue, 10 Jan 2023 01:43:44 +0000 (17:43 -0800)
The target node being removed did not have side effects; the generic one does.  Nothing in the code indicates the lack was intentional, so this is probably fixing a bug.

llvm/lib/Target/XCore/XCoreISelLowering.cpp
llvm/lib/Target/XCore/XCoreISelLowering.h
llvm/lib/Target/XCore/XCoreInstrInfo.td

index 8cc05fd..c686a23 100644 (file)
@@ -64,7 +64,6 @@ getTargetNodeName(unsigned Opcode) const
     case XCoreISD::BR_JT32           : return "XCoreISD::BR_JT32";
     case XCoreISD::FRAME_TO_ARGS_OFFSET : return "XCoreISD::FRAME_TO_ARGS_OFFSET";
     case XCoreISD::EH_RETURN         : return "XCoreISD::EH_RETURN";
-    case XCoreISD::MEMBARRIER        : return "XCoreISD::MEMBARRIER";
   }
   return nullptr;
 }
@@ -928,7 +927,7 @@ LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const {
 SDValue XCoreTargetLowering::
 LowerATOMIC_FENCE(SDValue Op, SelectionDAG &DAG) const {
   SDLoc DL(Op);
-  return DAG.getNode(XCoreISD::MEMBARRIER, DL, MVT::Other, Op.getOperand(0));
+  return DAG.getNode(ISD::MEMBARRIER, DL, MVT::Other, Op.getOperand(0));
 }
 
 SDValue XCoreTargetLowering::
index 45c21fb..cfd0619 100644 (file)
@@ -79,9 +79,6 @@ namespace llvm {
       // Exception handler return. The stack is restored to the first
       // followed by a jump to the second argument.
       EH_RETURN,
-
-      // Memory barrier.
-      MEMBARRIER
     };
   }
 
index 23f80b1..e596966 100644 (file)
@@ -82,11 +82,6 @@ def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_XCoreCallSeqStart,
 def callseq_end   : SDNode<"ISD::CALLSEQ_END",   SDT_XCoreCallSeqEnd,
                            [SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
 
-def SDT_XCoreMEMBARRIER : SDTypeProfile<0, 0, []>;
-
-def XCoreMemBarrier : SDNode<"XCoreISD::MEMBARRIER", SDT_XCoreMEMBARRIER,
-                             [SDNPHasChain]>;
-
 //===----------------------------------------------------------------------===//
 // Instruction Pattern Stuff
 //===----------------------------------------------------------------------===//
@@ -365,7 +360,7 @@ let usesCustomInserter = 1 in {
 
 let hasSideEffects = 1, isMeta = 1 in
 def Int_MemBarrier : PseudoInstXCore<(outs), (ins), "#MEMBARRIER",
-                                     [(XCoreMemBarrier)]>;
+                                     [(membarrier)]>;
 
 //===----------------------------------------------------------------------===//
 // Instructions