Teach reassociate to commute FMul's and FAdd's in order to canonicalize the order...
[oota-llvm.git] / test / Transforms / Reassociate / fp-commute.ll
1 ; RUN: opt -reassociate -S < %s | FileCheck %s
2
3 target triple = "armv7-apple-ios"
4
5 ; CHECK: test
6 define float @test(float %x, float %y) {
7 entry:
8 ; CHECK: fmul float %x, %y
9 ; CHECK: fmul float %x, %y
10   %0 = fmul float %x, %y
11   %1 = fmul float %y, %x
12   %2 = fsub float %0, %1
13   ret float %1
14 }
15
16