diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-31 20:34:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-31 20:34:32 +0000 |
commit | fed339765404f5737d5086f8a69cc7446f65fd7c (patch) | |
tree | 1d8aff72bf4ce90b8915e353b0bdfefd80c2da26 /llvm/lib/Bitcode/Reader | |
parent | 60c2ca743d044d735cd963a321241611ea536ef2 (diff) | |
download | bcm5719-llvm-fed339765404f5737d5086f8a69cc7446f65fd7c.tar.gz bcm5719-llvm-fed339765404f5737d5086f8a69cc7446f65fd7c.zip |
reuse negates where possible instead of always creating them from scratch.
This allows us to optimize test12 into:
define i32 @test12(i32 %X) {
%factor = mul i32 %X, -3 ; <i32> [#uses=1]
%Z = add i32 %factor, 6 ; <i32> [#uses=1]
ret i32 %Z
}
instead of:
define i32 @test12(i32 %X) {
%Y = sub i32 6, %X ; <i32> [#uses=1]
%C = sub i32 %Y, %X ; <i32> [#uses=1]
%Z = sub i32 %C, %X ; <i32> [#uses=1]
ret i32 %Z
}
llvm-svn: 92373
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
0 files changed, 0 insertions, 0 deletions