summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2016-04-27 20:33:02 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2016-04-27 20:33:02 +0000
commit9e71425f54731baa3263b7dca0c2badd632db33f (patch)
tree5ee0295dac20204a9468b4a8985952601f0473e7 /llvm/lib
parentb4af107239789499d182deb5111ae3008c09dcb3 (diff)
downloadbcm5719-llvm-9e71425f54731baa3263b7dca0c2badd632db33f.tar.gz
bcm5719-llvm-9e71425f54731baa3263b7dca0c2badd632db33f.zip
[AArch64] Set correct successors in CMPXCHG pseudo expansion.
transferSuccessors() would LoadCmpBB a successor of DoneBB, whereas it should be a successor of the original MBB. Follow-up to r266339. Unfortunately, it's tricky to catch this in the verifier. llvm-svn: 267779
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp6
1 files changed, 4 insertions, 2 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;
OpenPOWER on IntegriCloud