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

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 14:04:14 PDT 2020


ctetreau added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:188
   Type *DestTy = Ext.getType();
-  unsigned NumSrcElts = SrcTy->getNumElements();
-  unsigned NumElts = Ext.getVectorOperandType()->getNumElements();
+  ElementCount NumSrcElts = SrcTy->getElementCount();
+  ElementCount NumElts =
----------------
These changes are covered by test Transforms/InstCombine/vscale_extractelement.ll, and isn't really a behavior change since it Min is used in exactly the same way as the numElements was before. The Min is not used for iteration, so this should be safe.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:2290
 
+  // Bail out for scalable vectors
+  if (isa<ScalableVectorType>(LHS->getType()))
----------------
This behavioral change is covered by test Transforms/InstCombine/vscale_extractelement.ll.


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