xref: /aosp_15_r20/external/llvm/test/Transforms/Reassociate/fp-expr.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt -S -reassociate < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workerdefine void @test1() {
4*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @test1
5*9880d681SAndroid Build Coastguard Worker; CHECK: call
6*9880d681SAndroid Build Coastguard Worker; CHECK: fsub
7*9880d681SAndroid Build Coastguard Worker; CHECK: fadd
8*9880d681SAndroid Build Coastguard Worker  %tmp = tail call <4 x float> @blam()
9*9880d681SAndroid Build Coastguard Worker  %tmp23 = fsub fast <4 x float> undef, %tmp
10*9880d681SAndroid Build Coastguard Worker  %tmp24 = fadd fast <4 x float> %tmp23, undef
11*9880d681SAndroid Build Coastguard Worker  tail call void @wombat(<4 x float> %tmp24)
12*9880d681SAndroid Build Coastguard Worker  ret void
13*9880d681SAndroid Build Coastguard Worker}
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerdefine half @test2() {
16*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @test2
17*9880d681SAndroid Build Coastguard Worker; CHECK: fsub
18*9880d681SAndroid Build Coastguard Worker; CHECK: fsub
19*9880d681SAndroid Build Coastguard Worker; CHECK: fadd
20*9880d681SAndroid Build Coastguard Worker  %tmp15 = fsub fast half undef, undef
21*9880d681SAndroid Build Coastguard Worker  %tmp17 = fsub fast half undef, %tmp15
22*9880d681SAndroid Build Coastguard Worker  %tmp18 = fadd fast half undef, %tmp17
23*9880d681SAndroid Build Coastguard Worker  ret half %tmp18
24*9880d681SAndroid Build Coastguard Worker}
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker; Function Attrs: optsize
29*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @blam()
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Worker; Function Attrs: optsize
32*9880d681SAndroid Build Coastguard Workerdeclare void @wombat(<4 x float>)
33*9880d681SAndroid Build Coastguard Worker
34