[PATCH] D97776: [CSSPGO][llvm-profgen] Continue disassembling after illegal instruction is seen.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 09:58:46 PST 2021


hoy added a comment.

In D97776#2597686 <https://reviews.llvm.org/D97776#2597686>, @wenlei wrote:

> I'm wondering if we need a warning when running into such cases. It's possible with data in code for assembly code, but for normal c++ compilation, this could be a red flag that something might be off?
>
> The consequence of such cases for llvm-objdump is less important and also visible in the output, so we don't need warning there. But llvm-profgen could be different - clues like warning may help us detect subtle profile issues.

Sure, a warning makes sense.



================
Comment at: llvm/tools/llvm-profgen/ProfiledBinary.cpp:241
+      else
+        outs() << "\t<unknown>";
       if (ShowSourceLocations) {
----------------
wenlei wrote:
> Does llvm-objdump also prints one `<unknown>` for each byte of illegal instruction, or one `<unknown>` for entire range of illegal instructions?  
llvm-objdump prints `<unknown>` for each bad instruction: https://github.com/llvm/llvm-project/blob/eecbb1c77655d38c06e47cf32e2dcc72da45c517/llvm/tools/llvm-objdump/llvm-objdump.cpp#L1158

objdump prints `<bad`> instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97776



More information about the llvm-commits mailing list