xref: /aosp_15_r20/external/llvm/test/Bitcode/fcmp-fast.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as < %s | llvm-dis > %t0
2*9880d681SAndroid Build Coastguard Worker; RUN: opt -S < %s > %t1
3*9880d681SAndroid Build Coastguard Worker; RUN: diff %t0 %t1
4*9880d681SAndroid Build Coastguard Worker; RUN: FileCheck < %t1 %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; Make sure flags on fcmp instructions are serialized/deserialized properly.
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Workerdefine i1 @foo(float %a, float %b, double %c, double %d) {
9*9880d681SAndroid Build Coastguard Worker  ; CHECK:   %plain = fcmp ueq float %a, %b
10*9880d681SAndroid Build Coastguard Worker  %plain = fcmp ueq float %a, %b
11*9880d681SAndroid Build Coastguard Worker  ; CHECK:   %fast = fcmp fast olt float %a, %b
12*9880d681SAndroid Build Coastguard Worker  %fast = fcmp fast olt float %a, %b
13*9880d681SAndroid Build Coastguard Worker  ; CHECK:   %nsz = fcmp nsz uge float %a, %b
14*9880d681SAndroid Build Coastguard Worker  %nsz = fcmp nsz uge float %a, %b
15*9880d681SAndroid Build Coastguard Worker  ; CHECK:   %nnan = fcmp nnan nsz oge double %c, %d
16*9880d681SAndroid Build Coastguard Worker  %nnan = fcmp nnan nsz oge double %c, %d
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker  %dce1 = or i1 %plain, %fast
19*9880d681SAndroid Build Coastguard Worker  %dce2 = or i1 %dce1, %nsz
20*9880d681SAndroid Build Coastguard Worker  %dce3 = or i1 %dce2, %nnan
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker  ret i1 %dce3
23*9880d681SAndroid Build Coastguard Worker}
24