xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/pr28444.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; https://llvm.org/bugs/show_bug.cgi?id=28444
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; extract_vector_elt is allowed to have a different result type than
5*9880d681SAndroid Build Coastguard Worker; the vector scalar type.
6*9880d681SAndroid Build Coastguard Worker; This uses both
7*9880d681SAndroid Build Coastguard Worker;  i8 = extract_vector_elt v1i1, Constant:i64<0>
8*9880d681SAndroid Build Coastguard Worker;  i1 = extract_vector_elt v1i1, Constant:i64<0>
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: {{^}}extractelt_mismatch_vector_element_type:
12*9880d681SAndroid Build Coastguard Worker; CHECK: movb $1, %al
13*9880d681SAndroid Build Coastguard Worker; CHECK: movb %al
14*9880d681SAndroid Build Coastguard Worker; CHECK: movb %al
15*9880d681SAndroid Build Coastguard Workerdefine void @extractelt_mismatch_vector_element_type(i32 %arg) {
16*9880d681SAndroid Build Coastguard Workerbb:
17*9880d681SAndroid Build Coastguard Worker  %tmp = icmp ult i32 %arg, 0
18*9880d681SAndroid Build Coastguard Worker  %tmp2 = insertelement <1 x i1> undef, i1 true, i32 0
19*9880d681SAndroid Build Coastguard Worker  %tmp3 = select i1 %tmp, <1 x i1> undef, <1 x i1> %tmp2
20*9880d681SAndroid Build Coastguard Worker  %tmp6 = extractelement <1 x i1> %tmp3, i32 0
21*9880d681SAndroid Build Coastguard Worker  br label %bb1
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerbb1:
24*9880d681SAndroid Build Coastguard Worker  store volatile <1 x i1> %tmp3, <1 x i1>* undef
25*9880d681SAndroid Build Coastguard Worker  store volatile i1 %tmp6, i1* undef
26*9880d681SAndroid Build Coastguard Worker  ret void
27*9880d681SAndroid Build Coastguard Worker}
28