Home | History | Annotate | Download | only in Reassociate
      1 ; RUN: opt < %s -reassociate -instcombine -S | FileCheck %s
      2 
      3 ; Test that we can turn things like A*B + X - A*B -> X.
      4 
      5 define i32 @test1(i32 %a, i32 %b, i32 %x) {
      6 ; CHECK-LABEL: test1
      7 ; CHECK: ret i32 %x
      8 
      9   %c = mul i32 %a, %b
     10   %d = add i32 %c, %x
     11   %c1 = mul i32 %a, %b
     12   %f = sub i32 %d, %c1
     13   ret i32 %f
     14 }
     15 
     16