forked from OSchip/llvm-project
[AMDGPU] Avoid processing functions in amdgpu-propagate-attributes pass for shaders
The pass amdgpu-propagate-attributes ("Early/Late propagate attributes from kernels to functions") is currently run also for shaders, where it does nothing. Modify the check so the pass only processes functions for kernels. Differential Revision: https://reviews.llvm.org/D109961
This commit is contained in:
parent
3778c1cd6e
commit
2ac53fffae
|
@ -212,10 +212,10 @@ AMDGPUPropagateAttributes::findFunction(const FnProperties &PropsNeeded,
|
|||
|
||||
bool AMDGPUPropagateAttributes::process(Module &M) {
|
||||
for (auto &F : M.functions())
|
||||
if (AMDGPU::isEntryFunctionCC(F.getCallingConv()))
|
||||
if (AMDGPU::isKernel(F.getCallingConv()))
|
||||
Roots.insert(&F);
|
||||
|
||||
return process();
|
||||
return Roots.empty() ? false : process();
|
||||
}
|
||||
|
||||
bool AMDGPUPropagateAttributes::process(Function &F) {
|
||||
|
@ -228,8 +228,7 @@ bool AMDGPUPropagateAttributes::process() {
|
|||
SmallSet<Function *, 32> NewRoots;
|
||||
SmallSet<Function *, 32> Replaced;
|
||||
|
||||
if (Roots.empty())
|
||||
return false;
|
||||
assert(!Roots.empty());
|
||||
Module &M = *(*Roots.begin())->getParent();
|
||||
|
||||
do {
|
||||
|
@ -383,7 +382,7 @@ bool AMDGPUPropagateAttributesEarly::runOnFunction(Function &F) {
|
|||
TM = &TPC->getTM<TargetMachine>();
|
||||
}
|
||||
|
||||
if (!AMDGPU::isEntryFunctionCC(F.getCallingConv()))
|
||||
if (!AMDGPU::isKernel(F.getCallingConv()))
|
||||
return false;
|
||||
|
||||
return AMDGPUPropagateAttributes(TM, false).process(F);
|
||||
|
|
Loading…
Reference in New Issue