blob: d0ad55539a3c613726e79e1155c9b056637668f2 [file] [log] [blame]
Owen Anderson630077e2015-11-20 08:16:13 +00001; RUN: opt -S -reassociate < %s | FileCheck %s
2
3define void @test1() {
Sanjay Patelb5d2e112017-11-09 22:41:39 +00004; CHECK-LABEL: @test1(
5; CHECK-NEXT: [[T1:%.*]] = tail call <4 x float> @blam()
6; 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]]
7; CHECK-NEXT: [[T24:%.*]] = fadd fast <4 x float> [[T1_NEG]], fadd (<4 x float> undef, <4 x float> undef)
8; CHECK-NEXT: tail call void @wombat(<4 x float> [[T24]])
9; CHECK-NEXT: ret void
10;
11 %t1 = tail call <4 x float> @blam()
12 %t23 = fsub fast <4 x float> undef, %t1
13 %t24 = fadd fast <4 x float> %t23, undef
14 tail call void @wombat(<4 x float> %t24)
Owen Anderson630077e2015-11-20 08:16:13 +000015 ret void
16}
17
Owen Anderson8e851302015-11-20 22:34:48 +000018define half @test2() {
Sanjay Patelb5d2e112017-11-09 22:41:39 +000019; CHECK-LABEL: @test2(
20; CHECK-NEXT: [[T15:%.*]] = fsub fast half undef, undef
21; CHECK-NEXT: [[T15_NEG:%.*]] = fsub fast half 0xH8000, [[T15]]
22; CHECK-NEXT: [[T18:%.*]] = fadd fast half [[T15_NEG]], fadd (half undef, half undef)
23; CHECK-NEXT: ret half [[T18]]
24;
25 %t15 = fsub fast half undef, undef
26 %t17 = fsub fast half undef, %t15
27 %t18 = fadd fast half undef, %t17
28 ret half %t18
Owen Anderson8e851302015-11-20 22:34:48 +000029}
30
31
32
Owen Anderson630077e2015-11-20 08:16:13 +000033; Function Attrs: optsize
34declare <4 x float> @blam()
35
36; Function Attrs: optsize
37declare void @wombat(<4 x float>)
38