[PATCH] D82755: [AArch64] Add getCFInstrCost, treat branches as free for throughput.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 04:17:18 PDT 2020


fhahn created this revision.
fhahn added reviewers: samparker, dmgreen, anemet.
Herald added subscribers: danielkiss, dexonsmith, hiraditya, kristof.beyls.
Herald added a project: LLVM.

D79164 <https://reviews.llvm.org/D79164>/2596da31740f <https://reviews.llvm.org/rG2596da31740ff753103e5d5e47ab30bae53d3d9d> changed getCFInstrCost to return 1 per default.
AArch64 did not have its own implementation, hence the throughput cost
of CFI instructions is overestimated. On most cores, most branches should
be predicated and essentially free throughput wise.

This restores a 9% performance regression on a SPEC2006 benchmark on
AArch64 with -O3 LTO & PGO.

This patch effectively restores pre 2596da31740f <https://reviews.llvm.org/rG2596da31740ff753103e5d5e47ab30bae53d3d9d> behavior for AArch64
and undoes the AArch64 test changes of the patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82755

Files:
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
  llvm/test/Analysis/CostModel/AArch64/aggregates.ll
  llvm/test/Analysis/CostModel/AArch64/cast.ll
  llvm/test/Analysis/CostModel/AArch64/cmp.ll
  llvm/test/Analysis/CostModel/AArch64/select.ll
  llvm/test/Analysis/CostModel/AArch64/shuffle-broadcast.ll
  llvm/test/Analysis/CostModel/AArch64/store.ll
  llvm/test/Transforms/LoopVectorize/AArch64/aarch64-predication.ll
  llvm/test/Transforms/LoopVectorize/AArch64/extractvalue-no-scalarization-required.ll
  llvm/test/Transforms/LoopVectorize/AArch64/predication_costs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82755.274046.patch
Type: text/x-patch
Size: 22826 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200629/4e14ba12/attachment-0001.bin>


More information about the llvm-commits mailing list