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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 17:12:37 PDT 2020


craig.topper added inline comments.


================
Comment at: llvm/lib/Support/X86TargetParser.cpp:101-104
+    for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I)
+      if (Bits[I] != RHS.Bits[I])
+        return false;
+    return true;
----------------
MaskRay wrote:
> craig.topper wrote:
> > nickdesaulniers wrote:
> > > MaskRay wrote:
> > > > nickdesaulniers wrote:
> > > > > are these more concise to `return llvm::any_of` here and above?
> > > > llvm::any_of is usually used on one collection. Here we are comparing two collections..
> > > Sure for `operator !=`, but `operator bool` looks like one collection though.
> > Instead of operator bool can we do any() to match std::bitset and the similar class in include/llvm/MC/SubtargetFeature.h
> llvm::any_of can't be used because it is not constexpr: `error: constexpr function never produces a constant expression [-Winvalid-constexpr]`
We don't need constexpr for this usage do we?


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