aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-06-17 02:02:03 +0000
committerJim Grosbach <grosbach@apple.com>2010-06-17 02:02:03 +0000
commit7072cf62a52787c461e3371ad36e1754e8a0dc97 (patch)
treede563ece0b4c0b0212ab6b0befc63fb336eebd11
parentbbfc0d22a9a8e197a5ea428f14d37366a1fadd5f (diff)
downloadexternal_llvm-7072cf62a52787c461e3371ad36e1754e8a0dc97.zip
external_llvm-7072cf62a52787c461e3371ad36e1754e8a0dc97.tar.gz
external_llvm-7072cf62a52787c461e3371ad36e1754e8a0dc97.tar.bz2
Thumb1 and any pre-v6 ARM target should use the libcall expansion of
ISD::MEMBARRIER. v7 and v7 ARM mode continue to use the custom lowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106204 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMISelLowering.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
index d684c05..2d963fa 100644
--- a/lib/Target/ARM/ARMISelLowering.cpp
+++ b/lib/Target/ARM/ARMISelLowering.cpp
@@ -405,7 +405,12 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
// doesn't yet know how to not do that for SjLj.
setExceptionSelectorRegister(ARM::R0);
setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Expand);
- setOperationAction(ISD::MEMBARRIER, MVT::Other, Custom);
+ // Handle atomics directly for ARMv[67] (except for Thumb1), otherwise
+ // use the default expansion.
+ TargetLowering::LegalizeAction AtomicAction =
+ (Subtarget->hasV7Ops() ||
+ (Subtarget->hasV6Ops() && !Subtarget->isThumb1Only())) ? Custom : Expand;
+ setOperationAction(ISD::MEMBARRIER, MVT::Other, AtomicAction);
// If the subtarget does not have extract instructions, sign_extend_inreg
// needs to be expanded. Extract is available in ARM mode on v6 and up,