forked from OSchip/llvm-project
				
			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
This commit is contained in:
		
							parent
							
								
									d7bcd99325
								
							
						
					
					
						commit
						3b2343eae9
					
				| 
						 | 
					@ -42,9 +42,6 @@ const TargetInstrDescriptor SparcMachineInstrDesc[] = {
 | 
				
			||||||
// Command line options to control choice of code generation passes.
 | 
					// 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",
 | 
					static cl::opt<bool> DisableSched("disable-sched",
 | 
				
			||||||
                                  cl::desc("Disable local scheduling pass"));
 | 
					                                  cl::desc("Disable local scheduling pass"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -178,14 +175,12 @@ bool UltraSparc::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out)
 | 
				
			||||||
  //so %fp+offset-8 and %fp+offset-16 are empty slots now!
 | 
					  //so %fp+offset-8 and %fp+offset-16 are empty slots now!
 | 
				
			||||||
  PM.add(createStackSlotsPass(*this));
 | 
					  PM.add(createStackSlotsPass(*this));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (!DisablePreOpt) {
 | 
					 | 
				
			||||||
  // Specialize LLVM code for this target machine
 | 
					  // Specialize LLVM code for this target machine
 | 
				
			||||||
  PM.add(createPreSelectionPass(*this));
 | 
					  PM.add(createPreSelectionPass(*this));
 | 
				
			||||||
  // Run basic dataflow optimizations on LLVM code
 | 
					  // Run basic dataflow optimizations on LLVM code
 | 
				
			||||||
  PM.add(createReassociatePass());
 | 
					  PM.add(createReassociatePass());
 | 
				
			||||||
  PM.add(createLICMPass());
 | 
					  PM.add(createLICMPass());
 | 
				
			||||||
  PM.add(createGCSEPass());
 | 
					  PM.add(createGCSEPass());
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // If LLVM dumping after transformations is requested, add it to the pipeline
 | 
					  // If LLVM dumping after transformations is requested, add it to the pipeline
 | 
				
			||||||
  if (DumpInput)
 | 
					  if (DumpInput)
 | 
				
			||||||
| 
						 | 
					@ -252,6 +247,14 @@ bool UltraSparc::addPassesToJITCompile(FunctionPassManager &PM) {
 | 
				
			||||||
  // Construct and initialize the MachineFunction object for this fn.
 | 
					  // Construct and initialize the MachineFunction object for this fn.
 | 
				
			||||||
  PM.add(createMachineCodeConstructionPass(*this));
 | 
					  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(createInstructionSelectionPass(*this));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  PM.add(getRegisterAllocator(*this));
 | 
					  PM.add(getRegisterAllocator(*this));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue