[PATCH] D68125: [llvm-exegesis] Add loop mode for repeating the snippet.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 02:30:30 PDT 2019


courbet created this revision.
courbet added a reviewer: gchatelet.
Herald added subscribers: tschuett, mgorny.
Herald added a project: LLVM.

Before this change the Executable function was made by duplicating the
snippet. This change adds a --repetion-mode={loop|duplicate} flag that
allows choosing between this behaviour and wrapping the snippet instructions
in a loop.

The new mode can help measurements when the snippet fits in the DSB by
short-cirtcuiting decoding. The loop adds a dec + jmp to the measurements, but
since these are not part of the critical path, they execute in parallel
with the measured code and do not impact measurements in practice.

Overview of the change:

- New SnippetRepetitor abstraction that handles repeating the snippet. The assembler delegates repeating the instructions to this class.
- ExegesisTarget learns how to decrement loop counter and jump.
- Some refactoring of the assembler into FunctionFiller/BasicBlockFiller.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68125

Files:
  llvm/test/tools/llvm-exegesis/X86/inverse_throughput-by-opcode-name.s
  llvm/test/tools/llvm-exegesis/X86/latency-CMOV32rr.s
  llvm/test/tools/llvm-exegesis/X86/latency-SBB8rr.s
  llvm/test/tools/llvm-exegesis/X86/latency-by-opcode-name.s
  llvm/test/tools/llvm-exegesis/X86/uops-ADD32mi8.s
  llvm/test/tools/llvm-exegesis/X86/uops-ADD32mr.s
  llvm/test/tools/llvm-exegesis/X86/uops-ADD32rm.s
  llvm/test/tools/llvm-exegesis/X86/uops-BEXTR32rm.s
  llvm/test/tools/llvm-exegesis/X86/uops-BSF16rm.s
  llvm/test/tools/llvm-exegesis/X86/uops-BTR64mr.s
  llvm/test/tools/llvm-exegesis/X86/uops-VFMADDSS4rm.s
  llvm/test/tools/llvm-exegesis/X86/uops-XCHG64rr.s
  llvm/test/tools/llvm-exegesis/X86/uops-by-opcode-name.s
  llvm/tools/llvm-exegesis/lib/Assembler.cpp
  llvm/tools/llvm-exegesis/lib/Assembler.h
  llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
  llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
  llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
  llvm/tools/llvm-exegesis/lib/CMakeLists.txt
  llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp
  llvm/tools/llvm-exegesis/lib/SnippetGenerator.h
  llvm/tools/llvm-exegesis/lib/SnippetRepetitor.cpp
  llvm/tools/llvm-exegesis/lib/SnippetRepetitor.h
  llvm/tools/llvm-exegesis/lib/Target.h
  llvm/tools/llvm-exegesis/lib/X86/Target.cpp
  llvm/tools/llvm-exegesis/llvm-exegesis.cpp
  llvm/unittests/tools/llvm-exegesis/Common/AssemblerUtils.h
  llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68125.222107.patch
Type: text/x-patch
Size: 40242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190927/de27634d/attachment-0001.bin>


More information about the llvm-commits mailing list