[PATCH] D127488: [GlobalISel][DebugInfo] Remove debug info with zero line from constants inserted at entry block

Vladislav Dzhidzhoev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 24 14:00:42 PDT 2022


dzhidzhoev added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:157
     assert((CurrInst->getDebugLoc() == MI.getDebugLoc() ||
-            MI.getDebugLoc().getLine() == 0) &&
+            (MI.getParent()->isEntryBlock() && !MI.getDebugLoc())) &&
            "Line info was not transferred to all instructions");
----------------
dzhidzhoev wrote:
> arsenm wrote:
> > Should also specifically check for constants?
> It would be nice, but various of machine instructions can be emitted from llvm::ConstantExpr.
> 
> To split instructions originated from constants and non-constant ones in this check, DILocationVerifier should be extended with state variable indicating that we're emitting instructions within translate(Constant, Register) call.
> Since IRTranslator::translate(Constant, Register) call could be recursive, we need to add nesting counter + member functions to increase and decrease it.
> Initially I considered this as an excessive complication of DILocationVerifier, but I can add it if it is needed.
Could you advise how to check for constants in less complicated way? Currently I tend towards that we could accept this assert to be less exact for entry block instructions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127488



More information about the llvm-commits mailing list