[PATCH] D30978: [DAGCombine] Bail out if can't create a vector with at least two elements

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 13:00:44 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL297878: [DAGCombine] Bail out if can't create a vector with at least two elements (authored by zvi).

Changed prior to commit:
  https://reviews.llvm.org/D30978?vs=91917&id=91918#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D30978

Files:
  llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/trunk/test/CodeGen/Generic/pr32278.ll


Index: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -14098,8 +14098,11 @@
       if (!SclTy.isFloatingPoint() && !SclTy.isInteger())
         return SDValue();
 
-      EVT NVT = EVT::getVectorVT(*DAG.getContext(), SclTy,
-                                 VT.getSizeInBits() / SclTy.getSizeInBits());
+      unsigned VNTNumElms = VT.getSizeInBits() / SclTy.getSizeInBits();
+      if (VNTNumElms < 2)
+        return SDValue();
+
+      EVT NVT = EVT::getVectorVT(*DAG.getContext(), SclTy, VNTNumElms);
       if (!TLI.isTypeLegal(NVT) || !TLI.isTypeLegal(Scalar.getValueType()))
         return SDValue();
 
Index: llvm/trunk/test/CodeGen/Generic/pr32278.ll
===================================================================
--- llvm/trunk/test/CodeGen/Generic/pr32278.ll
+++ llvm/trunk/test/CodeGen/Generic/pr32278.ll
@@ -1,6 +1,4 @@
 ; PR32278
-; XFAIL: *
-; REQUIRES: asserts
 
 ; RUN: llc < %s
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30978.91918.patch
Type: text/x-patch
Size: 1092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170315/4f812dc1/attachment.bin>


More information about the llvm-commits mailing list