This is an archive of the discontinued LLVM Phabricator instance.

Update TrapCode based on Trap Handler ABI.
ClosedPublic

Authored by wdng on Feb 21 2017, 3:26 PM.

Details

Summary

Update TrapCode based on Trap Handler ABI:

HSA debugtrap (arg)s_trap 0x01SGPR0-1: queue_ptr VGPR0: argReserved for HSA debugtrap intrinsic (not implemented).
llvm.traps_trap 0x02SGPR0-1: queue_ptrCauses dispatch to be terminated and its associated queue put into the error state.
llvm.debugtraps_trap 0x03SGPR0-1: queue_ptrIf debugger not installed handled same as llvm.trap.

Diff Detail

Repository
rL LLVM

Event Timeline

wdng created this revision.Feb 21 2017, 3:26 PM
wdng edited the summary of this revision. (Show Details)Feb 21 2017, 3:28 PM
wdng edited the summary of this revision. (Show Details)Feb 21 2017, 3:32 PM
tony-tye requested changes to this revision.Feb 21 2017, 6:37 PM
tony-tye added inline comments.
lib/Target/AMDGPU/AMDGPUSubtarget.h
76–86

Suggest renaming to TrapID which match hardware terminology. Would need updating in other places.

To match the trap handler doc this should be:

enum TrapID {
    TrapIDHardwareReserved = 0,
    TrapIDHSADebugTrap = 1,
    TrapIDLLVMTrap = 2,
    TrapIDLLVMDebugTrap = 3,
    TrapIDDebugBreakpoint = 7,
    TrapIDDebugReserved8 = 8,
    TrapIDDebugReservedFE = 0xfe,
    TrapIDDebugReservedFF = 0xff
  };
lib/Target/AMDGPU/SIInstrInfo.td
633–634

Suggest rename to TRAPID to match hardware terminology.

This revision now requires changes to proceed.Feb 21 2017, 6:37 PM
wdng updated this revision to Diff 89376.Feb 22 2017, 9:59 AM
wdng edited edge metadata.

Address code reviews.

kzhuravl added inline comments.Feb 22 2017, 10:06 AM
lib/Target/AMDGPU/AMDGPUSubtarget.h
76–86

You should also rename remaining TrapCode* to TrapID*.

kzhuravl added inline comments.Feb 22 2017, 10:08 AM
lib/Target/AMDGPU/AMDGPUSubtarget.h
76–77

This should be *TrapIDHardwareReserved*.

wdng updated this revision to Diff 89394.Feb 22 2017, 11:50 AM
wdng marked 2 inline comments as done.

Address code reviews, sorry I missed name changes inside the enum block.

tony-tye accepted this revision.Feb 22 2017, 12:05 PM

LGTM

lib/Target/AMDGPU/AMDGPUSubtarget.h
88–90

Given that the HSADEBUGTRAP is no longer being used, is this enumeration being used now? If not it should be deleted.

This revision is now accepted and ready to land.Feb 22 2017, 12:05 PM
This revision was automatically updated to reflect the committed changes.