[llvm] [NVPTX] Only run LowerUnreachable when necessary (PR #109868)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 11:07:15 PDT 2024
================
@@ -368,9 +368,13 @@ void NVPTXPassConfig::addIRPasses() {
addPass(createSROAPass());
}
- const auto &Options = getNVPTXTargetMachine().Options;
- addPass(createNVPTXLowerUnreachablePass(Options.TrapUnreachable,
- Options.NoTrapAfterNoreturn));
+ if (ST.hasPTXASUnreachableBug()) {
----------------
Artem-B wrote:
For PTX > 8.3 it's not needed.
For PTX versions older than that, we should assume that it *may* be given to the ptxas with a bug. The problem is that we make the decision on how to generate code at the build time, but we may not know which ptxas will be used until the run time, in general case. We should conservatively assume that we do need to produce `trap; exit;` in that case.
If we eventually find a legitimate use case for such an option, we can add it then. For now, I do not see much point.
https://github.com/llvm/llvm-project/pull/109868
More information about the llvm-commits
mailing list