[llvm] r282567 - [DAG] Remove isVectorClearMaskLegal() check from vector_build dagcombine

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 23:13:59 PDT 2016


Author: mkuper
Date: Wed Sep 28 01:13:58 2016
New Revision: 282567

URL: http://llvm.org/viewvc/llvm-project?rev=282567&view=rev
Log:
[DAG] Remove isVectorClearMaskLegal() check from vector_build dagcombine

This check currently doesn't seem to do anything useful on any in-tree target:
On non-x86, it always evaluates to false, so we never hit the code path that
creates the shuffle with zero.
On x86, it just forwards to isShuffleMaskLegal(), which is a reasonable thing to
query in general, but doesn't make sense if only restricted to zero blends.

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

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    llvm/trunk/test/CodeGen/AMDGPU/r600-export-fix.ll
    llvm/trunk/test/CodeGen/SystemZ/vec-perm-13.ll

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=282567&r1=282566&r2=282567&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Sep 28 01:13:58 2016
@@ -13064,13 +13064,6 @@ SDValue DAGCombiner::reduceBuildVecToShu
     Mask[i] = Vec2Offset + ExtIndex;
   }
 
-  // Avoid introducing illegal shuffles with zero.
-  // TODO: This doesn't actually do anything smart at the moment.
-  // We should either delete this, or check legality for all the shuffles
-  // we create.
-  if (UsesZeroVector && !TLI.isVectorClearMaskLegal(Mask, VT))
-    return SDValue();
-
   // The type the input vectors may have changed above.
   InVT1 = VecIn1.getValueType();
 

Modified: llvm/trunk/test/CodeGen/AMDGPU/r600-export-fix.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/r600-export-fix.ll?rev=282567&r1=282566&r2=282567&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/r600-export-fix.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/r600-export-fix.ll Wed Sep 28 01:13:58 2016
@@ -3,9 +3,9 @@
 ;CHECK:	EXPORT T{{[0-9]}}.XYZW
 ;CHECK:	EXPORT T{{[0-9]}}.0000
 ;CHECK: EXPORT T{{[0-9]}}.0000
-;CHECK: EXPORT T{{[0-9]}}.0XYZ
+;CHECK: EXPORT T{{[0-9]}}.0YZW
 ;CHECK: EXPORT T{{[0-9]}}.XYZW
-;CHECK: EXPORT T{{[0-9]}}.YZ00
+;CHECK: EXPORT T{{[0-9]}}.XY00
 ;CHECK: EXPORT T{{[0-9]}}.0000
 ;CHECK: EXPORT T{{[0-9]}}.0000
 

Modified: llvm/trunk/test/CodeGen/SystemZ/vec-perm-13.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SystemZ/vec-perm-13.ll?rev=282567&r1=282566&r2=282567&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SystemZ/vec-perm-13.ll (original)
+++ llvm/trunk/test/CodeGen/SystemZ/vec-perm-13.ll Wed Sep 28 01:13:58 2016
@@ -19,8 +19,8 @@ define <4 x i16> @f1(<4 x i16> %x) {
 ; CHECK-VECTOR-NEXT: .space  1                                        
 ; CHECK-VECTOR-NEXT: .byte   6
 ; CHECK-VECTOR-NEXT: .byte   7
-; CHECK-VECTOR-NEXT: .byte   16
-; CHECK-VECTOR-NEXT: .byte   17
+; CHECK-VECTOR-NEXT: .byte   22
+; CHECK-VECTOR-NEXT: .byte   23
 ; CHECK-VECTOR-NEXT: .space  1                                        
 ; CHECK-VECTOR-NEXT: .space  1                                        
 ; CHECK-VECTOR-NEXT: .space  1                                        




More information about the llvm-commits mailing list