[all-commits] [llvm/llvm-project] f633f3: [BOLT] Fix NOP instruction emission on x86 (#72186)

Maksim Panchenko via All-commits all-commits at lists.llvm.org
Mon Nov 13 18:12:52 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f633f325a1b808d33ca9653ed373353549ddcde6
      https://github.com/llvm/llvm-project/commit/f633f325a1b808d33ca9653ed373353549ddcde6
  Author: Maksim Panchenko <maks at fb.com>
  Date:   2023-11-13 (Mon, 13 Nov 2023)

  Changed paths:
    M bolt/include/bolt/Core/BinaryFunction.h
    M bolt/lib/Core/BinaryEmitter.cpp
    M bolt/lib/Core/BinaryFunction.cpp
    M bolt/lib/Passes/BinaryPasses.cpp
    M bolt/lib/Utils/CommandLineOpts.cpp
    A bolt/test/X86/keep-nops.s

  Log Message:
  -----------
  [BOLT] Fix NOP instruction emission on x86 (#72186)

Use MCAsmBackend::writeNopData() interface to emit NOP instructions on
x86. There are multiple forms of NOP instruction on x86 with different
sizes. Currently, LLVM's assembly/disassembly does not support all forms
correctly which can lead to a breakage of input code semantics, e.g. if
the program relies on NOP instructions for reserving a patch space.

Add "--keep-nops" option to preserve NOP instructions.




More information about the All-commits mailing list