[PATCH] D46769: [AMDGPU] Change llvm.debugtrap to be a debug breakpoint that can resume execution.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 12:06:19 PDT 2018


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:4003
+      !Subtarget->isTrapHandlerEnabled())
+    return DAG.getNode(AMDGPUISD::ENDPGM, SL, MVT::Other, Chain);
 
----------------
t-tye wrote:
> arsenm wrote:
> > This can't be a terminator instruction. This will produce a terminator in the middle of the block verifier error. I think this is already an issue in some case
> This was behavior was not introduced by this patch as the original code did this. So can address as a separate patch. Can you point me at examples of how lowering should generate code that introduces new control flow?
You can't directly. A new dummy node needs to be introduced, and then create new blocks in AdjustInstrPostInstrSelection. 

If you add a test with the handler disabled and any instruction after, like a store you'll see this doesn't work.


Repository:
  rL LLVM

https://reviews.llvm.org/D46769





More information about the llvm-commits mailing list