aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/2010-11-23-Distributed.ll
blob: 13a5720dad2383f1b0816ce67271bdb2a31975a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
; RUN: opt < %s -instcombine -S | FileCheck %s
define i32 @foo(i32 %x, i32 %y) {
; CHECK: @foo
  %add = add nsw i32 %y, %x
  %mul = mul nsw i32 %add, %y
  %square = mul nsw i32 %y, %y
  %res = sub i32 %mul, %square
; CHECK: %res = mul i32 %x, %y
  ret i32 %res
; CHECK: ret i32 %res
}