[PATCH] D79053: [SVE] Fix invalid use of VectorType::getNumElements() in Value Tracking

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 17:18:11 PDT 2020


efriedma added a comment.

We probably should support computeKnownBits with scalable vectors; the functionality mostly just works.  The one part that doesn't is the "DemandedElts", but really it's a minor part, and we can just ignore it for scalable vectors.  (So essentially, drop the new assertion from computeKnownBits, and bail out in the few places in the implementation that actually care.)



================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:211
+  assert(!isa<ScalableVectorType>(Ty) &&
+         "Cannot compute known bits of scalable vector");
+  auto *FVTy = dyn_cast<FixedVectorType>(Ty);
----------------
I'm surprised this assertion doesn't break anything else; computeKnownBits has a lot of callers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79053





More information about the llvm-commits mailing list