[PATCH] D120864: [AArch64] Avoid scanning feature list for target parsing

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 7 11:04:39 PST 2022


nickdesaulniers added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Arch/AArch64.cpp:407-408
   // TargetParser rewrite.
   const auto ItRNoFullFP16 = std::find(Features.rbegin(), Features.rend(), "-fullfp16");
   const auto ItRFP16FML = std::find(Features.rbegin(), Features.rend(), "+fp16fml");
+  if (V8Version == 4) {
----------------
Another scan of the feature list. Hoist these?


================
Comment at: clang/lib/Driver/ToolChains/Arch/AArch64.cpp:409
   const auto ItRFP16FML = std::find(Features.rbegin(), Features.rend(), "+fp16fml");
-  if (llvm::is_contained(Features, "+v8.4a")) {
+  if (V8Version == 4) {
     const auto ItRFullFP16  = std::find(Features.rbegin(), Features.rend(), "+fullfp16");
----------------
should this check be `>= 4`? Does `"+v8.5"` have fp16 support? Or only `"+v8.4"`?


================
Comment at: clang/lib/Driver/ToolChains/Arch/AArch64.cpp:414-415
       // Only append the +fp16fml if there is no -fp16fml after the +fullfp16.
       if (std::find(Features.rbegin(), ItRFullFP16, "-fp16fml") == ItRFullFP16)
         Features.push_back("+fp16fml");
     }
----------------
another scan of the Features list. Perhaps this instance can be hoisted above to the code you added?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120864



More information about the cfe-commits mailing list