[PATCH] D144337: Prevent line 0 instructions from dividing a lexical block into ranges

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 13:52:40 PST 2023


dblaikie added a comment.

Does this need a flag? The patch describes doing this for CodeView? Could/should it be done unconditionally for CV?

Though I'll mention that there's a risk of messing up profiles with this - those zero line instructions do have scopes and other things attached to them, if they were of the appropriate scope, even with a zero line, then it wouldn't be fragmenting the scope. So it's because the location isn't attributed to the inline scope that it's causing fragmentation - but that means the instruction doesn't necessarily come from that scope, and so a sample based profile might incorrectly conclude something about reachability if it is instead attributed to this scope... maybe?



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:68
 
+extern cl::opt<DefaultOnOff> UnknownLocations;
+
----------------
We shouldn't introduce declarations of foreign entities into .cpp files like this (there's a risk of the decl/def getting out of date/inconsistent with each other) - there should be some common header to declare this in. Perhaps that means it goes up in LexicalScopes.h?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144337



More information about the llvm-commits mailing list