negation1.ll 310 B

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