mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
[PM] Sink the population of the pass manager with target-specific
analyses back into the LTO code generator. The pass manager builder (and the transforms library in general) shouldn't be referencing the target machine at all. This makes the LTO population work like the others -- the data layout and target transform info need to be pre-populated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227576 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2ec788d43f
commit
b4a44570f6
@ -151,7 +151,7 @@ public:
|
||||
|
||||
/// populateModulePassManager - This sets up the primary pass manager.
|
||||
void populateModulePassManager(PassManagerBase &MPM);
|
||||
void populateLTOPassManager(PassManagerBase &PM, TargetMachine *TM = nullptr);
|
||||
void populateLTOPassManager(PassManagerBase &PM);
|
||||
};
|
||||
|
||||
/// Registers a function for adding a standard set of passes. This should be
|
||||
|
@ -488,6 +488,9 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
|
||||
// Add an appropriate DataLayout instance for this module...
|
||||
mergedModule->setDataLayout(TargetMach->getDataLayout());
|
||||
|
||||
passes.add(new DataLayoutPass());
|
||||
TargetMach->addAnalysisPasses(passes);
|
||||
|
||||
Triple TargetTriple(TargetMach->getTargetTriple());
|
||||
PassManagerBuilder PMB;
|
||||
PMB.DisableGVNLoadPRE = DisableGVNLoadPRE;
|
||||
@ -501,7 +504,7 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
|
||||
PMB.VerifyInput = true;
|
||||
PMB.VerifyOutput = true;
|
||||
|
||||
PMB.populateLTOPassManager(passes, TargetMach);
|
||||
PMB.populateLTOPassManager(passes);
|
||||
|
||||
PassManager codeGenPasses;
|
||||
|
||||
|
@ -478,13 +478,7 @@ void PassManagerBuilder::addLTOOptimizationPasses(PassManagerBase &PM) {
|
||||
PM.add(createMergeFunctionsPass());
|
||||
}
|
||||
|
||||
void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
|
||||
TargetMachine *TM) {
|
||||
if (TM) {
|
||||
PM.add(new DataLayoutPass());
|
||||
TM->addAnalysisPasses(PM);
|
||||
}
|
||||
|
||||
void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM) {
|
||||
if (LibraryInfo)
|
||||
PM.add(new TargetLibraryInfoWrapperPass(*LibraryInfo));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user