summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-07-09 17:02:45 +0000
committerHal Finkel <hfinkel@anl.gov>2013-07-09 17:02:45 +0000
commitbd6f1f6896275e04ce46c9ef82fd96e2e6c125dd (patch)
tree50d0eb0284aa2922c94c32e88017656e7d9171eb /test/CodeGen
parent7a34599db017a5486cf7cd11eb124984acec8286 (diff)
downloadllvm-bd6f1f6896275e04ce46c9ef82fd96e2e6c125dd.tar.gz
llvm-bd6f1f6896275e04ce46c9ef82fd96e2e6c125dd.tar.bz2
llvm-bd6f1f6896275e04ce46c9ef82fd96e2e6c125dd.tar.xz
DAGCombine tryFoldToZero cannot create illegal types after type legalization
When folding sub x, x (and other similar constructs), where x is a vector, the result is a vector of zeros. After type legalization, make sure that the input zero elements have a legal type. This type may be larger than the result's vector element type. This was another bug found by llvm-stress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185949 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/PowerPC/sub-bv-types.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/sub-bv-types.ll b/test/CodeGen/PowerPC/sub-bv-types.ll
new file mode 100644
index 0000000000..c72fae6a21
--- /dev/null
+++ b/test/CodeGen/PowerPC/sub-bv-types.ll
@@ -0,0 +1,17 @@
+; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 < %s
+target triple = "powerpc64-unknown-linux-gnu"
+
+define void @autogen_SD10521() {
+BB:
+ %Shuff7 = shufflevector <16 x i16> zeroinitializer, <16 x i16> zeroinitializer, <16 x i32> <i32 undef, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16, i32 18, i32 undef, i32 22, i32 undef, i32 26, i32 undef, i32 30>
+ br label %CF
+
+CF: ; preds = %CF78, %CF, %BB
+ %I27 = insertelement <16 x i16> %Shuff7, i16 1360, i32 8
+ %B28 = sub <16 x i16> %I27, %Shuff7
+ br i1 undef, label %CF, label %CF78
+
+CF78: ; preds = %CF
+ %B42 = xor <16 x i16> %B28, %Shuff7
+ br label %CF
+}