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