[llvm] [NVPTX] Only run LowerUnreachable when necessary (PR #109868)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 12:25:04 PDT 2024
duk-37 wrote:
> We could avoid lowering unreachable to exit; trap; starting from the ptxas version that's known to model control flow accurately for just trap instructions, which it didn't when I proposed this change, but was told to me would get fixed in a future version of the compiler. I'm not sure if and how we can guard on that though, as the code generated by NVPTX may be handed to whatever version of back-end compiler out there (e.g. when compiling to PTX and using the driver APIs as opposed to having clang drive the ptxas invocation).
That would be a change in the instruction selection backend though, not disabling this pass altogether.
Alternatively, one could just do what WebAssembly and PS4+PS5 do and force these TargetOptions to be enabled. That would get rid of this pass completely. The question of "should TargetOptions be load-bearing" is a good one, but I feel like that bridge has been crossed already and there are many, many other places in which these things are inaccessible or user-provided command line options are just outright ignored.
https://github.com/llvm/llvm-project/pull/109868
More information about the llvm-commits
mailing list