The new pass walks kernel's pointer arguments, then loads from them.
If a loaded value is a pointer and loaded pointer is unmodified in
the kernel before the load, then promote loaded pointer to global.
Then recursively continue.
Details
Details
Diff Detail
Diff Detail
clang-format: please reformat the code
- PassManagerBuilder::EP_CGSCCOptimizerLate, - [EnableOpt, PromoteKernelArguments](const PassManagerBuilder &, - legacy::PassManagerBase &PM) { - // Add promote kernel arguments pass to the opt pipeline right before - // infer address spaces which is needed to do actual address space - // rewriting. - if (PromoteKernelArguments) - PM.add(createAMDGPUPromoteKernelArgumentsPass()); - - // Add infer address spaces pass to the opt pipeline after inlining34 diff lines are omitted. See full path.