mirror of
				https://github.com/intel/intel-graphics-compiler.git
				synced 2025-10-30 08:18:26 +08:00 
			
		
		
		
	[Autobackout][FunctionalRegression]Revert of change: cee4ac4e9e: Retype TargetExtTy return types of function declarations
				
					
				
			Clang 16 still lowers OpenCL/SPIR-V built-ins as ptr to opaque structs,
    while SPIR-V Reader uses TargetExtTy values. This patch extends the
    retyping function to also retype the return types of function (builtins)
    declarations. Please note that the builtin function resolution is already
    done earlier by SPIR-V Reader.
    This patch also changes how ImageFuncsAnalysis pass recognizes
    image/sampler types. Now, instead of relying on pointer element
    types, the pass uses IGC metadata (m_OpenCLArgType) --
    consistent with other passes later on in the pipeline.
			
			
This commit is contained in:
		@ -495,12 +495,7 @@ uint PayloadMapping::GetNonAdjustedNumPayloadElements_Sample(const SampleIntrins
 | 
			
		||||
    EOPCODE opCode = GetOpCode(inst);
 | 
			
		||||
    llvm::Type* cubeTextureType = GetResourceDimensionType(*inst->getModule(), RESOURCE_DIMENSION_TYPE::DIM_CUBE_TYPE);
 | 
			
		||||
    llvm::Type* cubeArrayTextureType = GetResourceDimensionType(*inst->getModule(), RESOURCE_DIMENSION_TYPE::DIM_CUBE_ARRAY_TYPE);
 | 
			
		||||
    // TODO: Remove the following shader type check once all adapters support
 | 
			
		||||
    // opaque pointers.
 | 
			
		||||
    llvm::Type *textureType =
 | 
			
		||||
        m_CodeGenContext->type == ShaderType::OPENCL_SHADER
 | 
			
		||||
            ? nullptr
 | 
			
		||||
            : inst->getTexturePtrEltTy();
 | 
			
		||||
    llvm::Type* textureType = inst->getTexturePtrEltTy();
 | 
			
		||||
    bool isCube = (textureType == cubeTextureType || textureType == cubeArrayTextureType);
 | 
			
		||||
    ValidateNumberofSources(opCode, isCube, numSources);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -211,18 +211,21 @@ void ImageFuncsAnalysis::visitCallInst(CallInst& CI)
 | 
			
		||||
 | 
			
		||||
    // We only care about image and sampler arguments here, inline samplers
 | 
			
		||||
    // don't require extra kernel parameters.
 | 
			
		||||
    ModuleMetaData *modMD =
 | 
			
		||||
        getAnalysis<MetaDataUtilsWrapper>().getModuleMetaData();
 | 
			
		||||
    Value *callArg = ValueTracker::track(
 | 
			
		||||
        &CI, 0, getAnalysis<MetaDataUtilsWrapper>().getMetaDataUtils(), modMD);
 | 
			
		||||
    Value* callArg = ValueTracker::track(&CI, 0, getAnalysis<MetaDataUtilsWrapper>().getMetaDataUtils(), getAnalysis<MetaDataUtilsWrapper>().getModuleMetaData());
 | 
			
		||||
 | 
			
		||||
    // Return true if v is argument and argument type is %spirv.Sampler.
 | 
			
		||||
    // Return false when sampler track back to a SYCL bindless image argment,
 | 
			
		||||
    // since in this case we don't need implicit args.
 | 
			
		||||
    auto isImageOrSamplerArgument = [modMD](Argument *arg) {
 | 
			
		||||
      FunctionMetaData funcMD = modMD->FuncMD.find(arg->getParent())->second;
 | 
			
		||||
      std::string typeName = funcMD.m_OpenCLArgTypes[arg->getArgNo()];
 | 
			
		||||
      return typeName.rfind("sampler_t", 0) != std::string::npos ||
 | 
			
		||||
             typeName.rfind("image", 0) != std::string::npos;
 | 
			
		||||
    auto isSamplerArgument = [](Argument *arg) {
 | 
			
		||||
        // TODO check v has sampler target extension type when switching to opaque pointer.
 | 
			
		||||
        if (auto *pty = dyn_cast<PointerType>(arg->getType()))
 | 
			
		||||
        {
 | 
			
		||||
            if (auto *sty = dyn_cast<StructType>(IGCLLVM::getNonOpaquePtrEltTy(pty)))
 | 
			
		||||
            {
 | 
			
		||||
                return sty->isOpaque();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return false;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    // TODO: For now assume that we may not trace a sampler/texture for indirect access.
 | 
			
		||||
@ -232,7 +235,7 @@ void ImageFuncsAnalysis::visitCallInst(CallInst& CI)
 | 
			
		||||
    {
 | 
			
		||||
        if (Argument * arg = dyn_cast<Argument>(callArg))
 | 
			
		||||
        {
 | 
			
		||||
            if (isImageOrSamplerArgument(arg))
 | 
			
		||||
            if (isSamplerArgument(arg))
 | 
			
		||||
            {
 | 
			
		||||
                imageFunc->insert(arg->getArgNo());
 | 
			
		||||
                return;
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2022-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2022-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -245,13 +245,3 @@ attributes #2 = { convergent nounwind readnone }
 | 
			
		||||
!54 = !DILocation(line: 9, column: 4, scope: !12)
 | 
			
		||||
!55 = !DILocation(line: 9, column: 11, scope: !12)
 | 
			
		||||
!56 = !DILocation(line: 11, column: 1, scope: !12)
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!57}
 | 
			
		||||
!57 = !{!"ModuleMD", !58}
 | 
			
		||||
!58 = !{!"FuncMD", !59, !60}
 | 
			
		||||
!59 = !{!"FuncMDMap[0]", void (%opencl.image3d_t.read_only addrspace(1)*, i32 addrspace(1)*)* @sample_kernel}
 | 
			
		||||
!60 = !{!"FuncMDValue[0]", !61}
 | 
			
		||||
!61 = !{!"m_OpenCLArgTypes", !62, !63}
 | 
			
		||||
!62 = !{!"m_OpenCLArgTypesVec[0]", !"image3d_t"}
 | 
			
		||||
!63 = !{!"m_OpenCLArgTypesVec[1]", !"int*"}
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -34,11 +34,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
;CHECK: ![[A3]] = !{i32 22, ![[A2:[0-9]+]]}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -34,11 +34,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
;CHECK: ![[A3]] = !{i32 22, ![[A2:[0-9]+]]}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -37,12 +37,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img1, %spirv.Ima
 | 
			
		||||
;CHECK: ![[A3]] = !{i32 22, ![[A4:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A4]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*, %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9, !10}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
!10 = !{!"m_OpenCLArgTypesVec[1]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -37,12 +37,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img1, %spirv.Ima
 | 
			
		||||
;CHECK: ![[A3]] = !{i32 22, ![[A4:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A4]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*, %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9, !10}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
!10 = !{!"m_OpenCLArgTypesVec[1]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -36,12 +36,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img1, %spirv.Ima
 | 
			
		||||
;CHECK: ![[A3]] = !{i32 22, ![[A4:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A4]] = !{!"explicit_arg_num", i32 1}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*, %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9, !10}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
!10 = !{!"m_OpenCLArgTypesVec[1]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -36,12 +36,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img1, %spirv.Ima
 | 
			
		||||
;CHECK: ![[A3]] = !{i32 22, ![[A4:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A4]] = !{!"explicit_arg_num", i32 1}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*, %spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9, !10}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
!10 = !{!"m_OpenCLArgTypesVec[1]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -41,15 +41,4 @@ define i32 @bar(%spirv.Image._void_1_0_1_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 28, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!5}
 | 
			
		||||
!5 = !{!"ModuleMD", !6}
 | 
			
		||||
!6 = !{!"FuncMD", !7, !8, !11, !12}
 | 
			
		||||
!7 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_0_0_1_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!8 = !{!"FuncMDValue[0]", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypes", !10}
 | 
			
		||||
!10 = !{!"m_OpenCLArgTypesVec[0]", !"image1d_t"}
 | 
			
		||||
!11 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_1_0_0_0_0 addrspace(1)*)* @bar}
 | 
			
		||||
!12 = !{!"FuncMDValue[0]", !13}
 | 
			
		||||
!13 = !{!"m_OpenCLArgTypes", !14}
 | 
			
		||||
!14 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -41,15 +41,4 @@ define i32 @bar(%spirv.Image._void_1_0_1_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 28, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!5}
 | 
			
		||||
!5 = !{!"ModuleMD", !6}
 | 
			
		||||
!6 = !{!"FuncMD", !7, !8, !11, !12}
 | 
			
		||||
!7 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_0_0_1_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!8 = !{!"FuncMDValue[0]", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypes", !10}
 | 
			
		||||
!10 = !{!"m_OpenCLArgTypesVec[0]", !"image1d_t"}
 | 
			
		||||
!11 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_1_0_0_0_0 addrspace(1)*)* @bar}
 | 
			
		||||
!12 = !{!"FuncMDValue[0]", !13}
 | 
			
		||||
!13 = !{!"m_OpenCLArgTypes", !14}
 | 
			
		||||
!14 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 26, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 26, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 25, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 25, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_2_1_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 23,  ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_2_1_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image3d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_2_1_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 23,  ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_2_1_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image3d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_2_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 21, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_2_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image3d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_2_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 21, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_2_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image3d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Sampler addrspace(2)* %sampler) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 31, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Sampler addrspace(2)* %sampler) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 31, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2024-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -33,12 +33,3 @@ define i32 @foo(%spirv.Sampler addrspace(2)* %sampler) nounwind {
 | 
			
		||||
;CHECK: !{!"implicit_arg_desc", ![[A1:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 31, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_1_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 24, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_1_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_1_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 24, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_1_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Sampler addrspace(2)* %sampler) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 30, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Sampler addrspace(2)* %sampler) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 30, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2024-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -33,12 +33,3 @@ define i32 @foo(%spirv.Sampler addrspace(2)* %sampler) nounwind {
 | 
			
		||||
;CHECK: !{!"implicit_arg_desc", ![[A1:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 30, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Sampler addrspace(2)* %sampler) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 32, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Sampler addrspace(2)* %sampler) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 32, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2024-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -33,12 +33,3 @@ define i32 @foo(%spirv.Sampler addrspace(2)* %sampler) nounwind {
 | 
			
		||||
;CHECK: !{!"implicit_arg_desc", ![[A1:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 32, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 22, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2017-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2017-2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -30,11 +30,4 @@ define i32 @foo(%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)* %img) nounwind {
 | 
			
		||||
;CHECK: ![[A1]] = !{i32 22, ![[A2:[0-9]+]]}
 | 
			
		||||
;CHECK: ![[A2]] = !{!"explicit_arg_num", i32 0}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!IGCMetadata = !{!4}
 | 
			
		||||
!4 = !{!"ModuleMD", !5}
 | 
			
		||||
!5 = !{!"FuncMD", !6, !7}
 | 
			
		||||
!6 = !{!"FuncMDMap[0]", i32 (%spirv.Image._void_1_0_0_0_0_0_0 addrspace(1)*)* @foo}
 | 
			
		||||
!7 = !{!"FuncMDValue[0]", !8}
 | 
			
		||||
!8 = !{!"m_OpenCLArgTypes", !9}
 | 
			
		||||
!9 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
;=========================== begin_copyright_notice ============================
 | 
			
		||||
;
 | 
			
		||||
; Copyright (C) 2024-2025 Intel Corporation
 | 
			
		||||
; Copyright (C) 2024 Intel Corporation
 | 
			
		||||
;
 | 
			
		||||
; SPDX-License-Identifier: MIT
 | 
			
		||||
;
 | 
			
		||||
@ -84,8 +84,8 @@ attributes #2 = { convergent nounwind readnone willreturn }
 | 
			
		||||
!5 = !{i32 2, i32 0}
 | 
			
		||||
!6 = !{!"ModuleMD", !7}
 | 
			
		||||
!7 = !{!"FuncMD", !8, !9}
 | 
			
		||||
!8 = !{!"FuncMDMap[0]", void (%spirv.Image addrspace(1)*, %spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!9 = !{!"FuncMDValue[0]", !10, !20}
 | 
			
		||||
!8 = !{!"FuncMDMap[71]", void (%spirv.Image addrspace(1)*, %spirv.Sampler addrspace(2)*)* @foo}
 | 
			
		||||
!9 = !{!"FuncMDValue[71]", !10}
 | 
			
		||||
!10 = !{!"resAllocMD", !11}
 | 
			
		||||
!11 = !{!"argAllocMDList", !12, !16}
 | 
			
		||||
!12 = !{!"argAllocMDListVec[1]", !13, !14, !15}
 | 
			
		||||
@ -97,9 +97,4 @@ attributes #2 = { convergent nounwind readnone willreturn }
 | 
			
		||||
!18 = !{!"extensionType", i32 0}
 | 
			
		||||
!19 = !{!"indexType", i32 1}
 | 
			
		||||
 | 
			
		||||
; The following metadata are needed to recognize functions using image/sampler arguments:
 | 
			
		||||
!20 = !{!"m_OpenCLArgTypes", !21, !22}
 | 
			
		||||
!21 = !{!"m_OpenCLArgTypesVec[0]", !"image2d_t"}
 | 
			
		||||
!22 = !{!"m_OpenCLArgTypesVec[1]", !"sampler_t"}
 | 
			
		||||
 | 
			
		||||
; CHECK: ![[A1:[0-9]+]] = !{!"explicit_arg_num", i32 1}
 | 
			
		||||
 | 
			
		||||
@ -19,9 +19,6 @@ SPDX-License-Identifier: MIT
 | 
			
		||||
#include "Compiler/CodeGenPublicEnums.h"
 | 
			
		||||
#include "Probe/Assertion.h"
 | 
			
		||||
 | 
			
		||||
#include <algorithm>
 | 
			
		||||
#include <limits>
 | 
			
		||||
 | 
			
		||||
using namespace llvm;
 | 
			
		||||
 | 
			
		||||
namespace IGC {
 | 
			
		||||
@ -85,25 +82,6 @@ static bool isAnyArgOpenCLTargetExtTy(const llvm::Function &F) {
 | 
			
		||||
  return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool isDeclarationWithOpenCLTargetExtTyRet(const llvm::Function &F) {
 | 
			
		||||
  const Type *RetTy = F.getReturnType();
 | 
			
		||||
  return F.isDeclaration() && isTargetExtTy(RetTy) &&
 | 
			
		||||
         !isNonOpenCLBuiltinType(RetTy);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static unsigned
 | 
			
		||||
getAddressSpaceForTargetExtTy(const llvm::TargetExtType *TargetExtTy) {
 | 
			
		||||
  StringRef TyName = TargetExtTy->getName();
 | 
			
		||||
  if (TyName.startswith("spirv.Queue"))
 | 
			
		||||
    return ADDRESS_SPACE_PRIVATE;
 | 
			
		||||
  else if (TyName.startswith("spirv.Image"))
 | 
			
		||||
    return ADDRESS_SPACE_GLOBAL;
 | 
			
		||||
  else if (TyName.startswith("spirv.Sampler"))
 | 
			
		||||
    return ADDRESS_SPACE_CONSTANT;
 | 
			
		||||
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static Function *
 | 
			
		||||
cloneFunctionWithPtrArgsInsteadTargetExtTy(Function &F, StringRef NameSuffix) {
 | 
			
		||||
  Module &M = *F.getParent();
 | 
			
		||||
@ -114,21 +92,25 @@ cloneFunctionWithPtrArgsInsteadTargetExtTy(Function &F, StringRef NameSuffix) {
 | 
			
		||||
  for (Argument &Arg : F.args()) {
 | 
			
		||||
    Type *T = Arg.getType();
 | 
			
		||||
    if (isTargetExtTy(T) && !isNonOpenCLBuiltinType(T)) {
 | 
			
		||||
      unsigned AS = 0;
 | 
			
		||||
      auto *TargetExtTy = cast<llvm::TargetExtType>(T);
 | 
			
		||||
      T = PointerType::get(C, getAddressSpaceForTargetExtTy(TargetExtTy));
 | 
			
		||||
      StringRef TyName = TargetExtTy->getName();
 | 
			
		||||
 | 
			
		||||
      if (TyName.startswith("spirv.Queue"))
 | 
			
		||||
        AS = ADDRESS_SPACE_PRIVATE;
 | 
			
		||||
      else if (TyName.startswith("spirv.Image"))
 | 
			
		||||
        AS = ADDRESS_SPACE_GLOBAL;
 | 
			
		||||
      else if (TyName.startswith("spirv.Sampler"))
 | 
			
		||||
        AS = ADDRESS_SPACE_CONSTANT;
 | 
			
		||||
 | 
			
		||||
      T = PointerType::get(C, AS);
 | 
			
		||||
    }
 | 
			
		||||
    ParamTys.push_back(T);
 | 
			
		||||
  }
 | 
			
		||||
  FunctionType *NFTy =
 | 
			
		||||
      FunctionType::get(F.getReturnType(), ParamTys, F.isVarArg());
 | 
			
		||||
 | 
			
		||||
  Type *NewRetTy = F.getReturnType();
 | 
			
		||||
  if (F.isDeclaration() && isTargetExtTy(NewRetTy) &&
 | 
			
		||||
      !isNonOpenCLBuiltinType(NewRetTy))
 | 
			
		||||
    NewRetTy = PointerType::get(
 | 
			
		||||
        C, getAddressSpaceForTargetExtTy(cast<llvm::TargetExtType>(NewRetTy)));
 | 
			
		||||
 | 
			
		||||
  FunctionType *NewFTy = FunctionType::get(NewRetTy, ParamTys, F.isVarArg());
 | 
			
		||||
 | 
			
		||||
  Function *NewF = Function::Create(NewFTy, F.getLinkage(), F.getAddressSpace(),
 | 
			
		||||
  Function *NewF = Function::Create(NFTy, F.getLinkage(), F.getAddressSpace(),
 | 
			
		||||
                                    F.getName() + NameSuffix, &M);
 | 
			
		||||
  NewF->copyAttributesFrom(&F);
 | 
			
		||||
 | 
			
		||||
@ -188,9 +170,6 @@ static void replaceFunctionAtCallsites(Function &OldF, Function &NewF) {
 | 
			
		||||
    // NewCall->setTailCallKind(CB->getTailCallKind());
 | 
			
		||||
    NewCall->copyMetadata(*CB);
 | 
			
		||||
 | 
			
		||||
    if (CB->getType() != NewCall->getType())
 | 
			
		||||
      CB->mutateType(NewCall->getType());
 | 
			
		||||
 | 
			
		||||
    CB->replaceAllUsesWith(NewCall);
 | 
			
		||||
    CB->eraseFromParent();
 | 
			
		||||
  }
 | 
			
		||||
@ -201,8 +180,11 @@ void retypeOpenCLTargetExtTyArgs(Module *M) {
 | 
			
		||||
  SmallVector<Function *, 8> RetypedFuncs;
 | 
			
		||||
 | 
			
		||||
  for (Function &F : *M) {
 | 
			
		||||
    if (!isAnyArgOpenCLTargetExtTy(F) &&
 | 
			
		||||
        !isDeclarationWithOpenCLTargetExtTyRet(F))
 | 
			
		||||
    // TODO: Handle declarations separately. Skip here.
 | 
			
		||||
    // if (F.isDeclaration())
 | 
			
		||||
    //   continue;
 | 
			
		||||
 | 
			
		||||
    if (!isAnyArgOpenCLTargetExtTy(F))
 | 
			
		||||
      continue;
 | 
			
		||||
 | 
			
		||||
    if (Function *NewF =
 | 
			
		||||
@ -210,32 +192,6 @@ void retypeOpenCLTargetExtTyArgs(Module *M) {
 | 
			
		||||
      RetypedFuncs.push_back(NewF);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  DenseMap<const Function *, size_t> FirstUseIndex;
 | 
			
		||||
  size_t InstIndex = 0;
 | 
			
		||||
  for (Function &F : *M) {
 | 
			
		||||
    for (BasicBlock &BB : F) {
 | 
			
		||||
      for (Instruction &I : BB) {
 | 
			
		||||
        if (auto *CB = dyn_cast<CallBase>(&I))
 | 
			
		||||
          if (const Function *Callee = CB->getCalledFunction())
 | 
			
		||||
            if (FirstUseIndex.find(Callee) == FirstUseIndex.end())
 | 
			
		||||
              FirstUseIndex[Callee] = InstIndex;
 | 
			
		||||
        ++InstIndex;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  auto idxOf = [&](Function *NewF) {
 | 
			
		||||
    StringRef OrigName = NewF->getName().drop_back(TempSuffix.size());
 | 
			
		||||
    const Function *OldF = M->getFunction(OrigName);
 | 
			
		||||
    auto It = FirstUseIndex.find(OldF);
 | 
			
		||||
    return It == FirstUseIndex.end() ? std::numeric_limits<size_t>::max()
 | 
			
		||||
                                     : It->second;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  std::stable_sort(
 | 
			
		||||
      RetypedFuncs.begin(), RetypedFuncs.end(),
 | 
			
		||||
      [&](Function *A, Function *B) { return idxOf(A) < idxOf(B); });
 | 
			
		||||
 | 
			
		||||
  for (Function *NewF : RetypedFuncs) {
 | 
			
		||||
    StringRef OriginalName = NewF->getName().drop_back(TempSuffix.size());
 | 
			
		||||
    Function *OldF = M->getFunction(OriginalName);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user