diff options
author | Chris Lattner <sabre@nondot.org> | 2007-03-03 05:27:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-03-03 05:27:34 +0000 |
commit | da1d04a0571ab7b363b0d47f41156a159a151ed9 (patch) | |
tree | 2c9fa986011c46e710eb306b69e180b2f2dc922e /llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp | |
parent | 05e93d7f0556ee592571e99846151cfd0eca6360 (diff) | |
download | llvm-da1d04a0571ab7b363b0d47f41156a159a151ed9.zip llvm-da1d04a0571ab7b363b0d47f41156a159a151ed9.tar.gz llvm-da1d04a0571ab7b363b0d47f41156a159a151ed9.tar.bz2 |
my recent change caused a failure in a bswap testcase, because it changed
the order that instcombine processed instructions in the testcase. The end
result is that instcombine finished with:
define i16 @test1(i16 %a) {
%tmp = zext i16 %a to i32 ; <i32> [#uses=2]
%tmp21 = lshr i32 %tmp, 8 ; <i32> [#uses=1]
%tmp5 = shl i32 %tmp, 8 ; <i32> [#uses=1]
%tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1]
%tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1]
ret i16 %tmp.upgrd.3
}
which can't get matched as a bswap.
This patch makes instcombine more sophisticated about removing truncating
casts, allowing it to turn this into:
define i16 @test2(i16 %a) {
%tmp211 = lshr i16 %a, 8
%tmp52 = shl i16 %a, 8
%tmp.upgrd.323 = or i16 %tmp211, %tmp52
ret i16 %tmp.upgrd.323
}
which then matches as bswap. This fixes bswap.ll and implements
InstCombine/cast2.ll:test[12]. This also implements cast elimination of
add/sub.
llvm-svn: 34870
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp')
0 files changed, 0 insertions, 0 deletions