[PATCH] D85257: [X86] Optimize getImpliedDisabledFeatures & getImpliedEnabledFeatures'

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 16:51:34 PDT 2020


nickdesaulniers added a comment.

In D85257#2194921 <https://reviews.llvm.org/D85257#2194921>, @nickdesaulniers wrote:

> Also, I don't think the results of the queries to `getImpliedDisabledFeatures` and `getImpliedEnabledFeatures` is likely to change, though we repeatedly check the same values (at least for this input I'm testing).  Is it worth throwing some `FeatureBitSets` in a map of some sort?

For example, applying:

  diff --git a/llvm/lib/Support/X86TargetParser.cpp b/llvm/lib/Support/X86TargetParser.cpp
  index 572d1203aaf2..ae351b6c4563 100644
  --- a/llvm/lib/Support/X86TargetParser.cpp
  +++ b/llvm/lib/Support/X86TargetParser.cpp
  @@ -572,9 +572,11 @@ static void getImpliedDisabledFeatures(FeatureBitset &Bits, unsigned Value) {
     }
   }
   
  +#include <llvm/Support/raw_ostream.h>
   void llvm::X86::getImpliedFeatures(
       StringRef Feature, bool Enabled,
       SmallVectorImpl<StringRef> &ImpliedFeatures) {
  +  errs() << __func__ << ": " << Feature.str() << " : " << Enabled << "\n";
     auto I = llvm::find_if(
         FeatureInfos, [&](const FeatureInfo &FI) { return FI.Name == Feature; });
     if (I == std::end(FeatureInfos)) {

then building one file in the kernel (manually invoking clang, not `make`) spews enough output to fill my scrollback buffer.  Looks like the same features being enabled/disabled all over again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85257



More information about the llvm-commits mailing list