blob: 64ca58f4e3ad90700e080a79e2f4c25080e92598 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; With reassociation, constant folding can eliminate the +/- 30 constants.
2;
Dan Gohman5bb7c7c2009-09-08 22:34:10 +00003; RUN: opt %s -reassociate -constprop -instcombine -die -S | not grep 30
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Tanya Lattner028031a2008-03-19 04:36:04 +00005define i32 @test(i32 %reg109, i32 %reg1111) {
6 %reg115 = add i32 %reg109, -30 ; <i32> [#uses=1]
7 %reg116 = add i32 %reg115, %reg1111 ; <i32> [#uses=1]
8 %reg117 = add i32 %reg116, 30 ; <i32> [#uses=1]
9 ret i32 %reg117
Dan Gohmanf17a25c2007-07-18 16:29:46 +000010}
Tanya Lattner028031a2008-03-19 04:36:04 +000011