[PATCH] D130688: [Driver][Sparc] Default to -mcpu=v9 for SparcV8 on Linux

Rainer Orth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 28 10:01:53 PDT 2022


ro added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Arch/Sparc.cpp:139
+  if (Triple.getArch() == llvm::Triple::sparc &&
+      (Triple.isOSSolaris() || Distro(D.getVFS(), Triple).IsDebian()))
     return "v9";
----------------
glaubitz wrote:
> Can we do it "IsLinux()" instead of "IsDebian()"?
> 
> I think Gentoo should profit from this change as well.
No, for the reason I mentioned: there are Linux distributions with SPARC support that **don't support SPARC v9**, like [[ https://www.gaisler.com/index.php/products/operating-systems/linux | LEON Linux ]].  Solaris is easy here because it's v9-only.

LLVM explicitly has extensive LEON support, so we shouldn't break it there!

I don't really known which Linux distributions which are considered supported by current LLVM, have SPARC support at all and require v9 CPUs.  That's for the community to tell.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130688/new/

https://reviews.llvm.org/D130688



More information about the cfe-commits mailing list