[PATCH] D109652: [PowerPC] Restrict various P10 options to P10 only.

Amy Kwan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 11 15:05:55 PDT 2021


amyk created this revision.
amyk added reviewers: PowerPC, nemanjai, stefanp.
amyk added projects: LLVM, PowerPC.
Herald added subscribers: shchenz, kbarton.
amyk requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch attempts to restrict the following P10 <https://reviews.llvm.org/P10> options:

  -mprefixed
  -mpcrel
  -mpaired-vector-memops

To P10 <https://reviews.llvm.org/P10> only. This will prevent the use of these options on P9 <https://reviews.llvm.org/P9> and earlier.

The behaviour of this patch looks like the following on pre-P10:

  $ clang -mcpu=pwr9 -mpaired-vector-memops test.c -o test
  error: option '-mpaired-vector-memops' cannot be specified without '-mcpu=pwr10'
  
  $ clang -mcpu=pwr9 -mprefixed test.c -o test
  error: option '-mprefixed' cannot be specified without '-mcpu=pwr10'
  
  $ clang -mcpu=pwr9 -mprefixed -mpcrel test.c -o test
  error: option '-mpcrel' cannot be specified without '-mprefixed'
  error: option '-mprefixed' cannot be specified without '-mcpu=pwr10'
  
  $ clang -mcpu=pwr9 -mpcrel test.c -o test
  error: option '-mpcrel' cannot be specified without '-mprefixed'


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109652

Files:
  clang/lib/Basic/Targets/PPC.cpp
  clang/test/Driver/ppc-p10-features-support-check.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109652.372097.patch
Type: text/x-patch
Size: 7211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210911/99634759/attachment.bin>


More information about the llvm-commits mailing list