[llvm] [hlsl][spirv] Add late pass in spirv backend to remove dead resources (PR #225270)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 11:01:25 PDT 2026
rj123-nv wrote:
> This seems similar to SPIRVFinalizeShaderLinkage.cpp can you explain why we could not extend that pass to do this?
It is similar, and that could be done in the same pass, actually I intentionally do it just after that pass.
To eliminate all possible global variables it should be done after all unreachable functions are eliminated, whether that's in a separate pass or in SPIRVFinalizeShaderLinkage.
I opted to do it in a separate pass mostly because of the DXIL precedent with DXILRemoveUnusedResources.
Regardless I guess this should not be run at -O0 so I should probably change that part at least
https://github.com/llvm/llvm-project/pull/225270
More information about the llvm-commits
mailing list