xref: /aosp_15_r20/external/llvm/test/CodeGen/AMDGPU/icmp-select-sete-reverse-args.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker;Test that a select with reversed True/False values is correctly lowered
4*9880d681SAndroid Build Coastguard Worker;to a SETNE_INT.  There should only be one SETNE_INT instruction.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker;CHECK: SETNE_INT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
7*9880d681SAndroid Build Coastguard Worker;CHECK-NOT: SETNE_INT
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine void @test(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
10*9880d681SAndroid Build Coastguard Workerentry:
11*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32 addrspace(1)* %in
12*9880d681SAndroid Build Coastguard Worker  %arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %in, i32 1
13*9880d681SAndroid Build Coastguard Worker  %1 = load i32, i32 addrspace(1)* %arrayidx1
14*9880d681SAndroid Build Coastguard Worker  %cmp = icmp eq i32 %0, %1
15*9880d681SAndroid Build Coastguard Worker  %value = select i1 %cmp, i32 0, i32 -1
16*9880d681SAndroid Build Coastguard Worker  store i32 %value, i32 addrspace(1)* %out
17*9880d681SAndroid Build Coastguard Worker  ret void
18*9880d681SAndroid Build Coastguard Worker}
19