Skip to content

Commit 2f02cb9

Browse files
wenju-heigcbot
authored andcommitted
Support bindless sampler kernel argument and SYCL bindless sampler
* For bindless sampler passed as kernel argument, e.g. set by OpenCL setKernelArg or L0 zeKernelSetArgumentValue API, bindless sampler offset is obtained from kernel argument directly. * For SYCL bindless sampled image, it is created using a single zeImageCreate API call from image and sampler descriptors. NEO sets up both bindless image state and bindless sampler state of an image in a global bindless surface heap (UseExternalAllocatorForSshAndDsh=1). Sampler state is placed after image state and its implicits args state. The offset between sampler state and image state is 128 bytes. * In both of above cases, bindless sampler offset is OR'ed with 1, which sets `Sampler State Base Address Select` to use Bindless Sampler State Base Address.
1 parent 5310374 commit 2f02cb9

File tree

6 files changed

+184
-32
lines changed

6 files changed

+184
-32
lines changed

IGC/Compiler/Optimizer/OCLBIUtils.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Argument* CImagesBI::CImagesUtils::findImageFromBufferPtr(const MetaDataUtils& M
233233
return nullptr;
234234
}
235235

236-
static bool isBindlessImageOrSamplerLoad(Value *v)
236+
static bool isBindlessImageLoad(Value *v)
237237
{
238238
auto *load = dyn_cast<LoadInst>(v);
239239
if (!load)
@@ -254,7 +254,7 @@ ConstantInt* CImagesBI::CImagesUtils::getImageIndex(
254254
{
255255
ConstantInt* imageIndex = nullptr;
256256

257-
imageParam = ValueTracker::track(pCallInst, paramIndex, nullptr, nullptr, isBindlessImageOrSamplerLoad);
257+
imageParam = ValueTracker::track(pCallInst, paramIndex, nullptr, nullptr, isBindlessImageLoad);
258258
IGC_ASSERT(imageParam);
259259
IGC_ASSERT(isa<Argument>(imageParam) || isa<LoadInst>(imageParam));
260260
int i = (*pParamMap)[imageParam].index;
@@ -264,7 +264,7 @@ ConstantInt* CImagesBI::CImagesUtils::getImageIndex(
264264

265265
BufferType CImagesBI::CImagesUtils::getImageType(ParamMap* pParamMap, CallInst* pCallInst, unsigned int paramIndex)
266266
{
267-
Value *imageParam = ValueTracker::track(pCallInst, paramIndex, nullptr, nullptr, isBindlessImageOrSamplerLoad);
267+
Value *imageParam = ValueTracker::track(pCallInst, paramIndex, nullptr, nullptr, isBindlessImageLoad);
268268
IGC_ASSERT(imageParam);
269269
IGC_ASSERT(isa<Argument>(imageParam) || isa<LoadInst>(imageParam));
270270
return isa<LoadInst>(imageParam) ? BufferType::BINDLESS : (*pParamMap)[imageParam].type;
@@ -409,7 +409,21 @@ class COCL_sample : public CImagesBI
409409
Value* getSamplerValue(void)
410410
{
411411
ConstantInt* samplerIndex = nullptr;
412-
Value* samplerParam = ValueTracker::track(m_pCallInst, 1, m_pMdUtils, m_modMD, isBindlessImageOrSamplerLoad);
412+
auto isBindlessSampler = [](Value *v)
413+
{
414+
// Bindless sampler is computed in ResolveSampledImageBuiltins pass.
415+
if (auto *I = dyn_cast<BinaryOperator>(v))
416+
{
417+
if (I->getOpcode() != BinaryOperator::Or || !I->getType()->isIntegerTy(64))
418+
return false;
419+
if (auto *C = dyn_cast<ConstantInt>(I->getOperand(1)))
420+
{
421+
return C->isOne();
422+
}
423+
}
424+
return false;
425+
};
426+
Value* samplerParam = ValueTracker::track(m_pCallInst, 1, m_pMdUtils, m_modMD, isBindlessSampler);
413427
if (!samplerParam) {
414428
emitError("There are instructions that use a sampler, but no sampler found in the kernel!", m_pCallInst);
415429
return nullptr;

IGC/Compiler/Optimizer/OpenCLPasses/ImageFuncs/ResolveSampledImageBuiltins.cpp

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ SPDX-License-Identifier: MIT
88

99
#include "Compiler/Optimizer/OpenCLPasses/ImageFuncs/ResolveSampledImageBuiltins.hpp"
1010
#include "Compiler/IGCPassSupport.h"
11+
#include "common/MDFrameWork.h"
1112
#include "common/LLVMWarningsPush.hpp"
1213
#include <llvm/IR/Function.h>
1314
#include <llvm/IR/Instructions.h>
@@ -24,6 +25,7 @@ using namespace IGC;
2425
#define PASS_CFG_ONLY false
2526
#define PASS_ANALYSIS false
2627
IGC_INITIALIZE_PASS_BEGIN(ResolveSampledImageBuiltins, PASS_FLAG, PASS_DESCRIPTION, PASS_CFG_ONLY, PASS_ANALYSIS)
28+
IGC_INITIALIZE_PASS_DEPENDENCY(MetaDataUtilsWrapper)
2729
IGC_INITIALIZE_PASS_END(ResolveSampledImageBuiltins, PASS_FLAG, PASS_DESCRIPTION, PASS_CFG_ONLY, PASS_ANALYSIS)
2830

2931
char ResolveSampledImageBuiltins::ID = 0;
@@ -38,6 +40,7 @@ ResolveSampledImageBuiltins::ResolveSampledImageBuiltins() : ModulePass(ID)
3840

3941
bool ResolveSampledImageBuiltins::runOnModule(Module& M) {
4042
m_changed = false;
43+
modMD = getAnalysis<MetaDataUtilsWrapper>().getModuleMetaData();
4144
visit(M);
4245

4346
for (auto builtin : m_builtinsToRemove)
@@ -133,6 +136,7 @@ Value* ResolveSampledImageBuiltins::lowerGetSampler(CallInst& CI)
133136
IGC_ASSERT(callReturningOpaque);
134137

135138
m_builtinsToRemove.insert(callReturningOpaque);
139+
auto *Int64Ty = Type::getInt64Ty(CI.getContext());
136140

137141
Value* samplerArg = callReturningOpaque->getArgOperand(1);
138142
if (CallInst* samplerInitializer = dyn_cast<CallInst>(samplerArg))
@@ -141,18 +145,45 @@ Value* ResolveSampledImageBuiltins::lowerGetSampler(CallInst& CI)
141145
return ZExtInst::Create(
142146
Instruction::ZExt,
143147
samplerInitializer->getArgOperand(0),
144-
Type::getInt64Ty(CI.getContext()),
148+
Int64Ty,
145149
"",
146150
&CI);
147151
}
152+
else if (modMD->UseBindlessImage && !isa<Argument>(samplerArg))
153+
{
154+
Value* image = callReturningOpaque->getArgOperand(0);
155+
IGC_ASSERT(image->getType()->isPointerTy());
156+
Value *imageOffset = PtrToIntInst::Create(
157+
Instruction::PtrToInt,
158+
image,
159+
Int64Ty,
160+
"",
161+
&CI);
162+
// When sampled image is created in a single API call, e.g. SYCL bindless image,
163+
// bindless surface state heap layout is
164+
// | image state | image implicit args state | sampler state | redescribed image state | ...
165+
// Sampler state offset is addition of image state offset, size of
166+
// image state and size of image implicit args state.
167+
// Both size of image state and image implicit args state are 64 bytes.
168+
constexpr uint64_t surfaceStateSize = 64;
169+
auto *stateSizeValue = ConstantInt::get(Int64Ty, surfaceStateSize * 2);
170+
auto *samplerOffset = BinaryOperator::CreateAdd(imageOffset, stateSizeValue, "sampler_offset", &CI);
171+
// Set bit-field 0 to 1 to select Bindless Sampler State Base Address.
172+
return BinaryOperator::CreateOr(samplerOffset, ConstantInt::get(Int64Ty, 1), "", &CI);
173+
}
148174
else
149175
{
150176
IGC_ASSERT(samplerArg->getType()->isPointerTy());
151-
return PtrToIntInst::Create(
177+
Value *samplerOffset = PtrToIntInst::Create(
152178
Instruction::PtrToInt,
153179
samplerArg,
154-
Type::getInt64Ty(CI.getContext()),
180+
Int64Ty,
155181
"",
156182
&CI);
183+
if (modMD->UseBindlessImage) {
184+
// Set bit-field 0 to 1 to select Bindless Sampler State Base Address.
185+
samplerOffset = BinaryOperator::CreateOr(samplerOffset, ConstantInt::get(Int64Ty, 1), "", &CI);
186+
}
187+
return samplerOffset;
157188
}
158189
}

IGC/Compiler/Optimizer/OpenCLPasses/ImageFuncs/ResolveSampledImageBuiltins.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ SPDX-License-Identifier: MIT
88

99
#pragma once
1010

11+
#include "Compiler/MetaDataUtilsWrapper.h"
1112
#include "common/LLVMWarningsPush.hpp"
1213
#include <llvm/Pass.h>
1314
#include <llvm/IR/InstVisitor.h>
@@ -34,6 +35,11 @@ namespace IGC
3435
return "ResolveSampledImageBuiltins";
3536
}
3637

38+
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const override
39+
{
40+
AU.addRequired<MetaDataUtilsWrapper>();
41+
}
42+
3743
virtual bool runOnModule(llvm::Module& M) override;
3844
void visitCallInst(llvm::CallInst& CI);
3945

@@ -45,6 +51,7 @@ namespace IGC
4551
llvm::Value* lowerGetSampler(llvm::CallInst& CI);
4652

4753
bool m_changed = false;
54+
ModuleMetaData* modMD = nullptr;
4855
std::unordered_set<llvm::CallInst*> m_builtinsToRemove;
4956
};
5057

IGC/Compiler/tests/OCLBIConverter/sampled_image_handle_2d.ll

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,40 @@
1010

1111
; RUN: igc_opt %s -S -o - -igc-conv-ocl-to-common | FileCheck %s
1212

13-
%"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle" = type { %"struct.sycl::_V1::ext::oneapi::experimental::combined_sampled_image_handle" }
14-
%"struct.sycl::_V1::ext::oneapi::experimental::combined_sampled_image_handle" = type { i64, i64 }
13+
%"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle" = type { i64 }
1514
%spirv.Image._void_1_0_0_0_0_0_0 = type opaque
16-
%spirv.Sampler = type opaque
1715

1816
define spir_kernel void @_ZTS14image_addition(%"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %imgHandle1, %"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %imgHandle2) {
1917
entry:
2018
%0 = bitcast %"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %imgHandle1 to i64*
2119
%__SYCLKernel.1.copyload = load i64, i64* %0, align 8
22-
%1 = bitcast %"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %imgHandle1 to i8*
23-
%__SYCLKernel.imgHandle1.sroa_idx = getelementptr inbounds i8, i8* %1, i64 8
24-
%2 = bitcast i8* %__SYCLKernel.imgHandle1.sroa_idx to i64*
25-
%__SYCLKernel.2.copyload = load i64, i64* %2, align 8
26-
%3 = bitcast %"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %imgHandle2 to i64*
27-
%__SYCLKernel.3.copyload = load i64, i64* %3, align 8
28-
%4 = bitcast %"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %imgHandle2 to i8*
29-
%__SYCLKernel.imgHandle2.sroa_idx = getelementptr inbounds i8, i8* %4, i64 8
30-
%5 = bitcast i8* %__SYCLKernel.imgHandle2.sroa_idx to i64*
31-
%__SYCLKernel.4.copyload = load i64, i64* %5, align 8
20+
%1 = bitcast %"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %imgHandle2 to i64*
21+
%__SYCLKernel.3.copyload = load i64, i64* %1, align 8
3222
%astype = inttoptr i64 %__SYCLKernel.1.copyload to %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*
33-
%astype2 = inttoptr i64 %__SYCLKernel.2.copyload to %spirv.Sampler addrspace(2)*
34-
%6 = ptrtoint %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %astype to i64
35-
%7 = ptrtoint %spirv.Sampler addrspace(2)* %astype2 to i64
36-
%conv = trunc i64 %6 to i32
37-
%conv2 = trunc i64 %7 to i32
23+
%2 = ptrtoint %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %astype to i64
24+
%3 = ptrtoint %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %astype to i64
25+
%conv = trunc i64 %2 to i32
26+
%sampler_offset = add i64 %3, 128
27+
%4 = or i64 %sampler_offset, 1
28+
%conv2 = trunc i64 %4 to i32
3829

30+
; CHECK: [[OR:%.*]] = or i64 %sampler_offset, 1
3931
; CHECK: %bindless_img = inttoptr i64 %__SYCLKernel.1.copyload to float addrspace(393216)*
40-
; CHECK-NEXT: %bindless_sampler = inttoptr i64 %__SYCLKernel.2.copyload to float addrspace(655360)*
32+
; CHECK-NEXT: %bindless_sampler = inttoptr i64 [[OR]] to float addrspace(655360)*
4133
; CHECK-NEXT: %call1 = call <4 x float> @llvm.genx.GenISA.sampleLptr.v4f32.f32.p196608f32.p393216f32.p655360f32(float 0.000000e+00, float %CoordX, float %CoordY, float 0.000000e+00, float 0.000000e+00, float addrspace(196608)* undef, float addrspace(393216)* %bindless_img, float addrspace(655360)* %bindless_sampler, i32 0, i32 0, i32 0)
4234

4335
%call = call spir_func <4 x float> @__builtin_IB_OCL_2d_sample_l(i32 %conv, i32 %conv2, <2 x float> zeroinitializer, float 0.000000e+00)
4436
%astype3 = inttoptr i64 %__SYCLKernel.3.copyload to %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*
45-
%astype4 = inttoptr i64 %__SYCLKernel.4.copyload to %spirv.Sampler addrspace(2)*
46-
%8 = ptrtoint %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %astype3 to i64
47-
%9 = ptrtoint %spirv.Sampler addrspace(2)* %astype4 to i64
48-
%conv3 = trunc i64 %8 to i32
49-
%conv4 = trunc i64 %9 to i32
37+
%5 = ptrtoint %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %astype3 to i64
38+
%6 = ptrtoint %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %astype3 to i64
39+
%conv3 = trunc i64 %5 to i32
40+
%sampler_offset23 = add i64 %6, 128
41+
%7 = or i64 %sampler_offset23, 1
42+
%conv4 = trunc i64 %7 to i32
5043

44+
; CHECK: [[OR2:%.*]] = or i64 %sampler_offset{{.*}}, 1
5145
; CHECK: [[IMG2:%bindless_img[0-9]+]] = inttoptr i64 %__SYCLKernel.3.copyload to float addrspace(393216)*
52-
; CHECK-NEXT: [[SAMPLER2:%bindless_sampler[0-9]+]] = inttoptr i64 %__SYCLKernel.4.copyload to float addrspace(655360)*
46+
; CHECK-NEXT: [[SAMPLER2:%bindless_sampler[0-9]+]] = inttoptr i64 [[OR2]] to float addrspace(655360)*
5347
; CHECK-NEXT: %call26 = call <4 x float> @llvm.genx.GenISA.sampleLptr.v4f32.f32.p196608f32.p393216f32.p655360f32(float 0.000000e+00, float %CoordX2, float %CoordY3, float 0.000000e+00, float 0.000000e+00, float addrspace(196608)* undef, float addrspace(393216)* [[IMG2]], float addrspace(655360)* [[SAMPLER2]], i32 0, i32 0, i32 0)
5448

5549
%call2 = call spir_func <4 x float> @__builtin_IB_OCL_2d_sample_l(i32 %conv3, i32 %conv4, <2 x float> zeroinitializer, float 0.000000e+00)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2024 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
9+
; RUN: igc_opt -igc-image-sampler-resolution %s -S -o - | FileCheck %s
10+
11+
; Check offset of bindless sampler as kernel argument is computed as: ptrtoint(%sampler) | 1
12+
13+
%spirv.Image._void_1_0_0_0_0_0_0 = type opaque
14+
%spirv.Sampler = type opaque
15+
%spirv.SampledImage._void_1_0_0_0_0_0_0 = type opaque
16+
17+
define spir_kernel void @image_read_sampler(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img, %spirv.Sampler addrspace(2)* %sampler) {
18+
entry:
19+
; CHECK: [[INT:%.*]] = ptrtoint %spirv.Sampler addrspace(2)* %sampler to i64
20+
; CHECK-NEXT: [[OR:%.*]] = or i64 [[INT]], 1
21+
; CHECK-NEXT: [[SAMPLER:%.*]] = trunc i64 [[OR]] to i32
22+
; CHECK: call spir_func <4 x float> @__builtin_IB_OCL_2d_sample_l(i32 {{.*}}, i32 [[SAMPLER]], <2 x float>
23+
24+
%TempSampledImage = call spir_func %spirv.SampledImage._void_1_0_0_0_0_0_0 addrspace(1)* @_Z20__spirv_SampledImagePU3AS133__spirv_Image__void_1_0_0_0_0_0_0PU3AS215__spirv_Sampler(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img, %spirv.Sampler addrspace(2)* %sampler)
25+
%0 = bitcast %spirv.SampledImage._void_1_0_0_0_0_0_0 addrspace(1)* %TempSampledImage to i8 addrspace(1)*
26+
%call1 = call spir_func i64 @__builtin_IB_get_sampler(i8 addrspace(1)* %0)
27+
%conv2 = trunc i64 %call1 to i32
28+
%call2 = call spir_func <4 x float> @__builtin_IB_OCL_2d_sample_l(i32 0, i32 %conv2, <2 x float> zeroinitializer, float 0.000000e+00)
29+
ret void
30+
}
31+
32+
declare spir_func %spirv.SampledImage._void_1_0_0_0_0_0_0 addrspace(1)* @_Z20__spirv_SampledImagePU3AS133__spirv_Image__void_1_0_0_0_0_0_0PU3AS215__spirv_Sampler(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*, %spirv.Sampler addrspace(2)*)
33+
34+
declare spir_func i64 @__builtin_IB_get_sampler(i8 addrspace(1)*)
35+
36+
declare spir_func <4 x float> @__builtin_IB_OCL_2d_sample_l(i32, i32, <2 x float>, float)
37+
38+
!IGCMetadata = !{!0}
39+
!igc.functions = !{}
40+
41+
!0 = !{!"ModuleMD", !1, !5}
42+
!1 = !{!"FuncMD", !2, !3}
43+
!2 = !{!"FuncMDMap[0]", void (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*, %spirv.Sampler addrspace(2)*)* @image_read_sampler}
44+
!3 = !{!"FuncMDValue[0]", !4}
45+
!4 = !{!"localOffsets"}
46+
!5 = !{!"UseBindlessImage", i1 true}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
;=========================== begin_copyright_notice ============================
2+
;
3+
; Copyright (C) 2024 Intel Corporation
4+
;
5+
; SPDX-License-Identifier: MIT
6+
;
7+
;============================ end_copyright_notice =============================
8+
9+
; RUN: igc_opt -igc-image-sampler-resolution %s -S -o - | FileCheck %s
10+
11+
; Check SYCL bindless sampler offset is computed from bindless image offset: (BindlessImageOffset + 128) | 1
12+
13+
%"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle" = type { i64 }
14+
%"class.sycl::_V1::id" = type { %"class.sycl::_V1::detail::array" }
15+
%"class.sycl::_V1::detail::array" = type { [1 x i64] }
16+
%spirv.Image._void_0_0_0_0_0_0_0 = type opaque
17+
%spirv.SampledImage._void_0_0_0_0_0_0_0 = type opaque
18+
%spirv.Sampler = type opaque
19+
20+
define spir_kernel void @_ZTS14image_addition(%"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %_arg_imgHandle, float addrspace(1)* %_arg_outAcc, %"class.sycl::_V1::id"* %_arg_outAcc3) {
21+
entry:
22+
; CHECK: [[BC:%.*]] = bitcast %"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %_arg_imgHandle to i64*
23+
; CHECK: [[LOAD:%.*]] = load i64, i64* [[BC]], align 8
24+
; CHECK: [[PTR:%.*]] = inttoptr i64 [[LOAD]] to %spirv.Image._void_0_0_0_0_0_0_0 addrspace(1)*
25+
; CHECK: [[INT1:%.*]] = ptrtoint %spirv.Image._void_0_0_0_0_0_0_0 addrspace(1)* [[PTR]] to i64
26+
; CHECK: [[INT2:%.*]] = ptrtoint %spirv.Image._void_0_0_0_0_0_0_0 addrspace(1)* [[PTR]] to i64
27+
; CHECK-NEXT: [[ADD:%.*]] = add i64 [[INT2]], 128
28+
; CHECK-NEXT: [[OR:%.*]] = or i64 [[ADD]], 1
29+
; CHECK-NEXT: [[IMG:%.*]] = trunc i64 [[INT1]] to i32
30+
; CHECK-NEXT: [[SAMPLER:%.*]] = trunc i64 [[OR]] to i32
31+
; CHECK: call spir_func <4 x float> @__builtin_IB_OCL_1d_sample_l(i32 [[IMG]], i32 [[SAMPLER]], float
32+
33+
%0 = bitcast %"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"* %_arg_imgHandle to i64*
34+
%__SYCLKernel.sroa.0.0.copyload = load i64, i64* %0, align 8
35+
%astype.i = inttoptr i64 %__SYCLKernel.sroa.0.0.copyload to %spirv.Image._void_0_0_0_0_0_0_0 addrspace(1)*
36+
%call3.i.i = call spir_func %spirv.SampledImage._void_0_0_0_0_0_0_0 addrspace(1)* undef(%spirv.Image._void_0_0_0_0_0_0_0 addrspace(1)* %astype.i, %spirv.Sampler addrspace(2)* null)
37+
%1 = bitcast %spirv.SampledImage._void_0_0_0_0_0_0_0 addrspace(1)* %call3.i.i to i8 addrspace(1)*
38+
%call.i.i.i5 = call spir_func i64 @__builtin_IB_get_image(i8 addrspace(1)* %1)
39+
%call1.i.i.i = call spir_func i64 @__builtin_IB_get_sampler(i8 addrspace(1)* %1)
40+
%conv.i.i.i = trunc i64 %call.i.i.i5 to i32
41+
%conv2.i.i.i = trunc i64 %call1.i.i.i to i32
42+
%call7.i.i.i = call spir_func <4 x float> @__builtin_IB_OCL_1d_sample_l(i32 %conv.i.i.i, i32 %conv2.i.i.i, float 0.000000e+00, float 0.000000e+00)
43+
ret void
44+
}
45+
46+
declare spir_func i64 @__builtin_IB_get_image(i8 addrspace(1)*)
47+
48+
declare spir_func i64 @__builtin_IB_get_sampler(i8 addrspace(1)*)
49+
50+
declare spir_func <4 x float> @__builtin_IB_OCL_1d_sample_l(i32, i32, float, float)
51+
52+
!IGCMetadata = !{!0}
53+
!igc.functions = !{}
54+
55+
!0 = !{!"ModuleMD", !1, !5}
56+
!1 = !{!"FuncMD", !2, !3}
57+
!2 = !{!"FuncMDMap[0]", void (%"struct.sycl::_V1::ext::oneapi::experimental::sampled_image_handle"*, float addrspace(1)*, %"class.sycl::_V1::id"*)* @_ZTS14image_addition}
58+
!3 = !{!"FuncMDValue[0]", !4}
59+
!4 = !{!"localOffsets"}
60+
!5 = !{!"UseBindlessImage", i1 true}

0 commit comments

Comments
 (0)