[llvm] [DirectX] Fix the writing of ConstantExpr GEPs to DXIL bitcode (PR #154446)
Deric C. via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 25 10:29:56 PDT 2025
================
----------------
Icohedron wrote:
This test in particular does not test `removeDeadConstantUsers`, but two existing LLVM DirectX llc tests do exercise it:
```
LLVM :: CodeGen/DirectX/llc-vector-load-scalarize.ll
LLVM :: CodeGen/DirectX/scalar-store.ll
```
These tests fail when `removeDeadConstantUsers` is not used because different passes replace the ConstantExpr GEPs with new ConstantExpr GEPs of difference source element types. The replaced / dead ConstantExpr GEPs linger around and cause the PointerTypeAnalysis to misclassify the the types of the Global Variables used by the ConstantExpr GEPs, and then the DXIL Legalize pass inserts bitcasts which cause the FileCheck test to fail.
https://github.com/llvm/llvm-project/pull/154446
More information about the llvm-commits
mailing list