2014-06-12 02:28:45 +08:00
|
|
|
; RUN: opt < %s -reassociate -instcombine -S | FileCheck %s
|
2002-05-16 05:56:51 +08:00
|
|
|
|
2014-06-12 02:28:45 +08:00
|
|
|
define i32 @test1(i32 %A, i32 %B) {
|
|
|
|
; CHECK-LABEL: test1
|
2014-11-20 07:21:20 +08:00
|
|
|
; CHECK: %Z = add i32 %B, %A
|
2014-06-12 02:28:45 +08:00
|
|
|
; CHECK: ret i32 %Z
|
|
|
|
%W = add i32 %B, -5
|
|
|
|
%Y = add i32 %A, 5
|
|
|
|
%Z = add i32 %W, %Y
|
2008-03-19 12:36:04 +08:00
|
|
|
ret i32 %Z
|
2002-05-16 05:56:51 +08:00
|
|
|
}
|