- 
                Notifications
    You must be signed in to change notification settings 
- Fork 15k
[DirectX] Scalarize Allocas as part of data scalarization #140165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|  | @@ -8,12 +8,18 @@ | |||||||||||||||||||||||||||
| define internal void @main() #1 { | ||||||||||||||||||||||||||||
| ; CHECK-LABEL: define internal void @main() { | ||||||||||||||||||||||||||||
| ; CHECK-NEXT: [[ENTRY:.*:]] | ||||||||||||||||||||||||||||
| ; CHECK-NEXT: [[DOTI0:%.*]] = load float, ptr getelementptr inbounds ([24 x float], ptr @StaticArr.scalarized.1dim, i32 1), align 16 | ||||||||||||||||||||||||||||
|          | ||||||||||||||||||||||||||||
| define <3 x float> @load_array_vec_test() #0 { | |
| ; CHECK-COUNT-6: load float, ptr addrspace(3) {{(.*@arrayofVecData.scalarized.*|%.*)}}, align 4 | |
| %1 = load <3 x float>, <3 x float> addrspace(3)* getelementptr inbounds ([2 x <3 x float>], [2 x <3 x float>] addrspace(3)* @"arrayofVecData", i32 0, i32 0), align 4 | |
| %2 = load <3 x float>, <3 x float> addrspace(3)* getelementptr inbounds ([2 x <3 x float>], [2 x <3 x float>] addrspace(3)* @"arrayofVecData", i32 0, i32 1), align 4 | |
| %3 = fadd <3 x float> %1, %2 | |
| ret <3 x float> %3 | |
| } | 
llvm-project/llvm/test/CodeGen/DirectX/scalar-load.ll
Lines 53 to 58 in 66a2d4b
| define <4 x i32> @multid_load_test() #0 { | |
| ; CHECK-COUNT-8: load i32, ptr addrspace(3) {{(.*@groushared2dArrayofVectors.scalarized.*|%.*)}}, align 4 | |
| %1 = load <4 x i32>, <4 x i32> addrspace(3)* getelementptr inbounds ([3 x [3 x <4 x i32>]], [3 x [3 x <4 x i32>]] addrspace(3)* @"groushared2dArrayofVectors", i32 0, i32 0, i32 0), align 4 | |
| %2 = load <4 x i32>, <4 x i32> addrspace(3)* getelementptr inbounds ([3 x [3 x <4 x i32>]], [3 x [3 x <4 x i32>]] addrspace(3)* @"groushared2dArrayofVectors", i32 0, i32 1, i32 1), align 4 | |
| %3 = add <4 x i32> %1, %2 | |
| ret <4 x i32> %3 | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ; RUN: opt -S -passes='dxil-data-scalarization' -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefix=SCHECK | ||
| ; RUN: opt -S -passes='dxil-data-scalarization,dxil-flatten-arrays' -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s --check-prefix=FCHECK | ||
|  | ||
| ; CHECK-LABEL: alloca_2d__vec_test | ||
| define void @alloca_2d__vec_test() local_unnamed_addr #2 { | ||
| ; SCHECK: alloca [2 x [4 x i32]], align 16 | ||
| ; FCHECK: alloca [8 x i32], align 16 | ||
| %1 = alloca [2 x <4 x i32>], align 16 | ||
| ret void | ||
| } | 
Uh oh!
There was an error while loading. Please reload this page.