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

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


This revision was automatically updated to reflect the committed changes.
Closed by commit rG2c512eaf3789: [SVE] Eliminate calls to default-false VectorType::get() from llvm-stress (authored by ctetreau).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81201

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


Index: llvm/tools/llvm-stress/llvm-stress.cpp
===================================================================
--- llvm/tools/llvm-stress/llvm-stress.cpp
+++ llvm/tools/llvm-stress/llvm-stress.cpp
@@ -300,7 +300,7 @@
 
     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 @@
 
     // 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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81201.269299.patch
Type: text/x-patch
Size: 1012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200608/f1b058d6/attachment.bin>


More information about the llvm-commits mailing list