xref: /aosp_15_r20/external/llvm/test/CodeGen/NVPTX/vector-select.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=nvptx -mcpu=sm_20
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=nvptx64 -mcpu=sm_20
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; This test makes sure that vector selects are scalarized by the type legalizer.
5*9880d681SAndroid Build Coastguard Worker; If not, type legalization will fail.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine void @foo(<2 x i32> addrspace(1)* %def_a, <2 x i32> addrspace(1)* %def_b, <2 x i32> addrspace(1)* %def_c) {
8*9880d681SAndroid Build Coastguard Workerentry:
9*9880d681SAndroid Build Coastguard Worker  %tmp4 = load <2 x i32>, <2 x i32> addrspace(1)* %def_a
10*9880d681SAndroid Build Coastguard Worker  %tmp6 = load <2 x i32>, <2 x i32> addrspace(1)* %def_c
11*9880d681SAndroid Build Coastguard Worker  %tmp8 = load <2 x i32>, <2 x i32> addrspace(1)* %def_b
12*9880d681SAndroid Build Coastguard Worker  %0 = icmp sge <2 x i32> %tmp4, zeroinitializer
13*9880d681SAndroid Build Coastguard Worker  %cond = select <2 x i1> %0, <2 x i32> %tmp6, <2 x i32> %tmp8
14*9880d681SAndroid Build Coastguard Worker  store <2 x i32> %cond, <2 x i32> addrspace(1)* %def_c
15*9880d681SAndroid Build Coastguard Worker  ret void
16*9880d681SAndroid Build Coastguard Worker}
17