Skip to content

Commit 013801b

Browse files
author
anikelal
committed
[Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel
Simplifying isDeclOpenCLKernel() and removing resolved comments
1 parent 107f8db commit 013801b

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

clang/include/clang/AST/GlobalDecl.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,9 @@ class GlobalDecl {
213213
}
214214

215215
bool isDeclOpenCLKernel() const {
216-
auto FD = dyn_cast<FunctionDecl>(getDecl());
217-
if (FD)
216+
if (auto FD = dyn_cast<FunctionDecl>(getDecl()))
218217
return FD->hasAttr<OpenCLKernelAttr>();
219-
return FD;
218+
return false;
220219
}
221220
};
222221

clang/lib/CodeGen/CGOpenCLRuntime.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ void CGOpenCLRuntime::recordBlockInfo(const BlockExpr *E,
129129
llvm::Value *Block, llvm::Type *BlockTy,
130130
bool isBlkExprInOCLKern) {
131131

132-
// FIXME: Since OpenCL Kernels are emitted twice (kernel version and stub
133-
// version), its constituent BlockExpr will also be emitted twice.
134132
assert((!EnqueuedBlockMap.contains(E) ||
135133
EnqueuedBlockMap[E].isBlkExprInOCLKern != isBlkExprInOCLKern) &&
136134
"Block expression emitted twice");

0 commit comments

Comments
 (0)