-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPIR-V] Emit SPIR-V bitcasts between source/expected pointer type
This patch introduces a new spv_ptrcast intrinsic for tracking exptected pointer types. The change fixes multiple OpenCL CTS regressions due the switch to opaque pointers (e.g. basic/hiloeo).
- Loading branch information
1 parent
ec92d74
commit 40d338e
Showing
14 changed files
with
181 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK | ||
|
||
; CHECK-DAG: %[[#Int8Ty:]] = OpTypeInt 8 0 | ||
; CHECK-DAG: %[[#PtrTy:]] = OpTypePointer Function %[[#Int8Ty]] | ||
; CHECK-DAG: %[[#Int64Ty:]] = OpTypeInt 64 0 | ||
; CHECK-DAG: %[[#FTy:]] = OpTypeFunction %[[#Int64Ty]] %[[#PtrTy]] | ||
; CHECK-DAG: %[[#PtrInt8Ty:]] = OpTypePointer Function %[[#Int8Ty]] | ||
; CHECK-DAG: %[[#Int32Ty:]] = OpTypeInt 32 0 | ||
; CHECK-DAG: %[[#PtrInt32Ty:]] = OpTypePointer Function %[[#Int32Ty]] | ||
; CHECK-DAG: %[[#Int64Ty:]] = OpTypeInt 64 0 | ||
; CHECK-DAG: %[[#PtrInt64Ty:]] = OpTypePointer Function %[[#Int64Ty]] | ||
; CHECK-DAG: %[[#FTy:]] = OpTypeFunction %[[#Int64Ty]] %[[#PtrInt8Ty]] | ||
; CHECK-DAG: %[[#Const:]] = OpConstant %[[#Int32Ty]] 0 | ||
; CHECK: OpFunction %[[#Int64Ty]] None %[[#FTy]] | ||
; CHECK: %[[#Parm:]] = OpFunctionParameter %[[#PtrTy]] | ||
; CHECK: OpStore %[[#Parm]] %[[#Const]] Aligned 4 | ||
; CHECK: %[[#Res:]] = OpLoad %[[#Int64Ty]] %[[#Parm]] Aligned 8 | ||
; CHECK: %[[#Parm:]] = OpFunctionParameter %[[#PtrInt8Ty]] | ||
; CHECK-DAG: %[[#Bitcast1:]] = OpBitcast %[[#PtrInt32Ty]] %[[#Parm]] | ||
; CHECK: OpStore %[[#Bitcast1]] %[[#Const]] Aligned 4 | ||
; CHECK-DAG: %[[#Bitcast2:]] = OpBitcast %[[#PtrInt64Ty]] %[[#Parm]] | ||
; CHECK: %[[#Res:]] = OpLoad %[[#Int64Ty]] %[[#Bitcast2]] Aligned 4 | ||
; CHECK: OpReturnValue %[[#Res]] | ||
|
||
define i64 @test(ptr %p) { | ||
store i32 0, ptr %p | ||
%v = load i64, ptr %p | ||
store i32 0, ptr %p, align 4 | ||
%v = load i64, ptr %p, align 4 | ||
ret i64 %v | ||
} |
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.