[llvm] 416a6a8 - [SVE] Remove calls to VectorType::getNumElements from AggressiveInstCombine

Christopher Tetreault via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 16:40:52 PDT 2020


Author: Christopher Tetreault
Date: 2020-08-14T16:40:34-07:00
New Revision: 416a6a85b14883149a1eb48c9705dad097704d3b

URL: https://github.com/llvm/llvm-project/commit/416a6a85b14883149a1eb48c9705dad097704d3b
DIFF: https://github.com/llvm/llvm-project/commit/416a6a85b14883149a1eb48c9705dad097704d3b.diff

LOG: [SVE] Remove calls to VectorType::getNumElements from AggressiveInstCombine

Reviewed By: fpetrogalli

Differential Revision: https://reviews.llvm.org/D82218

Added: 
    

Modified: 
    llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp b/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
index 5cd40c66227f..501e01138e9f 100644
--- a/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
+++ b/llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
@@ -291,7 +291,8 @@ static Type *getReducedType(Value *V, Type *Ty) {
   assert(Ty && !Ty->isVectorTy() && "Expect Scalar Type");
   if (auto *VTy = dyn_cast<VectorType>(V->getType())) {
     // FIXME: should this handle scalable vectors?
-    return FixedVectorType::get(Ty, VTy->getNumElements());
+    return FixedVectorType::get(Ty,
+                                cast<FixedVectorType>(VTy)->getNumElements());
   }
   return Ty;
 }


        


More information about the llvm-commits mailing list