[PATCH] D82237: [SVE] Remove calls to VectorType::getNumElements from InstCombine

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 10:32:48 PDT 2020


efriedma added a comment.

LGTM with one minor change.



================
Comment at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:338
     assert(SafeC && "Must have safe constant for binop");
-    unsigned NumElts = InVTy->getNumElements();
+    unsigned NumElts = cast<FixedVectorType>(InVTy)->getNumElements();
     SmallVector<Constant *, 16> Out(NumElts);
----------------
Change the initialization of InVTy?  There's no reason to do the cast<> in two stages.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82237



More information about the llvm-commits mailing list