[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 10:08:31 PST 2021


hoy added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfiledBinary.cpp:241
+      else
+        outs() << "\t<unknown>";
       if (ShowSourceLocations) {
----------------
wenlei wrote:
> hoy wrote:
> > 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.
> what's the length of a bad instruction? one byte? not a big deal, but thought nice to be consistent.
The logic in llvm-objdump is, if the dissembler doesn't tell the length of the bad instruction, moves forward byte-by-byte until a good instruction is seen. This is typically with X86 or variant sized ISA. For Arm, I think it'll skip 2 bytes or 4 bytes which is the length of fixed sized instructions. 


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