[all-commits] [llvm/llvm-project] bdc0af: [CodeGen][AArch64] Set min jump table entries to 1...

David Sherwood via All-commits all-commits at lists.llvm.org
Tue Nov 14 05:00:43 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bdc0afc87181d4f7ab8aad2da6fa70a1204f0a84
      https://github.com/llvm/llvm-project/commit/bdc0afc87181d4f7ab8aad2da6fa70a1204f0a84
  Author: David Sherwood <57997763+david-arm at users.noreply.github.com>
  Date:   2023-11-14 (Tue, 14 Nov 2023)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.h
    M llvm/lib/Target/AArch64/AArch64Subtarget.cpp
    M llvm/lib/Target/AArch64/AArch64Subtarget.h
    M llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-switch.ll
    M llvm/test/CodeGen/AArch64/arm64-jumptable.ll
    M llvm/test/CodeGen/AArch64/bti-branch-relaxation.ll
    M llvm/test/CodeGen/AArch64/implicit-def-subreg-to-reg-regression.ll
    M llvm/test/CodeGen/AArch64/jump-table-32.ll
    M llvm/test/CodeGen/AArch64/jump-table-exynos.ll
    M llvm/test/CodeGen/AArch64/jump-table.ll
    M llvm/test/CodeGen/AArch64/max-jump-table.ll
    M llvm/test/CodeGen/AArch64/min-jump-table.ll
    M llvm/test/CodeGen/AArch64/patchable-function-entry-bti.ll
    M llvm/test/CodeGen/AArch64/redundant-mov-from-zero-extend.ll
    M llvm/test/CodeGen/AArch64/switch-unreachable-default.ll
    M llvm/test/CodeGen/AArch64/win64-jumptable.ll
    M llvm/test/CodeGen/AArch64/wineh-bti.ll
    M llvm/test/CodeGen/Generic/machine-function-splitter.ll
    M llvm/test/DebugInfo/COFF/jump-table.ll

  Log Message:
  -----------
  [CodeGen][AArch64] Set min jump table entries to 13 for AArch64 targets (#71166)

There are some workloads that are negatively impacted by using jump
tables when the number of entries is small. The SPEC2017 perlbench
benchmark is one example of this, where increasing the threshold to
around 13 gives a ~1.5% improvement on neoverse-v1. I chose the minimum
threshold based on empirical evidence rather than science, and just
manually increased the threshold until I got the best performance
without impacting other workloads. For neoverse-v1 I saw around ~0.2%
improvement in the SPEC2017 integer geomean, and no overall change for
neoverse-n1. If we find issues with this threshold later on we can
always revisit this.

The most significant SPEC2017 score changes on neoverse-v1 were:

500.perlbench_r: +1.6%
520.omnetpp_r: +0.6%

and the rest saw changes < 0.5%.

I updated CodeGen/AArch64/min-jump-table.ll to reflect the new
threshold. For most of the affected tests I manually set the min number
of entries back to 4 on the RUN line because the tests seem to rely upon
this behaviour.




More information about the All-commits mailing list