OSDN Git Service

two changes:
authorChris Lattner <sabre@nondot.org>
Sun, 10 Jan 2010 02:39:31 +0000 (02:39 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 10 Jan 2010 02:39:31 +0000 (02:39 +0000)
commit3cd3693df4aaf911e2b7befd74ea6f026d63dde7
tree8f50f562cd230060f1d19488299366e5de39bc16
parent2133deb715d284cc8435aa122058b28ba64706ed
two changes:
1) don't try to optimize a sext or zext that is only used by a trunc, let
   the trunc get optimized first.  This avoids some pointless effort in
   some common cases since instcombine scans down a block in the first pass.
2) Change the cost model for zext elimination to consider an 'and' cheaper
   than a zext.  This allows us to do it more aggressively, and for the next
   patch to simplify the code quite a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93097 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCasts.cpp
test/Transforms/InstCombine/cast.ll