[all-commits] [llvm/llvm-project] 22f217: [AArch64] Add PredictableSelectIsExpensive feature...

Aleksandr Popov via All-commits all-commits at lists.llvm.org
Mon Jul 3 03:33:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 22f21738370c15fbdd26006583027f8667e0461d
      https://github.com/llvm/llvm-project/commit/22f21738370c15fbdd26006583027f8667e0461d
  Author: Aleksandr Popov <a.popov.tmb at gmail.com>
  Date:   2023-07-02 (Sun, 02 Jul 2023)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64.td
    A llvm/test/CodeGen/AArch64/convert-highly-predictable-select-to-branch.ll

  Log Message:
  -----------
  [AArch64] Add PredictableSelectIsExpensive feature to all the cpus that have FeatureEnableSelectOptimize

In the revision https://reviews.llvm.org/D138990 was enabled select
optimize pass for AArch64.

We were doing some benchmarking on the Neoverse V1 and were
experimenting with select optimize heuristics. We found out that there
are some additional profitable transformations to predictable branches
(with prediction rate > 75% according to Agner Fog's rule of thumb) can
be done by base heuristic from SelectOptimize pass or by
optimizeSelectInst form CodeGenPrepare pass. But they are blocked on the
Neoverse V1, since PredictableSelectIsExpensive feature is not set for
that subtarget.

Note that to achieve this results we also changed predictable branch
threshold from 99% to 75%

Looks like it makes sense to add this feature to all targets where was
enabled select optimize pass in the https://reviews.llvm.org/D138990.

Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D143162




More information about the All-commits mailing list