1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[NewPM][AMDGPU] Skip adding CGSCCOptimizerLate callbacks at O0

The legacy PM's EP_CGSCCOptimizerLate was only used under not-O0.

Fixes clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp under the new PM.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D95250
This commit is contained in:
Arthur Eubanks 2021-01-22 10:47:10 -08:00
parent 5970515ef3
commit 219650917f

View File

@ -579,24 +579,27 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB,
PB.registerCGSCCOptimizerLateEPCallback(
[this, DebugPassManager](CGSCCPassManager &PM,
PassBuilder::OptimizationLevel Level) {
FunctionPassManager FPM(DebugPassManager);
if (Level == PassBuilder::OptimizationLevel::O0)
return;
// Add infer address spaces pass to the opt pipeline after inlining
// but before SROA to increase SROA opportunities.
FPM.addPass(InferAddressSpacesPass());
FunctionPassManager FPM(DebugPassManager);
// This should run after inlining to have any chance of doing
// anything, and before other cleanup optimizations.
FPM.addPass(AMDGPULowerKernelAttributesPass());
// Add infer address spaces pass to the opt pipeline after inlining
// but before SROA to increase SROA opportunities.
FPM.addPass(InferAddressSpacesPass());
if (Level != PassBuilder::OptimizationLevel::O0) {
// Promote alloca to vector before SROA and loop unroll. If we
// manage to eliminate allocas before unroll we may choose to unroll
// less.
FPM.addPass(AMDGPUPromoteAllocaToVectorPass(*this));
}
// This should run after inlining to have any chance of doing
// anything, and before other cleanup optimizations.
FPM.addPass(AMDGPULowerKernelAttributesPass());
PM.addPass(createCGSCCToFunctionPassAdaptor(std::move(FPM)));
if (Level != PassBuilder::OptimizationLevel::O0) {
// Promote alloca to vector before SROA and loop unroll. If we
// manage to eliminate allocas before unroll we may choose to unroll
// less.
FPM.addPass(AMDGPUPromoteAllocaToVectorPass(*this));
}
PM.addPass(createCGSCCToFunctionPassAdaptor(std::move(FPM)));
});
}