Chris Lattner
9242ae047c
mplement a theoretical fixme.
...
llvm-svn: 93024
2010-01-08 19:28:47 +00:00
Chris Lattner
10840e9e13
rename CanEvaluateInDifferentType -> CanEvaluateTruncated and
...
simplify it now that it is only used for truncates.
llvm-svn: 93021
2010-01-08 19:19:23 +00:00
Chris Lattner
3057c37959
Enhance instcombine to reason more strongly about promoting computation
...
that feeds into a zext, similar to the patch I did yesterday for sext.
There is a lot of room for extension beyond this patch.
llvm-svn: 92962
2010-01-07 23:41:00 +00:00
Chris Lattner
4339f2abdb
tweaks suggested by Duncan
...
llvm-svn: 92824
2010-01-06 05:32:15 +00:00
Chris Lattner
98748c0964
Teach instcombine's sext elimination logic to be more aggressive.
...
Previously, instcombine would only promote an expression tree to
the larger type if doing so eliminated two casts. This is because
a need to manually do the sign extend after the promoted expression
tree with two shifts. Now, we keep track of whether the result of
the computation is going to be properly sign extended already. If
so, we can unconditionally promote the expression, which allows us
to zap more sext's.
This implements rdar://6598839 (aka gcc pr38751)
llvm-svn: 92815
2010-01-06 01:56:21 +00:00
Chris Lattner
8600dd3d7c
simplify this code.
...
llvm-svn: 92800
2010-01-05 23:00:30 +00:00
Chris Lattner
554d0564ff
make this a static function instead of a method.
...
llvm-svn: 92795
2010-01-05 22:30:42 +00:00
Chris Lattner
a93c63c22d
more rearrangement and cleanup, fix my test failure.
...
llvm-svn: 92792
2010-01-05 22:21:18 +00:00
Chris Lattner
f476ef502c
cleanup
...
llvm-svn: 92790
2010-01-05 22:07:33 +00:00
Chris Lattner
f88dd5ed64
remove two trunc xforms that are subsumed by EvaluateInDifferentType.
...
The only difference is that EvaluateInDifferentType checks to ensure
they are profitable before doing them :)
llvm-svn: 92788
2010-01-05 22:01:41 +00:00
Chris Lattner
44a63815b9
just remove this xform which is subsumed by others.
...
llvm-svn: 92775
2010-01-05 21:16:30 +00:00
Chris Lattner
b82a840eb2
move a trunc-specific transform out of commonIntCastTransforms into visitTrunc.
...
llvm-svn: 92773
2010-01-05 21:11:17 +00:00
Chris Lattner
fd7e42b65d
move a zext specific xform out of commonIntCastTransforms into visitZExt and modernize it.
...
llvm-svn: 92770
2010-01-05 21:04:47 +00:00
Chris Lattner
aaccc8de62
move a trunc-specific xform out of commonIntCastTransforms into visitTrunc
...
llvm-svn: 92768
2010-01-05 20:57:30 +00:00
Benjamin Kramer
a81a6dff0d
Convert a ton of simple integer type equality tests to the new predicate.
...
llvm-svn: 92760
2010-01-05 20:07:06 +00:00
Benjamin Kramer
ccce8bae14
Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
...
llvm-svn: 92726
2010-01-05 13:12:22 +00:00
Chris Lattner
59d95743c8
move some more cast-related stuff
...
llvm-svn: 92471
2010-01-04 07:59:07 +00:00
Chris Lattner
92be2adba6
move the [Can]EvaluateInDifferentType functions out to InstCombineCasts.cpp
...
llvm-svn: 92469
2010-01-04 07:54:59 +00:00
Chris Lattner
2b295a0eba
split 943 lines of instcombine out to a new InstCombineCasts.cpp
...
file. InstructionCombining.cpp is now down to a svelte 9300 lines :)
llvm-svn: 92468
2010-01-04 07:53:58 +00:00