[llvm] 2c512ea - [SVE] Eliminate calls to default-false VectorType::get() from llvm-stress

Christopher Tetreault via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 11:32:53 PDT 2020


Author: Christopher Tetreault
Date: 2020-06-08T11:32:37-07:00
New Revision: 2c512eaf3789d197bce690f4b6c820aa8d74dc39

URL: https://github.com/llvm/llvm-project/commit/2c512eaf3789d197bce690f4b6c820aa8d74dc39
DIFF: https://github.com/llvm/llvm-project/commit/2c512eaf3789d197bce690f4b6c820aa8d74dc39.diff

LOG: [SVE] Eliminate calls to default-false VectorType::get() from llvm-stress

Reviewers: efriedma, kmclaughlin, sdesmalen, MaskRay, JDevlieghere

Reviewed By: sdesmalen

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

Added: 
    

Modified: 
    llvm/tools/llvm-stress/llvm-stress.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-stress/llvm-stress.cpp b/llvm/tools/llvm-stress/llvm-stress.cpp
index 67bc0d2299b4..22f530dde167 100644
--- a/llvm/tools/llvm-stress/llvm-stress.cpp
+++ b/llvm/tools/llvm-stress/llvm-stress.cpp
@@ -300,7 +300,7 @@ struct Modifier {
 
     if (len != (unsigned)-1)
       width = len;
-    return VectorType::get(Ty, width);
+    return FixedVectorType::get(Ty, width);
   }
 
   /// Pick a random scalar type.
@@ -628,9 +628,10 @@ struct SelectModifier: public Modifier {
 
     // If the value type is a vector, and we allow vector select, then in 50%
     // of the cases generate a vector select.
-    if (Val0->getType()->isVectorTy() && (getRandom() % 1)) {
-      unsigned NumElem = cast<VectorType>(Val0->getType())->getNumElements();
-      CondTy = VectorType::get(CondTy, NumElem);
+    if (isa<FixedVectorType>(Val0->getType()) && (getRandom() % 1)) {
+      unsigned NumElem =
+          cast<FixedVectorType>(Val0->getType())->getNumElements();
+      CondTy = FixedVectorType::get(CondTy, NumElem);
     }
 
     Value *Cond = getRandomValue(CondTy);


        


More information about the llvm-commits mailing list