[all-commits] [llvm/llvm-project] 118d42: [SPARC] Prefer RDPC over CALL to implement GETPCX ...

Koakuma via All-commits all-commits at lists.llvm.org
Tue Jan 16 07:46:51 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 118d4234ac6d0893974d324cdb738a1e0255c08d
      https://github.com/llvm/llvm-project/commit/118d4234ac6d0893974d324cdb738a1e0255c08d
  Author: Koakuma <koachan at protonmail.com>
  Date:   2024-01-16 (Tue, 16 Jan 2024)

  Changed paths:
    M llvm/lib/Target/Sparc/Sparc.td
    M llvm/lib/Target/Sparc/SparcAsmPrinter.cpp
    A llvm/test/CodeGen/SPARC/getpcx-call.ll
    A llvm/test/CodeGen/SPARC/getpcx-rdpc.ll

  Log Message:
  -----------
  [SPARC] Prefer RDPC over CALL to implement GETPCX for 64-bit target

On 64-bit target, prefer using RDPC over CALL to get the value of %pc.
This is faster on modern processors (Niagara T1 and newer) and avoids
polluting the processor's predictor state.

The old behavior of using a fake CALL is still done when tuning for
classic UltraSPARC processors, since RDPC is much slower there.

A quick pgbench test on a SPARC T4 shows about 2% speedup on SELECT
loads, and about 7% speedup on INSERT/UPDATE loads.

Reviewed By: @s-barannikov

Github PR: https://github.com/llvm/llvm-project/pull/78280




More information about the All-commits mailing list