
- Relevant piece is `DXILFlattenArrays.cpp` - Loads and Store Instruction visits are just for finding GetElementPtrConstantExpr and splitting them. - Allocas needed to be replaced with flattened allocas. - Global arrays were similar to allocas. Only interesting piece here is around initializers. - Most of the work went into building correct GEP chains. The approach here was a recursive strategy via `recursivelyCollectGEPs`. - All intermediary GEPs get marked for deletion and only the leaf GEPs get updated with the new index. fixes [89646](https://github.com/llvm/llvm-project/issues/89646)
16 lines
773 B
LLVM
16 lines
773 B
LLVM
; RUN: llc %s -mtriple=dxil-pc-shadermodel6.3-library --filetype=asm -o - | FileCheck %s
|
|
|
|
; Make sure we don't touch arrays without vectors and that can recurse and flatten multiple-dimension arrays of vectors
|
|
|
|
@staticArray = internal global [4 x i32] [i32 1, i32 2, i32 3, i32 4], align 4
|
|
@"groushared3dArrayofVectors" = local_unnamed_addr addrspace(3) global [3 x [3 x [3 x <4 x i32>]]] zeroinitializer, align 16
|
|
|
|
; CHECK @staticArray
|
|
; CHECK-NOT: @staticArray.scalarized
|
|
; CHECK-NOT: @staticArray.scalarized.1dim
|
|
; CHECK-NOT: @staticArray.1dim
|
|
|
|
; CHECK: @groushared3dArrayofVectors.scalarized.1dim = local_unnamed_addr addrspace(3) global [108 x i32] zeroinitializer, align 16
|
|
; CHECK-NOT: @groushared3dArrayofVectors.scalarized
|
|
; CHECK-NOT: @groushared3dArrayofVectors
|