Skip to content

Commit 50fd459

Browse files
authored
restore PromoteKernelArg pass (llvm#1908)
2 parents eb31ea5 + 4e9c5e5 commit 50fd459

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,13 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
892892

893893
PB.registerFullLinkTimeOptimizationLastEPCallback(
894894
[this](ModulePassManager &PM, OptimizationLevel Level) {
895+
896+
// Promote kernel arguments to global address space for LLVM IR
897+
// generated by flang compiler
898+
FunctionPassManager FPM;
899+
FPM.addPass(AMDGPUPromoteKernelArgumentsPass());
900+
PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
901+
895902
// When we are using -fgpu-rdc, we can only run accelerator code
896903
// selection after linking to prevent, otherwise we end up removing
897904
// potentially reachable symbols that were exported as external in other

0 commit comments

Comments
 (0)