aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorRomaric Jodin <89833130+rjodinchr@users.noreply.github.com>2024-05-17 15:13:32 +0200
committerGitHub <noreply@github.com>2024-05-17 06:13:32 -0700
commit932ca85680db5e4579306f37e55746097fb8ec7f (patch)
tree8b9b846a4886d5c42a0a5f3162e4394ac3c6c130 /clang/lib/CodeGen/CodeGenFunction.cpp
parent3a32590f25482e283a79dea1f313a226a6dd392f (diff)
downloadllvm-932ca85680db5e4579306f37e55746097fb8ec7f.zip
llvm-932ca85680db5e4579306f37e55746097fb8ec7f.tar.gz
llvm-932ca85680db5e4579306f37e55746097fb8ec7f.tar.bz2
libclc: remove __attribute__((assume)) for clspv targets (#92126)
Instead add a proper attribute in clang, and add convert it to function metadata to keep the information in the IR. The goal is to remove the dependency on __attribute__((assume)) that should have not be there in the first place. Ref https://github.com/llvm/llvm-project/pull/84934
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 34dc0bd..04abdad 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -985,6 +985,11 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
EmitKernelMetadata(FD, Fn);
}
+ if (FD && FD->hasAttr<ClspvLibclcBuiltinAttr>()) {
+ Fn->setMetadata("clspv_libclc_builtin",
+ llvm::MDNode::get(getLLVMContext(), {}));
+ }
+
// If we are checking function types, emit a function type signature as
// prologue data.
if (FD && SanOpts.has(SanitizerKind::Function)) {