Skip to content

Commit 0ba0398

Browse files
[amdgpu][lds] Use the same isKernel predicate consistently
isKernelCC != isKernel(F->getCallingConv()) There's a test case (lower-kernel-lds.ll) that explicitly skips amdgpu_ps so this change picks the isKernel predicate that continues to skip that calling convention. isKernel returns true for AMDGPU_KERNEL and SPIR_KERNEL. isKernelCC also returns true for other calling conventions. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D136599
1 parent b1fdeee commit 0ba0398

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class AMDGPULowerModuleLDS : public ModulePass {
259259

260260
IRBuilder<> Builder(Ctx);
261261
for (Function &Func : M.functions()) {
262-
if (!Func.isDeclaration() && AMDGPU::isKernelCC(&Func)) {
262+
if (!Func.isDeclaration() && AMDGPU::isKernel(Func.getCallingConv())) {
263263
const CallGraphNode *N = CG[&Func];
264264
const bool CalleesRequireModuleLDS = N->size() > 0;
265265

llvm/lib/Target/AMDGPU/Utils/AMDGPUMemoryUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static bool shouldLowerLDSToStruct(const GlobalVariable &GV,
4141
SmallPtrSet<const User *, 8> Visited;
4242
SmallVector<const User *, 16> Stack(GV.users());
4343

44-
assert(!F || isKernelCC(F));
44+
assert(!F || isKernel(F->getCallingConv()));
4545

4646
while (!Stack.empty()) {
4747
const User *V = Stack.pop_back_val();
@@ -62,7 +62,7 @@ static bool shouldLowerLDSToStruct(const GlobalVariable &GV,
6262
} else if (!F) {
6363
// For module LDS lowering, lowering is required if the user instruction
6464
// is from non-kernel function.
65-
Ret |= !isKernelCC(UF);
65+
Ret |= !isKernel(UF->getCallingConv());
6666
}
6767
continue;
6868
}

0 commit comments

Comments
 (0)