Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/BackendUtil.cpp
Show First 20 Lines • Show All 566 Lines • ▼ Show 20 Lines | if (CodeGenOpts.OptimizationLevel <= 1) { | ||||
PMBuilder.Inliner = createAlwaysInlinerLegacyPass(InsertLifetimeIntrinsics); | PMBuilder.Inliner = createAlwaysInlinerLegacyPass(InsertLifetimeIntrinsics); | ||||
} else { | } else { | ||||
// We do not want to inline hot callsites for SamplePGO module-summary build | // We do not want to inline hot callsites for SamplePGO module-summary build | ||||
// because profile annotation will happen again in ThinLTO backend, and we | // because profile annotation will happen again in ThinLTO backend, and we | ||||
// want the IR of the hot path to match the profile. | // want the IR of the hot path to match the profile. | ||||
PMBuilder.Inliner = createFunctionInliningPass( | PMBuilder.Inliner = createFunctionInliningPass( | ||||
CodeGenOpts.OptimizationLevel, CodeGenOpts.OptimizeSize, | CodeGenOpts.OptimizationLevel, CodeGenOpts.OptimizeSize, | ||||
(!CodeGenOpts.SampleProfileFile.empty() && | (!CodeGenOpts.SampleProfileFile.empty() && | ||||
CodeGenOpts.PrepareForThinLTO)); | (CodeGenOpts.PrepareForThinLTO || CodeGenOpts.PrepareForLTO))); | ||||
} | } | ||||
PMBuilder.OptLevel = CodeGenOpts.OptimizationLevel; | PMBuilder.OptLevel = CodeGenOpts.OptimizationLevel; | ||||
PMBuilder.SizeLevel = CodeGenOpts.OptimizeSize; | PMBuilder.SizeLevel = CodeGenOpts.OptimizeSize; | ||||
PMBuilder.SLPVectorize = CodeGenOpts.VectorizeSLP; | PMBuilder.SLPVectorize = CodeGenOpts.VectorizeSLP; | ||||
PMBuilder.LoopVectorize = CodeGenOpts.VectorizeLoop; | PMBuilder.LoopVectorize = CodeGenOpts.VectorizeLoop; | ||||
PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops; | PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops; | ||||
▲ Show 20 Lines • Show All 1,102 Lines • Show Last 20 Lines |