mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +00:00
12 lines
285 B
LLVM
12 lines
285 B
LLVM
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
||
|
define i32 @foo(i32 %x, i32 %y) {
|
||
|
; CHECK: @foo
|
||
|
%add = add nsw i32 %y, %x
|
||
|
%mul = mul nsw i32 %add, %y
|
||
|
%square = mul nsw i32 %y, %y
|
||
|
%res = sub i32 %mul, %square
|
||
|
; CHECK: %res = mul i32 %x, %y
|
||
|
ret i32 %res
|
||
|
; CHECK: ret i32 %res
|
||
|
}
|