[all-commits] [llvm/llvm-project] 74e0a2: [BOLT] Modify MCPlus annotation internals. NFCI. (...

maksfb via All-commits all-commits at lists.llvm.org
Mon Nov 6 12:14:35 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 74e0a26fd114cac39e251e4c2b6fbbadd6009887
      https://github.com/llvm/llvm-project/commit/74e0a26fd114cac39e251e4c2b6fbbadd6009887
  Author: maksfb <maks at fb.com>
  Date:   2023-11-06 (Mon, 06 Nov 2023)

  Changed paths:
    M bolt/include/bolt/Core/MCPlus.h
    M bolt/include/bolt/Core/MCPlusBuilder.h
    M bolt/lib/Core/BinaryFunction.cpp
    M bolt/lib/Core/MCPlusBuilder.cpp

  Log Message:
  -----------
  [BOLT] Modify MCPlus annotation internals. NFCI. (#70412)

When annotating MCInst instructions, attach extra annotation operands
directly to the annotated instruction, instead of attaching them to an
instruction pointed to by a special kInst operand.

With this change, it's no longer necessary to allocate MCInst and most
of the first-class annotations come with free memory as currently MCInst
is declared with:

    SmallVector<MCOperand, 10> Operands;

i.e. more operands than are normally being used.

We still create a kInst operand with a nullptr instruction value to
designate the beginning of annotation operands. However, this special
operand might not be needed if we can rely on MCInstrDesc::NumOperands.




More information about the All-commits mailing list