[llvm] [SPIRV] Added support for extension SPV_INTEL_fpga_buffer_location (PR #133679)
Aadesh Premkumar via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 1 02:05:15 PST 2025
https://github.com/aadeshps-mcw updated https://github.com/llvm/llvm-project/pull/133679
>From bbd2f93824de3d2746f7f61ca3b60676fc2099f9 Mon Sep 17 00:00:00 2001
From: Aadesh PremKumar <aadesh.premkumar at multicorewareinc.com>
Date: Fri, 30 May 2025 10:40:58 +0530
Subject: [PATCH] --Added support for the extension
SPV_INTEL_fpga_buffer_location
---
llvm/docs/SPIRVUsage.rst | 3 +-
llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp | 9 ++
llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp | 4 +-
llvm/lib/Target/SPIRV/SPIRVMetadata.cpp | 12 +++
llvm/lib/Target/SPIRV/SPIRVMetadata.h | 5 +-
llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp | 3 +
.../lib/Target/SPIRV/SPIRVSymbolicOperands.td | 3 +
.../FPGABufferLocation.ll | 102 ++++++++++++++++++
...ycl-buffer-location-with-ptr-annotation.ll | 76 +++++++++++++
9 files changed, 214 insertions(+), 3 deletions(-)
create mode 100644 llvm/test/CodeGen/SPIRV/extensions/SPV_ALTERA_fpga_buffer_location/FPGABufferLocation.ll
create mode 100644 llvm/test/CodeGen/SPIRV/extensions/SPV_ALTERA_fpga_buffer_location/sycl-buffer-location-with-ptr-annotation.ll
diff --git a/llvm/docs/SPIRVUsage.rst b/llvm/docs/SPIRVUsage.rst
index 88164e6fa53d8..6c43ca25a4885 100644
--- a/llvm/docs/SPIRVUsage.rst
+++ b/llvm/docs/SPIRVUsage.rst
@@ -247,7 +247,8 @@ Below is a list of supported SPIR-V extensions, sorted alphabetically by their e
- Adds new pipe read and write functions that have blocking semantics instead of the non-blocking semantics of the existing pipe read/write functions.
* - ``SPV_ALTERA_arbitrary_precision_fixed_point``
- Add instructions for fixed point arithmetic. The extension works without SPV_ALTERA_arbitrary_precision_integers, but together they allow greater flexibility in representing arbitrary precision data types.
-
+ * - ``SPV_ALTERA_fpga_buffer_location``
+ - Adds a pointer decoration for FPGA targets, indicating that a global memory pointer accesses only a specific physical memory location.
SPIR-V representation in LLVM IR
================================
diff --git a/llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp b/llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
index dd57b74d79a5e..a54d2ffce2a44 100644
--- a/llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
@@ -394,6 +394,15 @@ bool SPIRVCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
buildOpDecorate(VRegs[i][0], MIRBuilder, Decoration, {});
}
+ if (MDNode *Node = F.getMetadata("kernel_arg_buffer_location")) {
+ int64_t BufferLoc =
+ processKernelArgBufferLocation(F, Node, i, VRegs, -1);
+ if (BufferLoc != -1)
+ buildOpDecorate(VRegs[i][0], MIRBuilder,
+ SPIRV::Decoration::BufferLocationALTERA,
+ {static_cast<uint32_t>(BufferLoc)});
+ }
+
MDNode *Node = F.getMetadata("spirv.ParameterDecorations");
if (Node && i < Node->getNumOperands() &&
isa<MDNode>(Node->getOperand(i))) {
diff --git a/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp b/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
index 146384f4bf08c..4755959f97de0 100644
--- a/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
@@ -167,7 +167,9 @@ static const std::map<std::string, SPIRV::Extension::Extension, std::less<>>
{"SPV_INTEL_int4", SPIRV::Extension::Extension::SPV_INTEL_int4},
{"SPV_ALTERA_arbitrary_precision_fixed_point",
SPIRV::Extension::Extension::
- SPV_ALTERA_arbitrary_precision_fixed_point}};
+ SPV_ALTERA_arbitrary_precision_fixed_point},
+ {"SPV_ALTERA_fpga_buffer_location",
+ SPIRV::Extension::Extension::SPV_ALTERA_fpga_buffer_location}};
bool SPIRVExtensionsParser::parse(cl::Option &O, StringRef ArgName,
StringRef ArgValue,
diff --git a/llvm/lib/Target/SPIRV/SPIRVMetadata.cpp b/llvm/lib/Target/SPIRV/SPIRVMetadata.cpp
index 3800aac70df32..75523626b7878 100644
--- a/llvm/lib/Target/SPIRV/SPIRVMetadata.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVMetadata.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "SPIRVMetadata.h"
+#include "llvm/IR/Constants.h"
using namespace llvm;
@@ -82,4 +83,15 @@ MDString *getOCLKernelArgTypeQual(const Function &F, unsigned ArgIdx) {
return getOCLKernelArgAttribute(F, ArgIdx, "kernel_arg_type_qual");
}
+int64_t processKernelArgBufferLocation(
+ const Function &F, MDNode *Node, int i,
+ llvm::ArrayRef<llvm::ArrayRef<llvm::Register>> VRegs, int64_t BufferLoc) {
+ if (Node && static_cast<unsigned>(i) < Node->getNumOperands())
+ if (auto *CI = dyn_cast<ConstantInt>(
+ cast<ConstantAsMetadata>(Node->getOperand(i))->getValue()))
+ if (F.getFunctionType()->getParamType(i)->isPointerTy())
+ return CI->getSExtValue();
+ return BufferLoc;
+}
+
} // namespace llvm
diff --git a/llvm/lib/Target/SPIRV/SPIRVMetadata.h b/llvm/lib/Target/SPIRV/SPIRVMetadata.h
index fb4269457d6dd..22f8cacc062c7 100644
--- a/llvm/lib/Target/SPIRV/SPIRVMetadata.h
+++ b/llvm/lib/Target/SPIRV/SPIRVMetadata.h
@@ -14,6 +14,7 @@
#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVMETADATA_H
#define LLVM_LIB_TARGET_SPIRV_SPIRVMETADATA_H
+#include "llvm/CodeGen/Register.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
@@ -25,6 +26,8 @@ namespace llvm {
MDString *getOCLKernelArgAccessQual(const Function &F, unsigned ArgIdx);
MDString *getOCLKernelArgTypeQual(const Function &F, unsigned ArgIdx);
-
+int64_t processKernelArgBufferLocation(
+ const Function &F, MDNode *Node, int i,
+ llvm::ArrayRef<llvm::ArrayRef<llvm::Register>> VRegs, int64_t BufferLoc);
} // namespace llvm
#endif // LLVM_LIB_TARGET_SPIRV_METADATA_H
diff --git a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
index 2feb73d8dedfa..a4e9d1d03774b 100644
--- a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
@@ -1002,6 +1002,9 @@ static void addOpDecorateReqs(const MachineInstr &MI, unsigned DecIndex,
Reqs.addRequirements(SPIRV::Capability::FloatControls2);
Reqs.addExtension(SPIRV::Extension::SPV_KHR_float_controls2);
}
+ } else if (Dec == SPIRV::Decoration::BufferLocationALTERA) {
+ Reqs.addRequirements(SPIRV::Capability::FPGABufferLocationALTERA);
+ Reqs.addExtension(SPIRV::Extension::SPV_ALTERA_fpga_buffer_location);
}
}
diff --git a/llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td b/llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
index 94e0138c66487..7aadeb548b6e6 100644
--- a/llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
+++ b/llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
@@ -391,6 +391,7 @@ defm SPV_INTEL_bfloat16_arithmetic
: ExtensionOperand<129, [EnvVulkan, EnvOpenCL]>;
defm SPV_INTEL_16bit_atomics : ExtensionOperand<130, [EnvVulkan, EnvOpenCL]>;
defm SPV_ALTERA_arbitrary_precision_fixed_point : ExtensionOperand<131, [EnvOpenCL, EnvVulkan]>;
+defm SPV_ALTERA_fpga_buffer_location : ExtensionOperand<132, [EnvVulkan, EnvOpenCL]>;
//===----------------------------------------------------------------------===//
// Multiclass used to define Capabilities enum values and at the same time
@@ -617,6 +618,7 @@ defm BFloat16DotProductKHR : CapabilityOperand<5117, 0, 0, [SPV_KHR_bfloat16], [
defm BFloat16CooperativeMatrixKHR : CapabilityOperand<5118, 0, 0, [SPV_KHR_bfloat16], [BFloat16TypeKHR, CooperativeMatrixKHR]>;
defm BlockingPipesALTERA : CapabilityOperand<5945, 0, 0, [SPV_ALTERA_blocking_pipes], []>;
defm ArbitraryPrecisionFixedPointALTERA : CapabilityOperand<5922, 0, 0, [SPV_ALTERA_arbitrary_precision_fixed_point], []>;
+defm FPGABufferLocationALTERA : CapabilityOperand<5920, 0, 0, [SPV_ALTERA_fpga_buffer_location], []>;
//===----------------------------------------------------------------------===//
// Multiclass used to define SourceLanguage enum values and at the same time
@@ -1403,6 +1405,7 @@ defm FunctionFloatingPointModeINTEL : DecorationOperand<6080, 0, 0, [], [Functio
defm AliasScopeINTEL : DecorationOperand<5914, 0, 0, [], [MemoryAccessAliasingINTEL]>;
defm NoAliasINTEL : DecorationOperand<5915, 0, 0, [], [MemoryAccessAliasingINTEL]>;
defm FPMaxErrorDecorationINTEL : DecorationOperand<6170, 0, 0, [], [FPMaxErrorINTEL]>;
+defm BufferLocationALTERA : DecorationOperand<5921, 0, 0, [SPV_ALTERA_fpga_buffer_location], [FPGABufferLocationALTERA]>;
//===----------------------------------------------------------------------===//
// Multiclass used to define BuiltIn enum values and at the same time
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_ALTERA_fpga_buffer_location/FPGABufferLocation.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_ALTERA_fpga_buffer_location/FPGABufferLocation.ll
new file mode 100644
index 0000000000000..f179425c4a3f6
--- /dev/null
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_ALTERA_fpga_buffer_location/FPGABufferLocation.ll
@@ -0,0 +1,102 @@
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_ALTERA_fpga_buffer_location %s -o %t.spt
+; RUN: FileCheck %s --input-file=%t.spt
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_ALTERA_fpga_buffer_location %s -o - -filetype=obj | spirv-val %}
+
+; CHECK-DAG: OpCapability FPGABufferLocationALTERA
+; CHECK-DAG: OpExtension "SPV_ALTERA_fpga_buffer_location"
+; CHECK-DAG: OpName %[[#ARGA:]] "a"
+; CHECK-DAG: OpName %[[#ARGB:]] "b"
+; CHECK-DAG: OpName %[[#ARGC:]] "c"
+; CHECK-DAG: OpName %[[#ARGD:]] "d"
+; CHECK-DAG: OpName %[[#ARGE:]] "e"
+; CHECK-NOT: OpDecorate %[[#ARGC]] BufferLocationALTERA -1
+; CHECK-NOT: OpDecorate %[[#ARGC]] BufferLocationALTERA -1
+; CHECK-DAG: OpDecorate %[[#ARGA]] BufferLocationALTERA 1
+; CHECK-DAG: OpDecorate %[[#ARGB]] BufferLocationALTERA 2
+; CHECK-NOT: OpDecorate %[[#ARGD]] BufferLocationALTERA -1
+; CHECK-NOT: OpDecorate %[[#ARGE]] BufferLocationALTERA 3
+; CHECK-DAG: OpDecorate %[[#]] BufferLocationALTERA 123456789
+
+; CHECK-DAG: %[[#]] = OpFunction
+; CHECK-DAG: %[[#ARGA]] = OpFunctionParameter %[[#]]
+; CHECK-DAG: %[[#ARGB]] = OpFunctionParameter %[[#]]
+; CHECK-DAG: %[[#ARGC]] = OpFunctionParameter %[[#]]
+
+%struct.MyIP = type { ptr addrspace(4) }
+
+ at .str.4 = internal unnamed_addr addrspace(1) constant [19 x i8] c"{5921:\22123456789\22}\00"
+ at .str.1 = internal unnamed_addr addrspace(1) constant [9 x i8] c"main.cpp\00"
+
+define spir_kernel void @test(ptr addrspace(1) %a, ptr addrspace(1) %b, ptr addrspace(1) %c, i32 %d, i32 %e) local_unnamed_addr !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_buffer_location !6
+{
+entry:
+ ret void
+}
+
+define spir_kernel void @test.1(ptr addrspace(4) %a) #0
+{
+entry:
+ %0 = call ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4) %a, ptr addrspace(1) getelementptr inbounds ([19 x i8], ptr addrspace(1) @.str.4, i32 0, i32 0), ptr addrspace(1) getelementptr inbounds ([9 x i8], ptr addrspace(1) @.str.1, i32 0, i32 0), i32 7, ptr addrspace(1) null)
+ store i8 0, ptr addrspace(4) %0, align 8
+ ret void
+}
+
+$test.2 = comdat any
+define weak_odr dso_local spir_kernel void @test.2(ptr addrspace(1) align 4 %arg_a) #0 comdat !kernel_arg_buffer_location !7 {
+entry:
+ %this.addr.i = alloca ptr addrspace(4), align 8
+ %arg_a.addr = alloca ptr addrspace(1), align 8
+ %MyIP = alloca %struct.MyIP, align 8
+ %arg_a.addr.ascast = addrspacecast ptr %arg_a.addr to ptr addrspace(4)
+ %MyIP.ascast = addrspacecast ptr %MyIP to ptr addrspace(4)
+ store ptr addrspace(1) %arg_a, ptr addrspace(4) %arg_a.addr.ascast, align 8
+ %a = getelementptr inbounds %struct.MyIP, ptr addrspace(4) %MyIP.ascast, i32 0, i32 0
+ %0 = call ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4) %a, ptr addrspace(1) getelementptr inbounds ([33 x i8], ptr addrspace(1) @.str.4, i32 0, i32 0), ptr addrspace(1) getelementptr inbounds ([9 x i8], ptr addrspace(1) @.str.1, i32 0, i32 0), i32 7, ptr addrspace(1) null)
+ %b = load ptr addrspace(1), ptr addrspace(4) %arg_a.addr.ascast, align 8
+ %1 = addrspacecast ptr addrspace(1) %b to ptr addrspace(4)
+ store ptr addrspace(4) %1, ptr addrspace(4) %0, align 8
+ %this.addr.ascast.i = addrspacecast ptr %this.addr.i to ptr addrspace(4)
+ store ptr addrspace(4) %MyIP.ascast, ptr addrspace(4) %this.addr.ascast.i, align 8
+ %this1.i = load ptr addrspace(4), ptr addrspace(4) %this.addr.ascast.i, align 8
+ %a.i = getelementptr inbounds %struct.MyIP, ptr addrspace(4) %this1.i, i32 0, i32 0
+ %2 = call ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4) %a.i, ptr addrspace(1) getelementptr inbounds ([19 x i8], ptr addrspace(1) @.str.4, i32 0, i32 0), ptr addrspace(1) getelementptr inbounds ([9 x i8], ptr addrspace(1) @.str.1, i32 0, i32 0), i32 7, ptr addrspace(1) null)
+ %3 = load ptr addrspace(4), ptr addrspace(4) %2, align 8
+ %4 = load i32, ptr addrspace(4) %3, align 4
+ %inc.i = add nsw i32 %4, 1
+ store i32 %inc.i, ptr addrspace(4) %3, align 4
+ ret void
+}
+
+define spir_kernel void @test.3(ptr addrspace(1) align 4 %arg_a, ptr %arg_b) {
+entry:
+ %this.addr.i = alloca ptr addrspace(4), align 8
+ %arg_a.addr = alloca ptr addrspace(1), align 8
+ %MyIP = alloca %struct.MyIP, align 8
+ %arg_a.addr.ascast = addrspacecast ptr %arg_a.addr to ptr addrspace(4)
+ %MyIP.ascast = addrspacecast ptr %MyIP to ptr addrspace(4)
+ store ptr addrspace(1) %arg_a, ptr addrspace(4) %arg_a.addr.ascast, align 8
+ %a = getelementptr inbounds %struct.MyIP, ptr addrspace(4) %MyIP.ascast, i32 0, i32 0
+ %0 = call ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4) %a, ptr addrspace(1) getelementptr inbounds ([19 x i8], ptr addrspace(1) @.str.4, i32 0, i32 0), ptr addrspace(1) getelementptr inbounds ([9 x i8], ptr addrspace(1) @.str.1, i32 0, i32 0), i32 7, ptr addrspace(1) null)
+ call void @llvm.memcpy.p4.p0(ptr addrspace(4) %0, ptr %arg_b, i64 4, i1 false)
+ ret void
+}
+
+declare ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4), ptr addrspace(1), ptr addrspace(1), i32, ptr addrspace(1)) #1
+declare void @llvm.memcpy.p4.p0(ptr addrspace(4) noalias captures(none) writeonly, ptr noalias captures(none) readonly, i64, i1 immarg) #2
+
+!opencl.enable.FP_CONTRACT = !{}
+!opencl.ocl.version = !{!0}
+!opencl.spir.version = !{!0}
+!opencl.used.extensions = !{!1}
+!opencl.used.optional.core.features = !{!1}
+!opencl.compiler.options = !{!1}
+!llvm.ident = !{!2}
+
+!0 = !{i32 2, i32 0}
+!1 = !{}
+!2 = !{!""}
+!3 = !{i32 1, i32 1, i32 1}
+!4 = !{!"none", !"none", !"none"}
+!5 = !{!"int*", !"float*", !"int*"}
+!6 = !{i32 1, i32 2, i32 -1, i32 -1, i32 3}
+!7 = !{i32 -1}
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_ALTERA_fpga_buffer_location/sycl-buffer-location-with-ptr-annotation.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_ALTERA_fpga_buffer_location/sycl-buffer-location-with-ptr-annotation.ll
new file mode 100644
index 0000000000000..0723d3ff70eca
--- /dev/null
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_ALTERA_fpga_buffer_location/sycl-buffer-location-with-ptr-annotation.ll
@@ -0,0 +1,76 @@
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_ALTERA_fpga_buffer_location %s -o %t.spt
+; RUN: FileCheck %s --input-file=%t.spt
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_ALTERA_fpga_buffer_location %s -o - -filetype=obj | spirv-val %}
+
+; CHECK-DAG: OpDecorate %[[#Ptr1:]] BufferLocationALTERA 0
+; CHECK-DAG: OpDecorate %[[#Ptr2:]] BufferLocationALTERA 0
+
+; CHECK-DAG: %[[#Ptr1]] = OpLoad %[[#]]
+; CHECK-DAG: OpReturnValue %[[#Ptr1]]
+
+; CHECK-DAG: %[[#Bitcast:]] = OpBitcast %[[#]] %[[#]]
+; CHECK-DAG: %[[#Ptr2]] = OpInBoundsPtrAccessChain %[[#]] %[[#Bitcast]] %[[#]] %[[#]]
+; CHECK-DAG: OpReturnValue %[[#Ptr2]]
+
+%struct.MyIP = type <{ ptr addrspace(4), i32, [4 x i8] }>
+
+$_ZNK4MyIPclEv = comdat any
+$_Z8annotateIiEPT_S1_ = comdat any
+$_Z9annotate2IiEPT_S1_ = comdat any
+
+ at .str = private unnamed_addr addrspace(1) constant [16 x i8] c"sycl-properties\00", section "llvm.metadata"
+ at .str.1 = private unnamed_addr addrspace(1) constant [9 x i8] c"test.cpp\00", section "llvm.metadata"
+ at .str.2 = private unnamed_addr addrspace(1) constant [21 x i8] c"sycl-buffer-location\00", section "llvm.metadata"
+ at .str.3 = private unnamed_addr addrspace(1) constant [2 x i8] c"0\00", section "llvm.metadata"
+ at .args = private unnamed_addr addrspace(1) constant { ptr addrspace(1), ptr addrspace(1) } { ptr addrspace(1) @.str.2, ptr addrspace(1) @.str.3 }, section "llvm.metadata"
+ at .str.4 = private unnamed_addr addrspace(1) constant [11 x i8] c"{5921:\220\22}\00", section "llvm.metadata"
+
+define linkonce_odr dso_local spir_func void @_ZNK4MyIPclEv(ptr addrspace(4) %this) comdat align 2 !srcloc !8 {
+entry:
+ %call1 = call spir_func noundef ptr addrspace(4) @_Z8annotateIiEPT_S1_(ptr addrspace(4) noundef %this)
+ %call2 = call spir_func noundef ptr addrspace(4) @_Z9annotate2IiEPT_S1_(ptr addrspace(4) noundef %this)
+ ret void
+}
+
+define linkonce_odr dso_local spir_func noundef ptr addrspace(4) @_Z8annotateIiEPT_S1_(ptr addrspace(4) noundef %ptr) comdat !srcloc !9 {
+entry:
+ %retval = alloca ptr addrspace(4), align 8
+ %ptr.addr = alloca ptr addrspace(4), align 8
+ %retval.ascast = addrspacecast ptr %retval to ptr addrspace(4)
+ %ptr.addr.ascast = addrspacecast ptr %ptr.addr to ptr addrspace(4)
+ store ptr addrspace(4) %ptr, ptr addrspace(4) %ptr.addr.ascast, align 8
+ %0 = load ptr addrspace(4), ptr addrspace(4) %ptr.addr.ascast, align 8
+ %1 = call ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4) %0, ptr addrspace(1) @.str.4, ptr addrspace(1) @.str.1, i32 25, ptr addrspace(1) null)
+ ret ptr addrspace(4) %1
+}
+
+define linkonce_odr dso_local spir_func noundef ptr addrspace(4) @_Z9annotate2IiEPT_S1_(ptr addrspace(4) noundef %ptr) comdat !srcloc !9 {
+entry:
+ %retval = alloca ptr addrspace(4), align 8
+ %ptr.addr = alloca ptr addrspace(4), align 8
+ %retval.ascast = addrspacecast ptr %retval to ptr addrspace(4)
+ %ptr.addr.ascast = addrspacecast ptr %ptr.addr to ptr addrspace(4)
+ store ptr addrspace(4) %ptr, ptr addrspace(4) %ptr.addr.ascast, align 8
+ %0 = load ptr addrspace(4), ptr addrspace(4) %ptr.addr.ascast, align 8
+ %1 = getelementptr inbounds %struct.MyIP, ptr addrspace(4) %0, i32 0, i32 0
+ %2 = call ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4) %1, ptr addrspace(1) @.str.4, ptr addrspace(1) @.str.1, i32 25, ptr addrspace(1) null)
+ ret ptr addrspace(4) %2
+}
+
+declare ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4), ptr addrspace(1), ptr addrspace(1), i32, ptr addrspace(1))
+
+!llvm.module.flags = !{!0, !1}
+!opencl.spir.version = !{!2}
+!spirv.Source = !{!3}
+!llvm.ident = !{!4}
+
+!0 = !{i32 1, !"wchar_size", i32 4}
+!1 = !{i32 7, !"frame-pointer", i32 2}
+!2 = !{i32 1, i32 2}
+!3 = !{i32 4, i32 100000}
+!4 = !{!"Intel(R) oneAPI DPC++/C++ Compiler 2024.2.0 (2024.x.0.YYYYMMDD)"}
+!5 = !{i32 717}
+!6 = !{i32 -1, i32 -1}
+!7 = !{}
+!8 = !{i32 1004}
+!9 = !{i32 563}
More information about the llvm-commits
mailing list