aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@rt-rk.com>2013-10-11 03:20:45 +0200
committerPetar Jovanovic <petar.jovanovic@rt-rk.com>2013-10-11 03:20:45 +0200
commit3ebbc156690e2510a21287c7ece988905a5c2e28 (patch)
tree841b287f6430ef9318e4267b371bb0d4328c2bf2 /lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
parent1b783c13dd573e2611f7fde92e3e66475bdb8918 (diff)
Apply upstream: Add missing ATOMIC_CMP_SWAP case.
Cherry-pick r185186 from upstream. Original commit message: Author: Lang Hames <lhames@gmail.com> Date: Fri Jun 28 18:36:42 2013 +0000 Add missing case to switch statement - DAGTypeLegalizer::ExpandIntegerResult should expand ATOMIC_CMP_SWAP nodes the same way that it does for ATOMIC_SWAP. Since ATOMIC_LOADs on some targets (e.g. older ARM variants) get legalized to ATOMIC_CMP_SWAPs, the missing case had been causing i64 atomic loads to crash during isel. This has to be cherry-picked, as we have experienced the same bug described in the original message. Missing case caused MIPS 64 atomics to crash. TBR= mseaborn@chromium.org, dschuff@chromium.org BUG= crash for MIPS atomics Review URL: https://codereview.chromium.org/26958002
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index cd2f060ce0..e68b4f4936 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -1127,7 +1127,8 @@ void DAGTypeLegalizer::ExpandIntegerResult(SDNode *N, unsigned ResNo) {
case ISD::ATOMIC_LOAD_MAX:
case ISD::ATOMIC_LOAD_UMIN:
case ISD::ATOMIC_LOAD_UMAX:
- case ISD::ATOMIC_SWAP: {
+ case ISD::ATOMIC_SWAP:
+ case ISD::ATOMIC_CMP_SWAP: {
std::pair<SDValue, SDValue> Tmp = ExpandAtomic(N);
SplitInteger(Tmp.first, Lo, Hi);
ReplaceValueWith(SDValue(N, 1), Tmp.second);