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

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 04:00:32 PST 2024


mmoadeli wrote:

> Can you elaborate on the actual impact the `exit` does have on performance?
> 
> While exit does result in code with more branches on PTX level, SASS looks largely identical with the difference that unreachable code does call exit. https://godbolt.org/z/s8f5nc8cs
> 
> I'm concerned that special-casing unreachable in switch we may make it possible that we re-open a possibility that we'll re-introduce the original issue where we break structured CFG for ptxas if the switch ends up being replicated within more complicated CFG.

This is coming from a DPCPP performance evaluation which showed 3% performance loss in a benchmark after introducing [Lower unreachable to exit to allow ptxas to accurately reconstruct the CFG](https://reviews.llvm.org/D152789). I can share the ir and ptx of the related code before and after commit, if it helps.

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


More information about the llvm-commits mailing list