xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/fast-isel-select.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple x86_64-apple-darwin -O0 -o - < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; Make sure we only use the less significant bit of the value that feeds the
3*9880d681SAndroid Build Coastguard Worker; select. Otherwise, we may account for a non-zero value whereas the
4*9880d681SAndroid Build Coastguard Worker; lsb is zero.
5*9880d681SAndroid Build Coastguard Worker; <rdar://problem/15651765>
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: fastisel_select:
8*9880d681SAndroid Build Coastguard Worker; CHECK: subb {{%[a-z0-9]+}}, [[RES:%[a-z0-9]+]]
9*9880d681SAndroid Build Coastguard Worker; CHECK: testb $1, [[RES]]
10*9880d681SAndroid Build Coastguard Worker; CHECK: cmovnel %edi, %esi
11*9880d681SAndroid Build Coastguard Workerdefine i32 @fastisel_select(i1 %exchSub2211_, i1 %trunc_8766) {
12*9880d681SAndroid Build Coastguard Worker  %shuffleInternal15257_8932 = sub i1 %exchSub2211_, %trunc_8766
13*9880d681SAndroid Build Coastguard Worker  %counter_diff1345 = select i1 %shuffleInternal15257_8932, i32 1204476887, i32 0
14*9880d681SAndroid Build Coastguard Worker  ret i32 %counter_diff1345
15*9880d681SAndroid Build Coastguard Worker}
16*9880d681SAndroid Build Coastguard Worker
17