[PATCH] D80559: [SVE] Remove getNumElements() warnings in InstCombiner::visitBitCast

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 26 11:58:33 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:2529
 
   if (VectorType *DestVTy = dyn_cast<VectorType>(DestTy)) {
     // Beware: messing with this target-specific oddity may cause trouble.
----------------
Probably should just be `if (auto *DestVTy = dyn_cast<FixedVectorType>(DestTy)) {`.  A bitcast with a scalable vector dest type must have a scalable vector src type, anyway.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:2560
+  if (FixedVectorType *SrcVTy = dyn_cast<FixedVectorType>(SrcTy)) {
     if (SrcVTy->getNumElements() == 1) {
       // If our destination is not a vector, then make this a straight
----------------
We should have a test that we don't do these folds for scalable vectors.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80559





More information about the llvm-commits mailing list