diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPropagateAttributes.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPropagateAttributes.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPUPropagateAttributes.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUPropagateAttributes.cpp @@ -212,10 +212,10 @@ 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 @@ SmallSet NewRoots; SmallSet Replaced; - if (Roots.empty()) - return false; + assert(!Roots.empty()); Module &M = *(*Roots.begin())->getParent(); do { @@ -383,7 +382,7 @@ TM = &TPC->getTM(); } - if (!AMDGPU::isEntryFunctionCC(F.getCallingConv())) + if (!AMDGPU::isKernel(F.getCallingConv())) return false; return AMDGPUPropagateAttributes(TM, false).process(F);