From 932ca85680db5e4579306f37e55746097fb8ec7f Mon Sep 17 00:00:00 2001 From: Romaric Jodin <89833130+rjodinchr@users.noreply.github.com> Date: Fri, 17 May 2024 15:13:32 +0200 Subject: 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 --- clang/lib/CodeGen/CodeGenFunction.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') 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()) { + 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)) { -- cgit v1.1