blob: 34c2df605e4277a31fdb540ca348a4da28b8d6f3 [file] [log] [blame]
Chris Lattner86498982002-05-14 16:40:43 +00001; Instcombine was missing a test that caused it to make illegal transformations
2; sometimes. In this case, it transforms the sub into an add:
Chris Lattner4ba10362007-03-28 01:43:43 +00003; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sub
Chris Lattner86498982002-05-14 16:40:43 +00004;
Chris Lattner4ba10362007-03-28 01:43:43 +00005define i32 @test(i32 %i, i32 %j) {
6 %A = mul i32 %i, %j
7 %B = sub i32 2, %A
8 ret i32 %B
Chris Lattner86498982002-05-14 16:40:43 +00009}
Chris Lattner4ba10362007-03-28 01:43:43 +000010