[PATCH] D20335: [AMDGPU] Emit debugger prologue and emit the rest of the debugger fields in the kernel code header
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Tue May 17 13:42:14 PDT 2016
tstellarAMD added inline comments.
================
Comment at: lib/Target/AMDGPU/SIInstructions.td:1904-1920
@@ -1903,2 +1903,19 @@
+let mayStore = 1, UseNamedOperandTable = 1, Uses = [EXEC] in {
+ // Used for storing work group ID.
+ def SI_DEBUGGER_STORE_WGID: InstSI <
+ (outs),
+ (ins SReg_32:$src, i32imm:$frame_idx, SReg_128:$scratch_rsrc,
+ SReg_32:$scratch_offset),
+ "", []
+ >;
+ // Used for storing work item ID.
+ def SI_DEBUGGER_STORE_WIID: InstSI <
+ (outs),
+ (ins VGPR_32:$src, i32imm:$frame_idx, SReg_128:$scratch_rsrc,
+ SReg_32:$scratch_offset),
+ "", []
+ >;
+} // End let mayStore = 1, UseNamedOperandTable = 1, Uses = [EXEC]
+
// For use in patterns
----------------
Why can't we use the existing spill pseudos for this?
================
Comment at: lib/Target/AMDGPU/SIMachineFunctionInfo.cpp:93-103
@@ -90,13 +92,13 @@
- if (F->hasFnAttribute("amdgpu-work-group-id-y"))
+ if (F->hasFnAttribute("amdgpu-work-group-id-y") || ST.debuggerEmitPrologue())
WorkGroupIDY = true;
- if (F->hasFnAttribute("amdgpu-work-group-id-z"))
+ if (F->hasFnAttribute("amdgpu-work-group-id-z") || ST.debuggerEmitPrologue())
WorkGroupIDZ = true;
- if (F->hasFnAttribute("amdgpu-work-item-id-y"))
+ if (F->hasFnAttribute("amdgpu-work-item-id-y") || ST.debuggerEmitPrologue())
WorkItemIDY = true;
- if (F->hasFnAttribute("amdgpu-work-item-id-z"))
+ if (F->hasFnAttribute("amdgpu-work-item-id-z") || ST.debuggerEmitPrologue())
WorkItemIDZ = true;
----------------
I think it would be better to have AMDGPUAnnotateKernelFeatures check ST.debuggerEmitPrologue() and add the attribute in that pass.
================
Comment at: lib/Target/AMDGPU/SIMachineFunctionInfo.cpp:111
@@ -108,3 +110,3 @@
bool MaySpill = ST.isVGPRSpillingEnabled(*F);
- bool HasStackObjects = FrameInfo->hasStackObjects();
+ bool HasStackObjects = FrameInfo->hasStackObjects() || ST.debuggerEmitPrologue();
----------------
We are creating stack objects during ISel for the debugger prologue, so doesn't that make ST.debuggerEmitPrologue() redundant?
http://reviews.llvm.org/D20335
More information about the llvm-commits
mailing list