Xamarin Public Jenkins (auto-signing) 468663ddbb Imported Upstream version 6.10.0.49
Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
2020-01-16 16:38:04 +00:00

16 lines
310 B
LLVM

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