[PATCH] D120111: [AArch64] Default HBC/MOPS features in clang

Son Tuan Vu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 25 07:12:32 PST 2022


tyb0807 added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Arch/AArch64.cpp:269
     success = getAArch64MicroArchFeaturesFromMcpu(
-        D, getAArch64TargetCPU(Args, Triple, A), Args, Features);
+        D, getAArch64TargetCPU(Args, Triple, A), Args, Features, AF);
 
----------------
tmatheson wrote:
> Looks like you could do `AF = Features.back()` below all these if/else conditions (where it is first used) based on the value of `success`. Maybe there is no need to pass it into `getAArch64MicroArchFeaturesFromMcpu` and the other functions?
> 
> Adding an extra output parameter to each of these functions (which duplicates an existing output parameter) seems unnecessary and makes the interfaces more complicated.
we can't do `AF = Features.back()` below all the if/else conditions because `getAArch64MicroArchFeaturesFromM*` adds (usually) the architecture feature first, followed by a bunch of other features,  so when it returns, `Features.back()` is not the architecture feature anymore.

I see your point about complicating the interfaces, maybe @nickdesaulniers can help us here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120111



More information about the cfe-commits mailing list