[PATCH] D144189: [AIX][CodeGen] Storage Locations for Constant Pointers

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 09:43:20 PST 2023


myhsu added a comment.

In D144189#4134864 <https://reviews.llvm.org/D144189#4134864>, @qiongsiwu1 wrote:

> In D144189#4132940 <https://reviews.llvm.org/D144189#4132940>, @myhsu wrote:
>
>> just wondering if there is any reason you chose not to implement this as a subtarget feature?
>
> Thanks for the comment! No we did not consider that approach. How would this be implemented as a subtarget feature? Could you show me an existing example of what we mean by a "subtarget feature"?

I think `-mpcrel` / `pcrelative-memops` in PPC is a good example. First, you can find `pcrelative-memops`'s subtarget feature definition in llvm/lib/Target/PowerPC/PPC.td, which can be accessed by `PPCSubtargetInfo::HasPCRelativeMemops`. Then, in Clang, you can find `mpcrel` 's definition in clang/include/clang/Driver/Options.td. Such flag is put under the `m_ppc_Features_Group` so it will eventually be marshaled and piped into `PPCTargetInfo::setFeatureEnabled` (and some other PPCTargetInfo methods) in which you can translate it into LLVM `pcrelative-memops` target feature.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144189



More information about the llvm-commits mailing list