diff --git a/lib/Target/PTX/PTXTranslation.cpp b/lib/Target/PTX/PTXTranslation.cpp index 3ae1bac1a..4a51cc9b3 100644 --- a/lib/Target/PTX/PTXTranslation.cpp +++ b/lib/Target/PTX/PTXTranslation.cpp @@ -88,6 +88,7 @@ std::string translateLLVMIRToPTX(llvm::Module &module, int cc, int version) { opt.UnsafeFPMath = false; opt.NoInfsFPMath = false; opt.NoNaNsFPMath = true; + opt.TrapUnreachable = true; std::unique_ptr machine{target->createTargetMachine( module.getTargetTriple(), proc, features, opt, llvm::Reloc::PIC_, std::nullopt, llvm::CodeGenOpt::Aggressive)};