[PATCH] D63286: [GlobalISel][IRTranslator] Don't add debug info to constants emitted into the entry block

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 11:20:04 PDT 2019


dsanders added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:143
+    assert(CurrInst->getDebugLoc() == MI.getDebugLoc() ||
+           MI.getParent() == &MI.getParent()->getParent()->front() &&
+               "Line info was not transferred to all instructions");
----------------
Should we limit this exception to G_CONSTANT and similar? Normal code can potentially be in the entry block too can't it?


================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:1722
+  // debug behaviour.
+  EntryBuilder->setDebugLoc(DebugLoc());
   switch(Inst.getOpcode()) {
----------------
aemerson wrote:
> aprantl wrote:
> > If you are inserting an instruction into the entry block without a DebugLoc and there is no instruction with a DebugLoc before it, it will get added to the function prologue. This may not matter, but I just wanted to make sure that you are aware of that.
> Thanks for the heads up. That seems reasonable to me.
Does having a DebugLoc with line 0 have the same issue?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63286





More information about the llvm-commits mailing list