[PATCH] D77259: Clean up usages of asserting vector getters in Type

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 06:57:58 PDT 2020


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:281
   // TODO: Handle bitcast from narrow element type to wide element type.
-  assert(SrcTy->isVectorTy() && "Shuffle of non-vector type?");
-  unsigned DestNumElts = DestTy->getVectorNumElements();
-  unsigned SrcNumElts = SrcTy->getVectorNumElements();
+  assert(SrcTy && "Shuffle of non-vector type?");
+  unsigned DestNumElts = DestTy->getNumElements();
----------------
Now that SrcTy is of type VectorType because of the `cast<>`, this assert can be removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77259





More information about the llvm-commits mailing list