DirectXShaderCompiler/test
David Peixotto 481090a822
[bug] Fix crash when lowering multi-dimension groupshared variable (#5895)
This commit fixes a crash in the compiler when lowering a groupshared
variable with a multi-dimensional array type. The root cause of the bug
was that we had a nested gep expression that could not be merged into a
single gep because of an intervening addrspacecast.

The `MultiDimArrayToOneDimArray` pass flattens the multi-dimension
global variables to a single dimension. It relies on the `MergeGepUse`
function to flatten any nested geps into a single gep that fully
dereferences a scalar element.

The fix is to modify the `MergeGepUse` function to look through
addrspacecast instructions when trying to merge geps. We can now merge
geps like

    gep(addrspacecast(gep(p0, gep_args0)) to p1*, gep_args1)

into

    addrspacecast(gep(p0, gep_args0+gep_args1) to p1*)

We also added a call to `removeDeadConstantUsers` before flattening
multi-dimension globals because we can have some dead constants hanging
around after merging geps and these constants should be ignored by the
flattening pass.
2023-10-23 11:00:36 -07:00
..
Analysis Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
Assembler Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
Bitcode DXC Tests: Filter out unsupported test, add verbose option and improve output (#5537) 2023-08-18 10:56:52 -07:00
CodeGen Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
Feature Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
FileCheck first commit 2016-12-28 11:52:27 -08:00
HLSL/passes [bug] Fix crash when lowering multi-dimension groupshared variable (#5895) 2023-10-23 11:00:36 -07:00
Instrumentation Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
Integer Disable LLVM LIT suites and tests (#4827) 2022-11-29 12:53:22 -06:00
LTO first commit 2016-12-28 11:52:27 -08:00
Linker Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
MC DXC Tests: Filter out unsupported test, add verbose option and improve output (#5537) 2023-08-18 10:56:52 -07:00
Object DXC Tests: Filter out unsupported test, add verbose option and improve output (#5537) 2023-08-18 10:56:52 -07:00
Other DXC Tests: Filter out unsupported test, add verbose option and improve output (#5537) 2023-08-18 10:56:52 -07:00
SymbolRewriter Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
TableGen Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
Transforms Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
Unit first commit 2016-12-28 11:52:27 -08:00
Verifier Update Linux build and test workflows to use lit (#4836) 2022-12-02 12:55:14 -06:00
YAMLParser Fix last LLVM tests on Windows (#4829) 2022-12-02 15:42:58 -06:00
tools Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
.clang-format first commit 2016-12-28 11:52:27 -08:00
CMakeLists.txt Enable building LLVM testing tools (#4023) 2021-10-21 11:31:31 -05:00
Makefile.tests first commit 2016-12-28 11:52:27 -08:00
TestRunner.sh first commit 2016-12-28 11:52:27 -08:00
lit.cfg Enable `.ll` test suffix for LLVM tests (#5887) 2023-10-18 11:55:53 -05:00
lit.site.cfg.in first commit 2016-12-28 11:52:27 -08:00