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

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 13:10:24 PST 2021


wlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfiledBinary.cpp:228
+                               Offset + PreferredBaseAddress, nulls());
+    if (Size == 0)
+      Size = 1;
----------------
hoy wrote:
> wlei wrote:
> > Nit: how about also use Disassembled as the condition and merge this to the Line274, like:
> > 
> > ```
> > if (Disassembled)
> >   Offset += Size;
> > else
> >   Offset += 1;
> > ```
> `Size` can still be a valid value even the disassembling fails on some targets. For example, on arm64, instruction size is always four byte. When the current disassembling fails, it might skip 4 bytes to the next instruction.
I see, thanks for the clarification.


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