-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to choose programm address space in emitted LLVM IR
SPIRV does not specify storage class for functions, although llvm does. This patch enables choise of address space for function in data layout of emitted LLVM module.
- Loading branch information
1 parent
984ce6e
commit 7c720df
Showing
5 changed files
with
74 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
; RUN: llvm-as %s -o %t.bc | ||
; RUN: llvm-spirv %t.bc -o %t.spv --spirv-ext=+SPV_INTEL_function_pointers | ||
; RUN: llvm-spirv -r %t.spv -o %t.bc --override-program-address-space=3 | ||
; RUN: llvm-dis %t.bc -o %t.ll | ||
; RUN: FileCheck %s --input-file %t.ll | ||
|
||
; ModuleID = 'tmp_back.bc' | ||
; CHECK: target datalayout | ||
; CHECK-SAME: P3 | ||
|
||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024" | ||
target triple = "spir-unknown-unknown" | ||
|
||
; CHECK: @test | ||
; CHECK-SAME: addrspace(3) | ||
; CHECK: %p | ||
; CHECK-SAME: addrspace(3) | ||
|
||
define spir_kernel void @test() { | ||
entry: | ||
%p = alloca void () *, align 8 | ||
store void () * @test, void () ** %p, align 8 | ||
ret void | ||
} | ||
|
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