-
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 detection to run ThreeElementVectorLoweringPass (#1367)
* fix detection to run ThreeElementVectorLoweringPass If a gep ends up trying to access the 4th element of a vec3, we need to lower vec3 to vec4. This is fixing a regression on CTS test_half Ref kpet/clvk#698 * do not consider gep with only 1 indice
- Loading branch information
Showing
5 changed files
with
72 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
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,13 @@ | ||
; RUN: clspv-opt %s -o %t.ll --passes=three-element-vector-lowering | ||
; RUN: FileCheck %s < %t.ll | ||
|
||
; CHECK: getelementptr inbounds <4 x i32>, ptr %a, i32 2, i32 3 | ||
|
||
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" | ||
target triple = "spir-unknown-unknown" | ||
|
||
define dso_local spir_kernel void @test1(ptr %a) { | ||
entry: | ||
%gep = getelementptr inbounds <3 x i32>, ptr %a, i32 2, i32 3 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; RUN: clspv-opt %s -o %t.ll --passes=three-element-vector-lowering | ||
; RUN: FileCheck %s < %t.ll | ||
|
||
; CHECK: getelementptr inbounds <4 x i32>, ptr %a, i32 2, i32 %i | ||
|
||
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" | ||
target triple = "spir-unknown-unknown" | ||
|
||
define dso_local spir_kernel void @test1(ptr %a, i32 %i) { | ||
entry: | ||
%gep = getelementptr inbounds <3 x i32>, ptr %a, i32 2, i32 %i | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; RUN: clspv-opt %s -o %t.ll --passes=three-element-vector-lowering | ||
; RUN: FileCheck %s < %t.ll | ||
|
||
; CHECK: getelementptr inbounds <3 x i32>, ptr %a, i32 2, i32 2 | ||
|
||
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" | ||
target triple = "spir-unknown-unknown" | ||
|
||
define dso_local spir_kernel void @test1(ptr %a) { | ||
entry: | ||
%gep = getelementptr inbounds <3 x i32>, ptr %a, i32 2, i32 2 | ||
ret void | ||
} |