OSDN Git Service

[ARM] GlobalISel: Don't select atomic loads
authorDiana Picus <diana.picus@linaro.org>
Mon, 20 Feb 2017 14:45:58 +0000 (14:45 +0000)
committerDiana Picus <diana.picus@linaro.org>
Mon, 20 Feb 2017 14:45:58 +0000 (14:45 +0000)
There used to be a check in the IRTranslator that prevented us from having to
deal with atomic loads/stores. That check has been removed in r294993 and the
AArch64 backend was updated accordingly. This commit does the same thing for the
ARM backend.

In general, in the ARM backend we introduce fences during the atomic expand
pass, so we don't have to worry about atomics, *except* for the 32-bit ARMv8
target, which handles atomics more like AArch64. Since we don't want to worry
about that yet, just bail out of instruction selection if we find any atomic
loads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295662 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstructionSelector.cpp

index 75b108c..84d9ac5 100644 (file)
@@ -310,6 +310,12 @@ bool ARMInstructionSelector::select(MachineInstr &I) const {
     MIB.addImm(0).add(predOps(ARMCC::AL)).add(condCodeOp());
     break;
   case G_LOAD: {
+    const auto &MemOp = **I.memoperands_begin();
+    if (MemOp.getOrdering() != AtomicOrdering::NotAtomic) {
+      DEBUG(dbgs() << "Atomic load/store not supported yet\n");
+      return false;
+    }
+
     unsigned Reg = I.getOperand(0).getReg();
     unsigned RegBank = RBI.getRegBank(Reg, MRI, TRI)->getID();