[Mlir-commits] [mlir] [MLIR][NVVM] Add trap (PR #120247)

Pradeep Kumar llvmlistbot at llvm.org
Tue Dec 17 16:13:59 PST 2024


================
@@ -2333,6 +2312,41 @@ def NVVM_Breakpoint : NVVM_Op<"breakpoint"> {
   let assemblyFormat = "attr-dict";
 }
 
+def NVVM_Trap : NVVM_Op<"trap"> {
----------------
schwarzschild-radius wrote:

> If you're lowering to llvm.trap then I'm not sure why not have just llvm.trap in MLIR?
+1

> If we want to use LLVM's version, should we also remove nvvm.breakpoint?
That's a good point, I think we can. nvvm.breakpoint was added to model the PTX brkpt instruction. Since it lowers to debugtrap (more like an alias), it is not always to trivial for the user to use llvm.debugtrap Op. Whereas with `trap`, it maps one-to-one with the PTX instruction

I am wondering if we should have a table of mapping from LLVM/NVVM dialect to PTX to help the users

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


More information about the Mlir-commits mailing list