[llvm] [NVPTX] Fail gracefully when handling unknown intrinsics (PR #191194)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 9 06:55:39 PDT 2026
================
@@ -639,6 +639,13 @@ void NVPTXAsmPrinter::emitDeclarations(const Module &M, raw_ostream &O) {
continue;
if (F.getIntrinsicID())
continue;
+ // If we happen to have an intrinsic previously not lowered, i.e.,
+ // unrecognized intrinsics, we should let the user know that the final
+ // declaration emitted may lead to illegal PTX.
+ if (F.isIntrinsic())
+ report_fatal_error("unknown intrinsic '" + F.getName() +
----------------
antoniofrighetto wrote:
Done, thanks. We still emit the caller using the unhandled intrinsic (which is what I was trying to avoid), but I think it should be fine as long as llc exits non-zero.
https://github.com/llvm/llvm-project/pull/191194
More information about the llvm-commits
mailing list