Remove dead instructions before Redoing
[oota-llvm.git] / test / Transforms / Reassociate / factorize-again.ll
1 ; RUN: opt -S -reassociate < %s | FileCheck %s
2
3 ; CHECK-LABEL: main
4 ; CHECK: %2 = fsub
5 ; CHECK: %3 = fsub
6 ; CHECK: fadd fast float %3, %2
7 define void @main(float, float) {
8 wrapper_entry:
9   %2 = fsub float undef, %0
10   %3 = fsub float undef, %1
11   %4 = call float @llvm.rsqrt.f32(float undef)
12   %5 = fmul fast float undef, %4
13   %6 = fmul fast float %2, %4
14   %7 = fmul fast float %3, %4
15   %8 = fmul fast float %5, undef
16   %9 = fmul fast float %6, undef
17   %10 = fmul fast float %7, undef
18   %11 = fadd fast float %8, %9
19   %12 = fadd fast float %11, %10
20   %13 = call float @foo2(float %12, float 0.000000e+00)
21   %mul36 = fmul fast float %13, 1.500000e+00
22   call void @foo1(i32 4, float %mul36)
23   ret void
24 }
25
26 declare void @foo1(i32, float)
27
28 declare float @foo2(float, float) #1
29
30 declare float @llvm.rsqrt.f32(float) #1
31
32 attributes #0 = { argmemonly nounwind }
33 attributes #1 = { nounwind readnone }
34