forked from google/clspv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix runOnImplicitGEP for more than 1 index missing (google#1254)
Since runOnGEPFromGEP has been supported more cases, the if statement removed by this commit is not needed. In fact, removing it fix code as shown in the test here added. Fix google#1225
- Loading branch information
Showing
2 changed files
with
21 additions
and
5 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,18 @@ | ||
; RUN: clspv-opt %s -o %t.ll --passes=simplify-pointer-bitcast,replace-pointer-bitcast | ||
; RUN: FileCheck %s < %t.ll | ||
|
||
; CHECK: [[gep:%[^ ]+]] = getelementptr { %struct.s, %struct.s }, ptr %alloca, i32 0, i32 0, i32 0, i32 1 | ||
; CHECK: load i64, ptr [[gep]], align 8 | ||
|
||
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "spir64-unknown-unknown" | ||
|
||
%struct.s = type { [8 x i64], i32 } | ||
|
||
define spir_kernel void @foo() { | ||
entry: | ||
%alloca = alloca { %struct.s, %struct.s }, align 8 | ||
%gep = getelementptr inbounds [8 x i64], ptr %alloca, i64 0, i64 1 | ||
%load = load i64, ptr %gep, align 8 | ||
ret void | ||
} |