[PATCH] D144967: [PowerPC] Recognize long CPU name for -mtune in Clang

Nemanja Ivanovic via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 28 07:34:33 PST 2023


nemanjai created this revision.
nemanjai added reviewers: PowerPC, nathanchance, MaskRay.
Herald added subscribers: steven.zhang, shchenz, kbarton.
Herald added a project: All.
nemanjai requested review of this revision.
Herald added a project: clang.

There are two ways of specifying a CPU on PowerPC: `power<N>` and `pwr<N>`. Clang/LLVM traditionally supports the latter and Clang replaces the former with the latter when passing it to the back end for the `-mcpu=` option. However, when the `-mtune=` option was introduced, this replacement was not implemented for it.

This leaves us in an inconsistent state of accepting both forms for `-mcpu=` and and only the latter for `-mtune=`. Furthermore, it leaves us incompatible with GCC which only understands the `power<N>` version for both options.

This patch just adds the same handling for the long names for `-mtune=` as already exists for `-mcpu=`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144967

Files:
  clang/lib/Driver/ToolChains/Arch/PPC.cpp
  clang/lib/Driver/ToolChains/Arch/PPC.h
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/ppc-cpus.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144967.501133.patch
Type: text/x-patch
Size: 6317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230228/7a7b6d81/attachment-0001.bin>


More information about the cfe-commits mailing list