lalaniket8 wrote:
pinging for review @arsenm @yxsamliu @rjmccall
https://github.com/llvm/llvm-project/pull/115821
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6138,6 +6150,17 @@ void
CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD,
CodeGenFunction(*this).GenerateCode(GD, Fn, FI);
setNonAliasAttributes(GD, Fn);
+
+ if (D->hasAttr()) {
+if (GD.getKernelReferenceKind() == KernelReferenceKind::Stub) {
+ if (
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -emit-llvm -o - %s |
FileCheck %s
lalaniket8 wrote:
Changed test file to auto generate using update_cc_test_checks.py with
--include-generated-funcs argument. This can detect and include stub v
@@ -1162,9 +1162,15 @@ void
MicrosoftCXXNameMangler::mangleUnqualifiedName(GlobalDecl GD,
->getTemplatedDecl()
->hasAttr())) &&
GD.getKernelReferenceKind() == KernelReferenceKind::Stub;
+bool IsOCLDeviceStub =
+
@@ -6127,6 +6133,12 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType,
const auto *FnType = cast(PointeeType);
+ if (auto FD = dyn_cast_or_null(TargetDecl)) {
+if (FD->hasAttr()) {
+ CGM.getTargetCodeGenInfo().setOCLKernelStubCallingConvention(FnType);
+
@@ -498,7 +498,9 @@ CodeGenTypes::arrangeCXXConstructorCall(const CallArgList
&args,
/// Arrange the argument and result information for the declaration or
/// definition of the given function.
const CGFunctionInfo &
-CodeGenTypes::arrangeFunctionDeclaration(const FunctionDecl
@@ -1582,6 +1582,26 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD,
llvm::Function *Fn,
// Implicit copy-assignment gets the same special treatment as implicit
// copy-constructors.
emitImplicitAssignmentOperatorBody(Args);
+ } else if (FD->hasAttr() &&
+
@@ -1582,6 +1582,26 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD,
llvm::Function *Fn,
// Implicit copy-assignment gets the same special treatment as implicit
// copy-constructors.
emitImplicitAssignmentOperatorBody(Args);
+ } else if (FD->hasAttr() &&
+
lalaniket8 wrote:
> reverse ping
I have gone through all the review comments and made required changes. Awaiting
final review @yxsamliu @rjmccall @arsenm
https://github.com/llvm/llvm-project/pull/115821
___
cfe-commits mailing list
cfe-commits@lists
https://github.com/lalaniket8 created
https://github.com/llvm/llvm-project/pull/126488
This PR fixes the post merge check fails from PR
https://github.com/llvm/llvm-project/pull/125646
>From 37565e60b3325324c9396ce236cb005a958f157e Mon Sep 17 00:00:00 2001
From: anikelal
Date: Mon, 10 Feb 202
https://github.com/lalaniket8 closed
https://github.com/llvm/llvm-project/pull/126471
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/lalaniket8 closed
https://github.com/llvm/llvm-project/pull/125646
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/125646
>From 7be637fa9fcde8977f650e208c7ddc1495080941 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/3] [Driver][HIP] Do not pass -dependency-file flag for HIP
Device
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/126471
>From 7be637fa9fcde8977f650e208c7ddc1495080941 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/5] [Driver][HIP] Do not pass -dependency-file flag for HIP
Device
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/126471
>From 7be637fa9fcde8977f650e208c7ddc1495080941 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/4] [Driver][HIP] Do not pass -dependency-file flag for HIP
Device
https://github.com/lalaniket8 edited
https://github.com/llvm/llvm-project/pull/126471
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/lalaniket8 created
https://github.com/llvm/llvm-project/pull/126471
None
>From 7be637fa9fcde8977f650e208c7ddc1495080941 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/3] [Driver][HIP] Do not pass -dependency-file flag for HIP
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/125646
>From 7be637fa9fcde8977f650e208c7ddc1495080941 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/2] [Driver][HIP] Do not pass -dependency-file flag for HIP
Device
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/125646
>From 3608d77e3633d853682ffbae16c5b227259ed69c Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/2] [Driver][HIP] Do not pass -dependency-file flag for HIP
Device
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/125646
>From 3608d77e3633d853682ffbae16c5b227259ed69c Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/2] [Driver][HIP] Do not pass -dependency-file flag for HIP
Device
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/125646
>From 3608d77e3633d853682ffbae16c5b227259ed69c Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/4] [Driver][HIP] Do not pass -dependency-file flag for HIP
Device
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/125646
>From 3608d77e3633d853682ffbae16c5b227259ed69c Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/3] [Driver][HIP] Do not pass -dependency-file flag for HIP
Device
lalaniket8 wrote:
> need a lit test
Added
[dep-file-flag-with-multiple-offload-archs.hip](https://github.com/llvm/llvm-project/blob/62d313ab07199a90b0523e4be1bd4b0b555faf03/clang/test/Driver/dep-file-flag-with-multiple-offload-archs.hip)
https://github.com/llvm/llvm-project/pull/125646
___
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/125646
>From ae1f0e723ee8de2bc4f0032c884512ec79fae800 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 4 Feb 2025 12:13:20 +0530
Subject: [PATCH 1/2] [Driver][HIP] Do not pass -dependency-file flag for HIP
Device
https://github.com/lalaniket8 created
https://github.com/llvm/llvm-project/pull/125646
When we launch hipcc with multiple offload architectures along with -MF
dep_file flag, the clang compilation invocations for host and device offloads
write to the same dep_file, and can lead to collision dur
@@ -1582,6 +1582,26 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD,
llvm::Function *Fn,
// Implicit copy-assignment gets the same special treatment as implicit
// copy-constructors.
emitImplicitAssignmentOperatorBody(Args);
+ } else if (FD->hasAttr() &&
+
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -emit-llvm -o - %s |
FileCheck %s
+
+// CHECK: define dso_local amdgpu_kernel void @callee_kern({{.*}})
+__attribute__((noinline)) kernel void callee_kern(global int *A){
+ *A = 1;
+}
+
+__attribute__((noinline)
@@ -5692,7 +5692,10 @@ CGCallee CodeGenFunction::EmitCallee(const Expr *E) {
// Resolve direct calls.
} else if (auto DRE = dyn_cast(E)) {
if (auto FD = dyn_cast(DRE->getDecl())) {
- return EmitDirectCallee(*this, FD);
+ auto CalleeDecl = FD->hasAttr()
+
https://github.com/lalaniket8 deleted
https://github.com/llvm/llvm-project/pull/115821
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5692,7 +5692,10 @@ CGCallee CodeGenFunction::EmitCallee(const Expr *E) {
// Resolve direct calls.
} else if (auto DRE = dyn_cast(E)) {
if (auto FD = dyn_cast(DRE->getDecl())) {
- return EmitDirectCallee(*this, FD);
+ auto CalleeDecl = FD->hasAttr()
+
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -emit-llvm -o - %s |
FileCheck %s
+
+// CHECK: define dso_local amdgpu_kernel void @callee_kern({{.*}})
+__attribute__((noinline)) kernel void callee_kern(global int *A){
+ *A = 1;
+}
+
+__attribute__((noinline)
@@ -71,14 +71,19 @@ class GlobalDecl {
GlobalDecl(const FunctionDecl *D, unsigned MVIndex = 0)
: MultiVersionIndex(MVIndex) {
if (!D->hasAttr()) {
+ if (D->hasAttr()) {
+Value.setPointerAndInt(D, unsigned(KernelReferenceKind::Kernel));
+return;
@@ -2343,6 +2343,15 @@ void CodeGenModule::ConstructAttributeList(StringRef
Name,
// Collect function IR attributes from the CC lowering.
// We'll collect the paramete and result attributes later.
CallingConv = FI.getEffectiveCallingConvention();
+ GlobalDecl GD = Calle
@@ -1085,8 +1085,10 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const
CGBlockInfo &blockInfo) {
blockAddr.getPointer(),
ConvertType(blockInfo.getBlockExpr()->getType()));
if (IsOpenCL) {
-CGM.getOpenCLRuntime().recordBlockInfo(blockInfo.BlockExpression, Inv
@@ -1780,6 +1786,15 @@ void CXXNameMangler::mangleDeviceStubName(const
IdentifierInfo *II) {
<< II->getName();
}
+void CXXNameMangler::mangleOCLDeviceStubName(const IdentifierInfo *II) {
+ // ::= __clang_ocl_kern_imp_
+ // ::= [n]
+ // ::=
+ StringRef OCLDevi
@@ -1085,8 +1085,10 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const
CGBlockInfo &blockInfo) {
blockAddr.getPointer(),
ConvertType(blockInfo.getBlockExpr()->getType()));
if (IsOpenCL) {
-CGM.getOpenCLRuntime().recordBlockInfo(blockInfo.BlockExpression, Inv
https://github.com/lalaniket8 edited
https://github.com/llvm/llvm-project/pull/115821
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1780,6 +1786,15 @@ void CXXNameMangler::mangleDeviceStubName(const
IdentifierInfo *II) {
<< II->getName();
}
+void CXXNameMangler::mangleOCLDeviceStubName(const IdentifierInfo *II) {
+ // ::= __clang_ocl_kern_imp_
+ // ::= [n]
+ // ::=
+ StringRef OCLDevi
@@ -196,13 +203,21 @@ class GlobalDecl {
}
GlobalDecl getWithKernelReferenceKind(KernelReferenceKind Kind) {
-assert(isa(getDecl()) &&
- cast(getDecl())->hasAttr() &&
- "Decl is not a GPU kernel!");
+assert((isa(getDecl()) &&
+cast(g
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/115821
>From 107f8dbc6b2fa157ce3936a086093882012b9d62 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Mon, 25 Nov 2024 14:18:36 +0530
Subject: [PATCH 1/2] [Clang][OpenCL][AMDGPU] Allow a kernel to call another
kernel
https://github.com/lalaniket8 edited
https://github.com/llvm/llvm-project/pull/115821
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -emit-llvm -o - %s |
FileCheck %s
lalaniket8 wrote:
The `update_cc_test_checks.py ` script iterates over clang AST generated by the
provided runline.
Since the stub variant are not present in
@@ -127,7 +127,10 @@ static const BlockExpr *getBlockExpr(const Expr *E) {
void CGOpenCLRuntime::recordBlockInfo(const BlockExpr *E,
llvm::Function *InvokeF,
llvm::Value *Block, llvm::Type *BlockTy)
{
@@ -126,3 +137,19 @@ void use() {
// FVIS-DEFAULT: declare void @ext_func_default()
// FVIS-PROTECTED: declare void @ext_func_default()
// FVIS-HIDDEN: declare void @ext_func_default()
+
+// FVIS-DEFAULT: define{{.*}} void @__clang_ocl_kern_imp_kern()
+// FVIS-PROTECTED: define
https://github.com/lalaniket8 edited
https://github.com/llvm/llvm-project/pull/115821
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/lalaniket8 edited
https://github.com/llvm/llvm-project/pull/115821
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/lalaniket8 ready_for_review
https://github.com/llvm/llvm-project/pull/115821
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/115821
>From 00167a3caa6cf2c790d1203797e5b98cb9563c44 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Mon, 25 Nov 2024 14:18:36 +0530
Subject: [PATCH] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel
Thi
@@ -127,7 +127,10 @@ static const BlockExpr *getBlockExpr(const Expr *E) {
void CGOpenCLRuntime::recordBlockInfo(const BlockExpr *E,
llvm::Function *InvokeF,
llvm::Value *Block, llvm::Type *BlockTy)
{
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/115821
>From 61c90047a2e82e8dd051363f9e56e52e9931c481 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Mon, 25 Nov 2024 14:18:36 +0530
Subject: [PATCH] OpenCL allows a kernel function to call another kernel
function.
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/115821
>From f8265debdf3fcd7b3097f18d3823c6fdc8a20ef2 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 12 Nov 2024 11:30:45 +0530
Subject: [PATCH] [Clang][AMDGPU] Emit stub version of OpenCL Kernel
OpenCL allows
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/115821
>From 9449cea8e3dd822508c8933d38f15290306bc9ab Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 12 Nov 2024 11:30:45 +0530
Subject: [PATCH] [Clang][AMDGPU] Emit stub version of OpenCL Kernel
OpenCL allows
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/115821
>From d3f01b0578135588fb04596dcaa57d442be7a3d7 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 12 Nov 2024 11:30:45 +0530
Subject: [PATCH] [Clang][AMDGPU] Emit stub version of OpenCL Kernel
OpenCL allows
https://github.com/lalaniket8 updated
https://github.com/llvm/llvm-project/pull/115821
>From 131a8180bc66f7f95e765d98e7d66ce30f03bd40 Mon Sep 17 00:00:00 2001
From: anikelal
Date: Tue, 12 Nov 2024 11:30:45 +0530
Subject: [PATCH] [Clang][AMDGPU] Emit stub version of OpenCL Kernel
OpenCL allows
lalaniket8 wrote:
* **#115821** https://app.graphite.dev/github/pr/llvm/llvm-project/115821?utm_source=stack-comment-icon";
target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite"
width="10px" height="10px"/> 👈
* `main`
This stack of pull requests is managed by Gr
https://github.com/lalaniket8 created
https://github.com/llvm/llvm-project/pull/115821
OpenCL allows a kernel function to call another kernel function.
To facilitate this we emit a stub version of each kernel function
with different name mangling scheme, and replace the kernel
callsite appropria
56 matches
Mail list logo