repo.or.cz
/
llvm
/
avr.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
another random update
[llvm/avr.git]
/
test
/
Transforms
/
Reassociate
/
mul-neg-add.ll
blob
a2d92156181e0e5264a8d5f436481ca5b93d3f0d
1
; RUN: opt %s -reassociate -instcombine -S |\
2
; RUN: not grep {sub i32 0}
3
4
define i32 @test(i32 %X, i32 %Y, i32 %Z) {
5
%A = sub i32 0, %X ; <i32> [#uses=1]
6
%B = mul i32 %A, %Y ; <i32> [#uses=1]
7
; (-X)*Y + Z -> Z-X*Y
8
%C = add i32 %B, %Z ; <i32> [#uses=1]
9
ret i32 %C
10
}