diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2003-11-07 20:33:25 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-11-07 20:33:25 +0000 |
commit | 3b2343eae9c84db8c463c37a3f07ab65514b4313 (patch) | |
tree | 24c1d52b19460fcdfd97121e6554ecabbce3759b /llvm/lib/Target/Sparc | |
parent | d7bcd9932582907f564be89d768ee68f6e06b7fd (diff) | |
download | bcm5719-llvm-3b2343eae9c84db8c463c37a3f07ab65514b4313.tar.gz bcm5719-llvm-3b2343eae9c84db8c463c37a3f07ab65514b4313.zip |
PreSelection is not optional, it performs a necessary and vital transformation
for the Sparc backend: breaking up constant expressions. Thus, we cannot have it
guarded by a conditional, it should never be disabled.
Also, it's now available for the JIT since it is a FunctionPass.
llvm-svn: 9791
Diffstat (limited to 'llvm/lib/Target/Sparc')
-rw-r--r-- | llvm/lib/Target/Sparc/Sparc.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/llvm/lib/Target/Sparc/Sparc.cpp b/llvm/lib/Target/Sparc/Sparc.cpp index 738413fc599..1fcd4b852a8 100644 --- a/llvm/lib/Target/Sparc/Sparc.cpp +++ b/llvm/lib/Target/Sparc/Sparc.cpp @@ -42,9 +42,6 @@ const TargetInstrDescriptor SparcMachineInstrDesc[] = { // Command line options to control choice of code generation passes. //--------------------------------------------------------------------------- -static cl::opt<bool> DisablePreOpt("disable-preopt", - cl::desc("Disable optimizations prior to instruction selection")); - static cl::opt<bool> DisableSched("disable-sched", cl::desc("Disable local scheduling pass")); @@ -178,15 +175,13 @@ bool UltraSparc::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out) //so %fp+offset-8 and %fp+offset-16 are empty slots now! PM.add(createStackSlotsPass(*this)); - if (!DisablePreOpt) { - // Specialize LLVM code for this target machine - PM.add(createPreSelectionPass(*this)); - // Run basic dataflow optimizations on LLVM code - PM.add(createReassociatePass()); - PM.add(createLICMPass()); - PM.add(createGCSEPass()); - } - + // Specialize LLVM code for this target machine + PM.add(createPreSelectionPass(*this)); + // Run basic dataflow optimizations on LLVM code + PM.add(createReassociatePass()); + PM.add(createLICMPass()); + PM.add(createGCSEPass()); + // If LLVM dumping after transformations is requested, add it to the pipeline if (DumpInput) PM.add(new PrintFunctionPass("Input code to instr. selection:\n", @@ -252,6 +247,14 @@ bool UltraSparc::addPassesToJITCompile(FunctionPassManager &PM) { // Construct and initialize the MachineFunction object for this fn. PM.add(createMachineCodeConstructionPass(*this)); + // Specialize LLVM code for this target machine and then + // run basic dataflow optimizations on LLVM code. + PM.add(createPreSelectionPass(*this)); + // Run basic dataflow optimizations on LLVM code + PM.add(createReassociatePass()); + PM.add(createLICMPass()); + PM.add(createGCSEPass()); + PM.add(createInstructionSelectionPass(*this)); PM.add(getRegisterAllocator(*this)); |