xref: /minix3/external/bsd/llvm/dist/llvm/test/CodeGen/X86/vbinop-simplify-bug.ll (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=sse2 -mcpu=corei7 -o /dev/null
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel Sambuc; Revision 199135 introduced a wrong check in method
4*0a6a1f1dSLionel Sambuc; DAGCombiner::SimplifyVBinOp in an attempt to refactor some code
5*0a6a1f1dSLionel Sambuc; using the new method 'BuildVectorSDNode::isConstant' when possible.
6*0a6a1f1dSLionel Sambuc;
7*0a6a1f1dSLionel Sambuc; However the modified code in method SimplifyVBinOp now wrongly
8*0a6a1f1dSLionel Sambuc; checks that the operands of a vector bin-op are both constants.
9*0a6a1f1dSLionel Sambuc;
10*0a6a1f1dSLionel Sambuc; With that wrong change, this test started failing because of a
11*0a6a1f1dSLionel Sambuc; 'fatal error in the backend':
12*0a6a1f1dSLionel Sambuc;   Cannot select: 0x2e329d0: v4i32 = BUILD_VECTOR 0x2e2ea00, 0x2e2ea00, 0x2e2ea00, 0x2e2ea00
13*0a6a1f1dSLionel Sambuc;       0x2e2ea00: i32 = Constant<1> [ID=4]
14*0a6a1f1dSLionel Sambuc;       0x2e2ea00: i32 = Constant<1> [ID=4]
15*0a6a1f1dSLionel Sambuc;       0x2e2ea00: i32 = Constant<1> [ID=4]
16*0a6a1f1dSLionel Sambuc;       0x2e2ea00: i32 = Constant<1> [ID=4]
17*0a6a1f1dSLionel Sambuc
18*0a6a1f1dSLionel Sambucdefine <8 x i32> @reduced_test_case() {
19*0a6a1f1dSLionel Sambuc  %Shuff = shufflevector <8 x i32> zeroinitializer, <8 x i32> zeroinitializer, <8 x i32> <i32 1, i32 3, i32 undef, i32 7, i32 9, i32 11, i32 13, i32 15>
20*0a6a1f1dSLionel Sambuc  %B23 = sub <8 x i32> %Shuff, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
21*0a6a1f1dSLionel Sambuc  ret <8 x i32> %B23
22*0a6a1f1dSLionel Sambuc}
23*0a6a1f1dSLionel Sambuc
24