[PATCH] D20081: [AMDGPU] Only allow register reservation for debugger usage with -g and -O0 + minor renaming

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 13:17:04 PDT 2016


arsenm added inline comments.

================
Comment at: lib/Target/AMDGPU/SIMachineFunctionInfo.cpp:140-143
@@ +139,6 @@
+  if (ST.debuggerReserveRegs()) {
+    if (!MF.getMMI().hasDebugInfo())
+      report_fatal_error("amdgpu-debugger-reserve-regs only allowed with -g");
+    if (TM.getOptLevel() != CodeGenOpt::None)
+      report_fatal_error("amdgpu-debugger-reserve-regs only allowed with -O0");
+
----------------
kzhuravl wrote:
> arsenm wrote:
> > I don't see why this would be an error, particularly a backend error. Talking about -g here doesn't make sense
> We want to restrict additional debugger features (register reservation, nops insertion, etc.) to be only used with debug info present and -O0 opt level.
> 
> I can change the error message to say "only allowed with debug info present". 
> 
> Should we use assert instead? What are your thoughts?
There should be no error. It should proceed and emit the program. There's no reason the registers can't be reserved with optimizations. The nop insertion will be less useful with optimizations, but should still work. Telling the user that they want to disable optimizations with debugging is a frontend question


http://reviews.llvm.org/D20081





More information about the llvm-commits mailing list