summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp6
-rw-r--r--llvm/test/CodeGen/AArch64/cmpxchg-O0.ll2
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp b/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
index 4fb1bb11d1a..db6dcc7131d 100644
--- a/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
@@ -624,7 +624,6 @@ bool AArch64ExpandPseudo::expandCMP_SWAP(
// ldaxr xDest, [xAddr]
// cmp xDest, xDesired
// b.ne .Ldone
- MBB.addSuccessor(LoadCmpBB);
LoadCmpBB->addLiveIn(Addr.getReg());
LoadCmpBB->addLiveIn(Dest.getReg());
LoadCmpBB->addLiveIn(Desired.getReg());
@@ -663,6 +662,8 @@ bool AArch64ExpandPseudo::expandCMP_SWAP(
DoneBB->transferSuccessors(&MBB);
addPostLoopLiveIns(DoneBB, LiveRegs);
+ MBB.addSuccessor(LoadCmpBB);
+
NextMBBI = MBB.end();
MI.eraseFromParent();
return true;
@@ -702,7 +703,6 @@ bool AArch64ExpandPseudo::expandCMP_SWAP_128(
// cmp xDestLo, xDesiredLo
// sbcs xDestHi, xDesiredHi
// b.ne .Ldone
- MBB.addSuccessor(LoadCmpBB);
LoadCmpBB->addLiveIn(Addr.getReg());
LoadCmpBB->addLiveIn(DestLo.getReg());
LoadCmpBB->addLiveIn(DestHi.getReg());
@@ -749,6 +749,8 @@ bool AArch64ExpandPseudo::expandCMP_SWAP_128(
DoneBB->transferSuccessors(&MBB);
addPostLoopLiveIns(DoneBB, LiveRegs);
+ MBB.addSuccessor(LoadCmpBB);
+
NextMBBI = MBB.end();
MI.eraseFromParent();
return true;
diff --git a/llvm/test/CodeGen/AArch64/cmpxchg-O0.ll b/llvm/test/CodeGen/AArch64/cmpxchg-O0.ll
index 6c6b022044b..c79d82a6377 100644
--- a/llvm/test/CodeGen/AArch64/cmpxchg-O0.ll
+++ b/llvm/test/CodeGen/AArch64/cmpxchg-O0.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=aarch64-linux-gnu -O0 %s -o - | FileCheck %s
+; RUN: llc -verify-machineinstrs -mtriple=aarch64-linux-gnu -O0 %s -o - | FileCheck %s
define { i8, i1 } @test_cmpxchg_8(i8* %addr, i8 %desired, i8 %new) nounwind {
; CHECK-LABEL: test_cmpxchg_8:
OpenPOWER on IntegriCloud