-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-spirv] Cherry pick Khronos changes to expand collection of entr…
…y point interfaces (PR #1334) (#10623) This PR pulls in the following PR from upstream Khronos SPIRV-LLVM-Translator repo: KhronosGroup/SPIRV-LLVM-Translator#1334 ` This is a patch to expand the collection of entry point interfaces. In SPIR-V 1.4 and later OpEntryPoint must list all global variables in the interface. ` In addition, a couple of minor changes have been added to sync with latest code. This patch addresses #9958 Updated the following tests to sync with upstream as well: llvm-spirv/test/extensions/INTEL/SPV_INTEL_inline_assembly/inline_asm_clobbers.cl llvm-spirv/test/extensions/INTEL/SPV_INTEL_inline_assembly/inline_asm_constraints.cl Thanks --------- Signed-off-by: Arvind Sudarsanam <[email protected]>
- Loading branch information
Showing
15 changed files
with
107 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
; RUN: llvm-as %s -o %t.bc | ||
|
||
; RUN: llvm-spirv %t.bc -o %t.spv | ||
; RUN: spirv-val --target-env spv1.4 %t.spv | ||
; RUN: llvm-spirv -to-text %t.spv -o %t.from.spv.spt | ||
; RUN: FileCheck < %t.from.spv.spt %s --check-prefix=CHECK-SPIRV | ||
|
||
; RUN: llvm-spirv -spirv-text %t.bc -o %t.from.bc.spt | ||
; RUN: FileCheck < %t.from.bc.spt %s --check-prefix=CHECK-SPIRV | ||
|
||
; CHECK-SPIRV: 7 EntryPoint 6 [[#]] "test" [[#Interface1:]] [[#Interface2:]] | ||
; CHECK-SPIRV: TypeInt [[#TypeInt:]] 32 0 | ||
; CHECK-SPIRV: Constant [[#TypeInt]] [[#Constant1:]] 1 | ||
; CHECK-SPIRV: Constant [[#TypeInt]] [[#Constant2:]] 3 | ||
; CHECK-SPIRV: Variable [[#]] [[#Interface1]] 0 [[#Constant1]] | ||
; CHECK-SPIRV: Variable [[#]] [[#Interface2]] 0 [[#Constant2]] | ||
|
||
; ModuleID = 'source.cpp' | ||
source_filename = "source.cpp" | ||
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" | ||
target triple = "spir" | ||
|
||
@var = dso_local addrspace(2) constant i32 1, align 4 | ||
@var2 = dso_local addrspace(2) constant i32 3, align 4 | ||
@var.const = private unnamed_addr addrspace(2) constant i32 1, align 4 | ||
@var2.const = private unnamed_addr addrspace(2) constant i32 3, align 4 | ||
|
||
; Function Attrs: convergent noinline norecurse nounwind optnone | ||
define dso_local spir_kernel void @test() #0 !kernel_arg_addr_space !2 !kernel_arg_access_qual !2 !kernel_arg_type !2 !kernel_arg_base_type !2 !kernel_arg_type_qual !2 !kernel_arg_host_accessible !2 !kernel_arg_pipe_depth !2 !kernel_arg_pipe_io !2 !kernel_arg_buffer_location !2 { | ||
entry: | ||
%0 = load i32, i32 addrspace(2)* @var.const, align 4 | ||
%1 = load i32, i32 addrspace(2)* @var2.const, align 4 | ||
%mul = mul nsw i32 %0, %1 | ||
%mul1 = mul nsw i32 %mul, 2 | ||
ret void | ||
} | ||
|
||
attributes #0 = { convergent noinline norecurse nounwind optnone "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" } | ||
|
||
!opencl.enable.FP_CONTRACT = !{} | ||
!opencl.ocl.version = !{!0} | ||
!opencl.spir.version = !{!0} | ||
!llvm.module.flags = !{!1} | ||
!opencl.used.extensions = !{!2} | ||
!opencl.used.optional.core.features = !{!2} | ||
!opencl.compiler.options = !{!2} | ||
!llvm.ident = !{!3} | ||
|
||
!0 = !{i32 2, i32 0} | ||
!1 = !{i32 7, !"frame-pointer", i32 2} | ||
!2 = !{} | ||
!3 = !{!"Compiler"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.