[llvm] r208991 - Enable the Load/Store optimization pass for Thumb1 but make it return immediately for now.
James Molloy
james.molloy at arm.com
Fri May 16 07:11:38 PDT 2014
Author: jamesm
Date: Fri May 16 09:11:38 2014
New Revision: 208991
URL: http://llvm.org/viewvc/llvm-project?rev=208991&view=rev
Log:
Enable the Load/Store optimization pass for Thumb1 but make it return immediately for now.
Patch by Moritz Roth!
Modified:
llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=208991&r1=208990&r2=208991&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Fri May 16 09:11:38 2014
@@ -68,7 +68,7 @@ namespace {
const ARMSubtarget *STI;
ARMFunctionInfo *AFI;
RegScavenger *RS;
- bool isThumb2;
+ bool isThumb1, isThumb2;
bool runOnMachineFunction(MachineFunction &Fn) override;
@@ -1520,6 +1520,10 @@ bool ARMLoadStoreOpt::runOnMachineFuncti
STI = &TM.getSubtarget<ARMSubtarget>();
RS = new RegScavenger();
isThumb2 = AFI->isThumb2Function();
+ isThumb1 = AFI->isThumbFunction() && !isThumb2;
+
+ // Don't do anything in this pass with Thumb1 for now.
+ if (isThumb1) return false;
bool Modified = false;
for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
@@ -1581,6 +1585,11 @@ bool ARMPreAllocLoadStoreOpt::runOnMachi
MRI = &Fn.getRegInfo();
MF = &Fn;
+ ARMFunctionInfo *AFI = Fn.getInfo<ARMFunctionInfo>();
+ bool isThumb1 = AFI->isThumbFunction() && !AFI->isThumb2Function();
+ // Don't do anything in this pass with Thumb1 for now.
+ if (isThumb1) return false;
+
bool Modified = false;
for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
++MFI)
Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=208991&r1=208990&r2=208991&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Fri May 16 09:11:38 2014
@@ -247,8 +247,7 @@ bool ARMPassConfig::addInstSelector() {
}
bool ARMPassConfig::addPreRegAlloc() {
- // FIXME: temporarily disabling load / store optimization pass for Thumb1.
- if (getOptLevel() != CodeGenOpt::None && !getARMSubtarget().isThumb1Only())
+ if (getOptLevel() != CodeGenOpt::None)
addPass(createARMLoadStoreOptimizationPass(true));
if (getOptLevel() != CodeGenOpt::None && getARMSubtarget().isCortexA9())
addPass(createMLxExpansionPass());
@@ -262,12 +261,10 @@ bool ARMPassConfig::addPreRegAlloc() {
}
bool ARMPassConfig::addPreSched2() {
- // FIXME: temporarily disabling load / store optimization pass for Thumb1.
if (getOptLevel() != CodeGenOpt::None) {
- if (!getARMSubtarget().isThumb1Only()) {
- addPass(createARMLoadStoreOptimizationPass());
- printAndVerify("After ARM load / store optimizer");
- }
+ addPass(createARMLoadStoreOptimizationPass());
+ printAndVerify("After ARM load / store optimizer");
+
if (getARMSubtarget().hasNEON())
addPass(createExecutionDependencyFixPass(&ARM::DPRRegClass));
}
More information about the llvm-commits
mailing list