blob: e4b5e936f5872a5493767dfc17f64e03a08cb3af [file] [log] [blame]
Chad Rosier11ab9412014-08-14 15:23:01 +00001; RUN: opt < %s -reassociate -S | FileCheck %s
2
3; Don't handle floating point vector operations.
4define <4 x float> @test1() {
5; CHECK-LABEL: test1
6; CHECK-NEXT: %tmp1 = fsub fast <4 x float> zeroinitializer, zeroinitializer
7; CHECK-NEXT: %tmp2 = fmul fast <4 x float> zeroinitializer, %tmp1
8
9 %tmp1 = fsub fast <4 x float> zeroinitializer, zeroinitializer
10 %tmp2 = fmul fast <4 x float> zeroinitializer, %tmp1
11 ret <4 x float> %tmp2
12}
13
14; We don't currently commute integer vector operations.
15define <2 x i32> @test2(<2 x i32> %x, <2 x i32> %y) {
16; CHECK-LABEL: test2
17; CHECK-NEXT: %tmp1 = add <2 x i32> %x, %y
18; CHECK-NEXT: %tmp2 = add <2 x i32> %y, %x
19; CHECK-NEXT: %tmp3 = add <2 x i32> %tmp1, %tmp2
20
21 %tmp1 = add <2 x i32> %x, %y
22 %tmp2 = add <2 x i32> %y, %x
23 %tmp3 = add <2 x i32> %tmp1, %tmp2
24 ret <2 x i32> %tmp3
25}