1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -S -reassociate < %s | FileCheck %s
3
4define void @test1() {
5; CHECK-LABEL: @test1(
6; CHECK-NEXT:    [[T1:%.*]] = tail call <4 x float> @blam()
7; CHECK-NEXT:    [[T1_NEG:%.*]] = fneg fast <4 x float> [[T1]]
8; CHECK-NEXT:    [[T24:%.*]] = fadd fast <4 x float> [[T1_NEG]], undef
9; CHECK-NEXT:    tail call void @wombat(<4 x float> [[T24]])
10; CHECK-NEXT:    ret void
11;
12  %t1 = tail call <4 x float> @blam()
13  %t23 = fsub fast <4 x float> undef, %t1
14  %t24 = fadd fast <4 x float> %t23, undef
15  tail call void @wombat(<4 x float> %t24)
16  ret void
17}
18
19define half @test2() {
20; CHECK-LABEL: @test2(
21; CHECK-NEXT:    [[T15:%.*]] = fsub fast half undef, undef
22; CHECK-NEXT:    [[T15_NEG:%.*]] = fneg fast half [[T15]]
23; CHECK-NEXT:    [[T18:%.*]] = fadd fast half [[T15_NEG]], undef
24; CHECK-NEXT:    ret half [[T18]]
25;
26  %t15 = fsub fast half undef, undef
27  %t17 = fsub fast half undef, %t15
28  %t18 = fadd fast half undef, %t17
29  ret half %t18
30}
31
32
33
34; Function Attrs: optsize
35declare <4 x float> @blam()
36
37; Function Attrs: optsize
38declare void @wombat(<4 x float>)
39
40