2002-05-09 05:34:22 +08:00
|
|
|
; With reassociation, constant folding can eliminate the 12 and -12 constants.
|
|
|
|
;
|
2009-09-12 02:01:28 +08:00
|
|
|
; RUN: opt < %s -reassociate -constprop -instcombine -die -S | not grep add
|
2002-05-09 05:34:22 +08:00
|
|
|
|
2008-03-19 12:36:04 +08:00
|
|
|
define i32 @test(i32 %arg) {
|
|
|
|
%tmp1 = sub i32 -12, %arg ; <i32> [#uses=1]
|
|
|
|
%tmp2 = add i32 %tmp1, 12 ; <i32> [#uses=1]
|
|
|
|
ret i32 %tmp2
|
2002-05-09 05:34:22 +08:00
|
|
|
}
|
2008-03-19 12:36:04 +08:00
|
|
|
|