[llvm] Add Dead Block Elimination to NVVMReflect (PR #144171)
Alex Voicu via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 18 11:09:11 PDT 2025
AlexVlx wrote:
> Fascinating. Looks like the `AMDGPUExpandFeaturePredicatesPass` in #134016 is a close relative of NVVMReflect, it just checks LLVM features, instead of hard-coded constants. While it does attempt to resolve some of those feature detections on the AST level, when possible, I think it has the same problem when the code is generated for a generic architecture as SPIR-V, and it will still require some sort of DCE to be applied in order to work reliably.
FWIW, that is somewhat neutered due to opposition to making things too cute. Initially we were also making a best effort attempt to look through direct function calls, and also did some trivial simplification like CSE in order to remove spurious failures which can obtain, especially at O0. It is a non-trivial tradeoff at O0 between retaining information and succeeding at the fold. IMHO, it's the `use everywhere` bit that is really problematic both for `__nvvm_reflect` and for #134016, as they are actually pretty specialist bits of functionality.
https://github.com/llvm/llvm-project/pull/144171
More information about the llvm-commits
mailing list