mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
If requested, apply function merging at -O0 too. It's useful there to reduce the time to compile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220537 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -159,18 +159,22 @@ void PassManagerBuilder::populateFunctionPassManager(FunctionPassManager &FPM) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
|
void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
|
||||||
// If all optimizations are disabled, just run the always-inline pass.
|
// If all optimizations are disabled, just run the always-inline pass and,
|
||||||
|
// if enabled, the function merging pass.
|
||||||
if (OptLevel == 0) {
|
if (OptLevel == 0) {
|
||||||
if (Inliner) {
|
if (Inliner) {
|
||||||
MPM.add(Inliner);
|
MPM.add(Inliner);
|
||||||
Inliner = nullptr;
|
Inliner = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: This is a HACK! The inliner pass above implicitly creates a CGSCC
|
// FIXME: The BarrierNoopPass is a HACK! The inliner pass above implicitly
|
||||||
// pass manager, but we don't want to add extensions into that pass manager.
|
// creates a CGSCC pass manager, but we don't want to add extensions into
|
||||||
// To prevent this we must insert a no-op module pass to reset the pass
|
// that pass manager. To prevent this we insert a no-op module pass to reset
|
||||||
// manager to get the same behavior as EP_OptimizerLast in non-O0 builds.
|
// the pass manager to get the same behavior as EP_OptimizerLast in non-O0
|
||||||
if (!GlobalExtensions->empty() || !Extensions.empty())
|
// builds. The function merging pass is
|
||||||
|
if (MergeFunctions)
|
||||||
|
MPM.add(createMergeFunctionsPass());
|
||||||
|
else if (!GlobalExtensions->empty() || !Extensions.empty())
|
||||||
MPM.add(createBarrierNoopPass());
|
MPM.add(createBarrierNoopPass());
|
||||||
|
|
||||||
addExtensionsToPM(EP_EnabledOnOptLevel0, MPM);
|
addExtensionsToPM(EP_EnabledOnOptLevel0, MPM);
|
||||||
|
Reference in New Issue
Block a user