summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZISelLowering.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
index be7c5e430fc..d49d7316e68 100644
--- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -6027,6 +6027,12 @@ SystemZTargetLowering::emitAtomicCmpSwapW(MachineInstr &MI,
MBB->addSuccessor(LoopMBB);
MBB->addSuccessor(DoneMBB);
+ // If the CC def wasn't dead in the ATOMIC_CMP_SWAPW, mark CC as live-in
+ // to the block after the loop. At this point, CC may have been defined
+ // either by the CR in LoopMBB or by the CS in SetMBB.
+ if (!MI.registerDefIsDead(SystemZ::CC))
+ DoneMBB->addLiveIn(SystemZ::CC);
+
MI.eraseFromParent();
return DoneMBB;
}
OpenPOWER on IntegriCloud