[llvm] [DirectX] Flatten arrays (PR #114332)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 12:52:16 PST 2024


================
@@ -1,4 +1,5 @@
-; RUN: opt -S -passes='dxil-data-scalarization,function(scalarizer<load-store>),dxil-op-lower' -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+; RUN: opt -S -passes='dxil-data-scalarization,function(scalarizer<load-store>),dxil-op-lower' -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s -check-prefix DATACHECK
+; RUN: opt -S -passes='dxil-data-scalarization,dxil-flatten-arrays,function(scalarizer<load-store>),dxil-op-lower' -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
----------------
bogner wrote:

So I think what we should do is add a test file for scalarization that checks that it does the right thing for non-flattened arrays. This will only have an `opt` run line.

Then we have two options for the existing scalarization tests that have `llc` run lines:
1. Update them to just have flattened arrays, since that's what we'll actually see in practice
2. Update the `opt` lines to include dxil-flatten-arrays

I think I have a preference for (1) since that makes it much easier to debug if/when the tests fail.

https://github.com/llvm/llvm-project/pull/114332


More information about the llvm-commits mailing list