blob: e616c52f28e66e97d070294879ae29161c8d52d7 [file] [log] [blame]
Sanjay Patel2ee7b932018-03-08 20:42:49 +00001; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
Owen Anderson630077e2015-11-20 08:16:13 +00002; RUN: opt -S -reassociate < %s | FileCheck %s
3
4define void @test1() {
Sanjay Patelb5d2e112017-11-09 22:41:39 +00005; CHECK-LABEL: @test1(
6; CHECK-NEXT: [[T1:%.*]] = tail call <4 x float> @blam()
7; CHECK-NEXT: [[T1_NEG:%.*]] = fsub fast <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[T1]]
Sanjay Patel2ee7b932018-03-08 20:42:49 +00008; CHECK-NEXT: [[T24:%.*]] = fadd fast <4 x float> [[T1_NEG]], undef
Sanjay Patelb5d2e112017-11-09 22:41:39 +00009; 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)
Owen Anderson630077e2015-11-20 08:16:13 +000016 ret void
17}
18
Owen Anderson8e851302015-11-20 22:34:48 +000019define half @test2() {
Sanjay Patelb5d2e112017-11-09 22:41:39 +000020; CHECK-LABEL: @test2(
21; CHECK-NEXT: [[T15:%.*]] = fsub fast half undef, undef
22; CHECK-NEXT: [[T15_NEG:%.*]] = fsub fast half 0xH8000, [[T15]]
Sanjay Patel2ee7b932018-03-08 20:42:49 +000023; CHECK-NEXT: [[T18:%.*]] = fadd fast half [[T15_NEG]], undef
Sanjay Patelb5d2e112017-11-09 22:41:39 +000024; 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
Owen Anderson8e851302015-11-20 22:34:48 +000030}
31
32
33
Owen Anderson630077e2015-11-20 08:16:13 +000034; Function Attrs: optsize
35declare <4 x float> @blam()
36
37; Function Attrs: optsize
38declare void @wombat(<4 x float>)
39