summaryrefslogtreecommitdiff
path: root/test/Transforms/Reassociate/fp-commute.ll
blob: 025689bb0c103f15abafb1136cf346d0f08d4f6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
; RUN: opt -reassociate -S < %s | FileCheck %s

target triple = "armv7-apple-ios"

declare void @use(float)

; CHECK: test
define void @test(float %x, float %y) {
entry:
; CHECK: fmul float %x, %y
; CHECK: fmul float %x, %y
  %0 = fmul float %x, %y
  %1 = fmul float %y, %x
  %2 = fsub float %0, %1
  call void @use(float %0)
  call void @use(float %2)
  ret void
}