[llvm] [NVPTX] Fix code generation for `trap-unreachable`. (PR #67478)

Christian Sigg via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 00:58:08 PDT 2023


chsigg wrote:

I moved the implementation to `NVPTXLowerUnreachablePass`, which is better because it also fixes the `no-trap-after-noreturn` case.

I'm wondering though if we should convey to `ptxas` that `trap` exits the CFG by always emitting `ISD::TRAP` as `trap; exit;` (under the assumption that we don't support predicated trap). This would avoid the slightly weird `trap; exit; trap;` for `trap-unreachable` (i.e., `NVPTXLowerUnreachablePass` would only add `exit` iff `unsupported` is dropped later on).

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


More information about the llvm-commits mailing list