[PATCH] D74688: AMDGPU/GlobalISel: Support llvm.trap and llvm.debugtrap intrinsics
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 17 06:43:24 PST 2020
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:3375-3376
+ return false;
+ Register DstReg(AMDGPU::SGPR0_SGPR1);
+ if (!loadInputValue(DstReg, B, Arg))
+ return false;
----------------
This is directly copying the physical register into another physical register. We don't want that. This needs to go through an intermediate virtual register copy
================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.debugtrap.ll:3-14
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs < %s | FileCheck -check-prefix=ENTRY-LABLE -check-prefix=HSA-DEBUG-TRAP %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -mattr=+trap-handler < %s | FileCheck -check-prefix=ENTRY-LABLE -check-prefix=HSA-DEBUG-TRAP %s
+
+; hsa-path: trap handler disabled
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -mattr=-trap-handler < %s 2>&1 | FileCheck -check-prefix=WARNING -check-prefix=ENTRY-LABLE -check-prefix=NO-HSA-DEBUG-TRAP %s
+
+; non-hsa-path: trap handler enabled
----------------
Shouldn't run the DAG tests in the GlobalIsel test directory
================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.trap.ll:95
+}
+
+attributes #0 = { nounwind noreturn }
----------------
Can you add another test that uses the stack?
Ideally we would also have a test in a non-kernel function, but I know that won't work right now since we don't handle the special argument inputs yet
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74688/new/
https://reviews.llvm.org/D74688
More information about the llvm-commits
mailing list