Chris Lattner
eb3da2ab86
remove an xform subsumed by EvaluateInDifferentType.
...
llvm-svn: 93095
2010-01-10 01:35:55 +00:00
Chris Lattner
edb60f0861
clean up this xform by using m_Trunc.
...
llvm-svn: 93092
2010-01-10 01:04:31 +00:00
Chris Lattner
3efde81a44
inline and remove the rest of commonIntCastTransforms.
...
llvm-svn: 93091
2010-01-10 01:00:46 +00:00
Chris Lattner
492e9ca5a4
Inline the expression type promotion/demotion stuff out of
...
commonIntCastTransforms into the callers, eliminating a switch,
and allowing the static predicate methods to be moved down to
live next to the corresponding function. No functionality
change.
llvm-svn: 93089
2010-01-10 00:58:42 +00:00
Chris Lattner
fd117b63f7
mplement a theoretical fixme.
...
llvm-svn: 93024
2010-01-08 19:28:47 +00:00
Chris Lattner
474cd30fb7
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
db8fa82914
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
0f611954b6
tweaks suggested by Duncan
...
llvm-svn: 92824
2010-01-06 05:32:15 +00:00
Chris Lattner
0b73344d8a
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
7bf6842c49
simplify this code.
...
llvm-svn: 92800
2010-01-05 23:00:30 +00:00
Chris Lattner
a101affbdb
make this a static function instead of a method.
...
llvm-svn: 92795
2010-01-05 22:30:42 +00:00
Chris Lattner
53b9ed70ee
more rearrangement and cleanup, fix my test failure.
...
llvm-svn: 92792
2010-01-05 22:21:18 +00:00
Chris Lattner
45cd7ba394
cleanup
...
llvm-svn: 92790
2010-01-05 22:07:33 +00:00
Chris Lattner
2f69f6a822
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
13293b9738
just remove this xform which is subsumed by others.
...
llvm-svn: 92775
2010-01-05 21:16:30 +00:00
Chris Lattner
3aac94341a
move a trunc-specific transform out of commonIntCastTransforms into visitTrunc.
...
llvm-svn: 92773
2010-01-05 21:11:17 +00:00
Chris Lattner
18ed3a6976
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
4c21bfec50
move a trunc-specific xform out of commonIntCastTransforms into visitTrunc
...
llvm-svn: 92768
2010-01-05 20:57:30 +00:00
Benjamin Kramer
c233521d45
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
e90a3c66c4
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
e19878577c
move some more cast-related stuff
...
llvm-svn: 92471
2010-01-04 07:59:07 +00:00
Chris Lattner
f9920fbac9
move the [Can]EvaluateInDifferentType functions out to InstCombineCasts.cpp
...
llvm-svn: 92469
2010-01-04 07:54:59 +00:00
Chris Lattner
7a5037baf5
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