[all-commits] [llvm/llvm-project] 979ddf: [Support] Handle SPARC in sys::getHostCPUName

rorth via All-commits all-commits at lists.llvm.org
Wed Jul 27 03:22:04 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 979ddfff37d7e3bf258c2e5cbdc272fcb44c15f0
  Author: Rainer Orth <ro at CeBiTec.Uni-Bielefeld.DE>
  Date:   2022-07-27 (Wed, 27 Jul 2022)

  Changed paths:
    M llvm/include/llvm/Support/Host.h
    M llvm/lib/Support/CMakeLists.txt
    M llvm/lib/Support/Host.cpp

  Log Message:
  [Support] Handle SPARC in sys::getHostCPUName

While working on D118450 <https://reviews.llvm.org/D118450>, I noticed that
`sys::getHostCPUName` lacks SPARC support.

This patch implements it.  The code is taken from/inspired by GCC's
`gcc/config/sparc/driver-sparc.cc`.  There's one caveat: since LLVM, unlike
GCC, doesn't support the SPARC-M7, -S7, and -M8 CPUs, I map all those to
the latest supported one (UltraSparc T4/`niagara4`).

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu` by
running `savcov --version` on

- Netra SPARC S7-2 (SPARC-S7, Solaris 11.4)
- SPARC T5-2 (SPARC T5, Solaris 11.4)
- SPARC Enterprise T5220 (UltraSPARC T2, Solaris 11.3)
- SPARC T5 (UltraSPARC T5, Debian sid)
- SPARC T3 (UltraSPARC T3, Debian sid)
- SPARC Enterprise T5220 (Debian sid)

Differential Revision: https://reviews.llvm.org/D130272

More information about the All-commits mailing list