[all-commits] [llvm/llvm-project] 27f37d: [llvm-exegesis] Use MCJIT only for execution

Pavel Kosov via All-commits all-commits at lists.llvm.org
Fri Jun 16 00:39:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 27f37db76a79e746561ad2545ff6ccf0d50cc38c
      https://github.com/llvm/llvm-project/commit/27f37db76a79e746561ad2545ff6ccf0d50cc38c
  Author: Pavel Kosov <kpdev42 at gmail.com>
  Date:   2023-06-16 (Fri, 16 Jun 2023)

  Changed paths:
    A llvm/test/tools/llvm-exegesis/AArch64/print-assembled-snippet.s
    A llvm/test/tools/llvm-exegesis/Mips/print-assembled-snippet.s
    A llvm/test/tools/llvm-exegesis/PowerPC/print-assembled-snippet.s
    A llvm/test/tools/llvm-exegesis/X86/print-assembled-snippet.s
    M llvm/tools/llvm-exegesis/lib/Assembler.cpp
    M llvm/tools/llvm-exegesis/lib/Assembler.h
    M llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp

  Log Message:
  -----------
  [llvm-exegesis] Use MCJIT only for execution

Initially, llvm-exegesis was generating the benchmark code for the
host CPU to execute it inside its own process. Thus, MCJIT was reused
for fetching function's bytes to fill the assembled_snippet field in
the benchmark report.

Later, the --mtriple and --benchmark-phase command line options were
introduced that are handy for testing snippet generation even if
snippet execution is not possible. In that setup, MCJIT is asked to
parse an object file for a foreign CPU or operating system that is
probably not guaranteed to succeed and was actually observed to fail
in https://reviews.llvm.org/D145763.

This commit implements a much simplified function's code fetching,
assuming the benchmark function is the only function in the object file
and it spans across the entire text section (note that MCJIT-based code
has more or less the same assumption - see TrackingSectionMemoryManager
class).

~~~

Huawei RRI, OS Lab

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D148921




More information about the All-commits mailing list