diff options
author | Eric Christopher <echristo@gmail.com> | 2014-06-19 21:03:04 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-06-19 21:03:04 +0000 |
commit | c40e5edbbc85ed9346417d13f99137fa66dff1a1 (patch) | |
tree | 5b4b60dc1813f203e918a11bac62222e8ad452da /llvm/lib/Target/ARM/ARMTargetMachine.cpp | |
parent | 61d5d38e807b85d5db1fa091e1f6ddcf6e50aff4 (diff) | |
download | llvm-c40e5edbbc85ed9346417d13f99137fa66dff1a1.zip llvm-c40e5edbbc85ed9346417d13f99137fa66dff1a1.tar.gz llvm-c40e5edbbc85ed9346417d13f99137fa66dff1a1.tar.bz2 |
Add a new subtarget hook for whether or not we'd like to enable
the atomic load linked expander pass to run for a particular
subtarget. This requires a check of the subtarget and so save
the TargetMachine rather than only TargetLoweringInfo and update
all callers.
llvm-svn: 211314
Diffstat (limited to 'llvm/lib/Target/ARM/ARMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMTargetMachine.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetMachine.cpp b/llvm/lib/Target/ARM/ARMTargetMachine.cpp index 7a3836a..434d3b03 100644 --- a/llvm/lib/Target/ARM/ARMTargetMachine.cpp +++ b/llvm/lib/Target/ARM/ARMTargetMachine.cpp @@ -171,16 +171,15 @@ TargetPassConfig *ARMBaseTargetMachine::createPassConfig(PassManagerBase &PM) { } void ARMPassConfig::addIRPasses() { - const ARMSubtarget *Subtarget = &getARMSubtarget(); - if (Subtarget->hasAnyDataBarrier() && !Subtarget->isThumb1Only()) { - addPass(createAtomicExpandLoadLinkedPass(TM)); + addPass(createAtomicExpandLoadLinkedPass(TM)); - // Cmpxchg instructions are often used with a subsequent comparison to - // determine whether it succeeded. We can exploit existing control-flow in - // ldrex/strex loops to simplify this, but it needs tidying up. + // Cmpxchg instructions are often used with a subsequent comparison to + // determine whether it succeeded. We can exploit existing control-flow in + // ldrex/strex loops to simplify this, but it needs tidying up. + const ARMSubtarget *Subtarget = &getARMSubtarget(); + if (Subtarget->hasAnyDataBarrier() && !Subtarget->isThumb1Only()) if (TM->getOptLevel() != CodeGenOpt::None && EnableAtomicTidy) addPass(createCFGSimplificationPass()); - } TargetPassConfig::addIRPasses(); } |