blob: ba1ff9ec73fd2c6c903984d1158d3c6f43c9b273 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; With reassociation, constant folding can eliminate the +/- 30 constants.
2;
Dan Gohman3c7d3082009-09-11 18:01:28 +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