[llvm] [NVPTX] Handle unreachable default in llvm::SwitchIns. (PR #72641)

Tim Besard via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 00:37:34 PST 2024


maleadt wrote:

> It may be possible to give compiler an explicit hint which would allow elimination of the unreachable branch.

I'm unfamiliar with LLVM's machine optimization level, but conceptually it does seem like a better/safer approach to try and restore the compiler's ability to remove the unreachable default block in the presence of `exit`, instead of reducing the scope of the `NVPTXLowerUnreachablePass` and risk re-introducing this bug (which seems like a possibility if the unreachable block can't get optimized away, for whatever reason, which could then result in widening of the divergent region again).

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


More information about the llvm-commits mailing list