[PATCH] D140478: [RISCV] For Dwarf v5, emit indices into .debug_addr for range list entries

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 12:09:56 PST 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1299
+    return MF->hasRelaxationsEnabled();
+  return TM.getMCSubtargetInfo()->checkFeatures("+relax");
+}
----------------
RamNalamothu wrote:
> craig.topper wrote:
> > This also feels like it should be a virtual function.
> That's what I started with in the previous versions of this revision https://reviews.llvm.org/D140478?vs=on&id=484785#toc but @dblaikie mentioned an interesting point that `-mrelax` is a subtarget feature, which is true at least for RISC-V. Hence I thought having these checks per machine function as in `MachineFunction::hasRelaxationsEnabled` would be right/better. Please see my previous replies to @dblaikie.
> 
> I can introduce a virtual function in `MCSubtargetInfo` but that will defeat the purpose of `MCSubtargetInfo::checkFeatures`.
> 
> And another challenge is we don't have enough context in `DwarfDebug` to know if relaxations are enabled or not. We have to go through `AsmPrinter`.
Even with your changes to `MCSubtargetInfo::checkFeatures` isn't it still printing a message to errs() on targets that aren't RISC-V? A message that isn't actionable by the compiler.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140478/new/

https://reviews.llvm.org/D140478



More information about the llvm-commits mailing list