3ec6615c2bd9104f37826add8fb80662d0bf17a4
[oota-llvm.git] / test / Transforms / NaryReassociate / nary-mul.ll
1 ; RUN: opt < %s -nary-reassociate -S | FileCheck %s
2
3 target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
4
5 declare void @foo(i32)
6
7 ; CHECK-LABEL: @bar(
8 define void @bar(i32 %a, i32 %b, i32 %c) {
9   %1 = mul i32 %a, %c
10 ; CHECK: [[BASE:%[a-zA-Z0-9]+]] = mul i32 %a, %c
11   call void @foo(i32 %1)
12   %2 = mul i32 %a, %b
13   %3 = mul i32 %2, %c
14 ; CHECK: mul i32 [[BASE]], %b
15   call void @foo(i32 %3)
16   ret void
17 }
18