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

Koakuma via All-commits all-commits at lists.llvm.org
Sun Jan 14 13:29:04 PST 2024


  Branch: refs/heads/users/koachan/main.sparc-prefer-rdpc-over-call-to-implement-getpcx-for-64-bit-target
  Home:   https://github.com/llvm/llvm-project
  Commit: 63f98290d09e1da05fb1217d1b760cbe24b76db9
      https://github.com/llvm/llvm-project/commit/63f98290d09e1da05fb1217d1b760cbe24b76db9
  Author: Koakuma <koachan at protonmail.com>
  Date:   2024-01-14 (Sun, 14 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 (#77196)

On 64-bit target, prefer usng 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.




More information about the All-commits mailing list