[llvm-branch-commits] [llvm-branch] r232807 - [release_36] Cherry-pick r231219.

Andrea Di Biagio Andrea_DiBiagio at sn.scee.net
Fri Mar 20 05:28:50 PDT 2015


Author: adibiagio
Date: Fri Mar 20 07:28:49 2015
New Revision: 232807

URL: http://llvm.org/viewvc/llvm-project?rev=232807&view=rev
Log:
[release_36] Cherry-pick r231219.

Original message:
[DAGCombine] Fix a bug in a BUILD_VECTOR combine

When trying to convert a BUILD_VECTOR into a shuffle, we try to split a single source vector that is twice as wide as the destination vector. 
We can not do this when we also need the zero vector to create a blend.
This fixes PR22774.

Differential Revision: http://reviews.llvm.org/D8040

Added:
    llvm/branches/release_36/test/CodeGen/X86/pr22774.ll
      - copied, changed from r231219, llvm/trunk/test/CodeGen/X86/pr22774.ll
Modified:
    llvm/branches/release_36/   (props changed)
    llvm/branches/release_36/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Propchange: llvm/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 20 07:28:49 2015
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,226023,226029,226044,226046,226048,226058,226075,226170-226171,226182,226473,226588,226616,226664,226708,226711,226755,226791,226808-226809,227005,227085,227087,227089,227250,227260-227261,227290,227294,227299,227319,227339,227491,227584,227603,227628,227670,227809,227815,227903,227934,227972,227983,228049,228129,228168,228331,228411,228444,228490,228500,228507,228518,228525,228565,228656,228760-228761,228793,228842,228899,228957,228969,228979,229029,229343,229351-229352,229421,229495,229529,229731,229911,230058,231563,231601,232046,232085,232189
+/llvm/trunk:155241,226023,226029,226044,226046,226048,226058,226075,226170-226171,226182,226473,226588,226616,226664,226708,226711,226755,226791,226808-226809,227005,227085,227087,227089,227250,227260-227261,227290,227294,227299,227319,227339,227491,227584,227603,227628,227670,227809,227815,227903,227934,227972,227983,228049,228129,228168,228331,228411,228444,228490,228500,228507,228518,228525,228565,228656,228760-228761,228793,228842,228899,228957,228969,228979,229029,229343,229351-229352,229421,229495,229529,229731,229911,230058,231219,231563,231601,232046,232085,232189

Modified: llvm/branches/release_36/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=232807&r1=232806&r2=232807&view=diff
==============================================================================
--- llvm/branches/release_36/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/branches/release_36/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Mar 20 07:28:49 2015
@@ -11047,7 +11047,9 @@ SDValue DAGCombiner::visitBUILD_VECTOR(S
       } else if (VecInT.getSizeInBits() == VT.getSizeInBits() * 2) {
         // If the input vector is too large, try to split it.
         // We don't support having two input vectors that are too large.
-        if (VecIn2.getNode())
+        // If the zero vector was used, we can not split the vector,
+        // since we'd need 3 inputs.
+        if (UsesZeroVector || VecIn2.getNode())
           return SDValue();
 
         if (!TLI.isExtractSubvectorCheap(VT, VT.getVectorNumElements()))
@@ -11059,7 +11061,6 @@ SDValue DAGCombiner::visitBUILD_VECTOR(S
           DAG.getConstant(VT.getVectorNumElements(), TLI.getVectorIdxTy()));
         VecIn1 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, VT, VecIn1,
           DAG.getConstant(0, TLI.getVectorIdxTy()));
-        UsesZeroVector = false;
       } else
         return SDValue();
     }

Copied: llvm/branches/release_36/test/CodeGen/X86/pr22774.ll (from r231219, llvm/trunk/test/CodeGen/X86/pr22774.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/test/CodeGen/X86/pr22774.ll?p2=llvm/branches/release_36/test/CodeGen/X86/pr22774.ll&p1=llvm/trunk/test/CodeGen/X86/pr22774.ll&r1=231219&r2=232807&rev=232807&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/pr22774.ll (original)
+++ llvm/branches/release_36/test/CodeGen/X86/pr22774.ll Fri Mar 20 07:28:49 2015
@@ -8,10 +8,10 @@ target triple = "x86_64-pc-linux-gnu"
 
 define i32 @_Z3foov() {
 entry:
-; CHECK: vmovdqa in(%rip), %ymm0
+; CHECK: {{vmovdqa|vmovaps}} in(%rip), %ymm0
 ; CHECK-NEXT: vmovq %xmm0, %xmm0
-; CHECK-NEXT: vmovdqa %xmm0, out(%rip)
-  %0 = load <4 x i64>, <4 x i64>* @in, align 32
+; CHECK-NEXT: {{vmovdqa|vmovaps}} %xmm0, out(%rip)
+  %0 = load <4 x i64>* @in, align 32
   %vecext = extractelement <4 x i64> %0, i32 0
   %vecinit = insertelement <2 x i64> undef, i64 %vecext, i32 0
   %vecinit1 = insertelement <2 x i64> %vecinit, i64 0, i32 1





More information about the llvm-branch-commits mailing list