-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix GetIdxsForTyFromOffset with private and private like addrspace (#…
…1199) Private addrspace needs to have a zero as first indice. But when SrcTy == DstTy, we are in another scenario coming from pointer cast rework, where the first indice may not be zero. Fix #1196
- Loading branch information
Showing
2 changed files
with
19 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
; RUN: clspv-opt %s -o %t.ll --passes=replace-pointer-bitcast | ||
; RUN: FileCheck %s < %t.ll | ||
|
||
; CHECK: [[alloca:%[^ ]+]] = alloca [196 x i8], align 1 | ||
; CHECK: [[gep:%[^ ]+]] = getelementptr [196 x i8], ptr [[alloca]], i32 0, i32 64 | ||
; CHECK: store i8 %val, ptr [[gep]], align 1 | ||
|
||
define dso_local spir_kernel void @kernel(i8 %val) { | ||
entry: | ||
%alloca = alloca { [8 x i64], [16 x i64], i32 }, align 16 | ||
%gep = getelementptr { [8 x i64], [16 x i64], i32 }, ptr %alloca, i32 0, i32 1, i32 0 | ||
store i8 %val, ptr %gep, align 1 | ||
ret void | ||
} |