1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

11 Commits

Author SHA1 Message Date
Reid Spencer
d98738fe4d Fix a bug that Chris asserts emphatically is a bug. The changed clause
would always return false because the Type of a type value is always
Type::TypeTY and can never be a floating point type.

llvm-svn: 13902
2004-05-30 01:19:48 +00:00
Chris Lattner
226ea8166e Add a missing break, which caused a crash in an obscure situation
llvm-svn: 12825
2004-04-11 01:29:30 +00:00
Chris Lattner
9236135e8f Support getelementptr instructions which use uint's to index into structure
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.

llvm-svn: 12653
2004-04-05 01:30:19 +00:00
Chris Lattner
f0a39f27e0 Teach the constant folder how to do select instructions
llvm-svn: 12321
2004-03-12 05:53:32 +00:00
Chris Lattner
38c2e1d1df Implement test/Regression/Assembler/2004-03-07-FunctionAddressAlignment.llx
llvm-svn: 12218
2004-03-08 06:17:35 +00:00
Chris Lattner
727748b382 Get all instruction definitions
llvm-svn: 11706
2004-02-22 06:25:38 +00:00
Chris Lattner
11c0e5b684 Move the folding of gep null, 0, 0, 0 to a place where it can be shared and
enjoyed by all, fixing a fixme.  Add an assert

llvm-svn: 11505
2004-02-16 20:46:13 +00:00
Chris Lattner
831561989c Fix a crasher bug in my constant folding rewrite
llvm-svn: 11044
2004-02-01 01:23:19 +00:00
Chris Lattner
807e401607 Implement a bunch of symbolic constant folding opportunities. This implements
testcase test/Regression/Assembler/ConstantExprFold.llx

Note that these kinds of things only rarely show up in source code, but are
exceedingly common in the intermediate stages of algorithms like SCCP.  By
folding things (especially relational operators) that use symbolic constants,
we are able to speculatively fold more conditional branches, which can
lead to some big simplifications.

It would be easy to add a lot more special cases here, so if you notice
SCCP missing anything "obvious", you know what to make smarter.  :)

llvm-svn: 10812
2004-01-13 05:51:55 +00:00
Chris Lattner
3e9e5b7db4 Rearrange and comment code better. No functionality changes
llvm-svn: 10808
2004-01-12 22:07:24 +00:00
Chris Lattner
b4e121c364 Rename ConstantHandling.* -> ConstantFolding.*
Move a bunch of (now) private stuff from ConstantFolding.h into
ConstantFolding.cpp.

This _finally_ gets us to a place where we have a sane constant folder.  The
rules are:

1. LLVM clients now use ConstantExpr::get* methods to fold constants.  If they
   cannot be folded, a constantexpr is created, so these methods always return
   valid Constant*'s.
2. The implementation of ConstantExpr::get* uses the functions exposed by
   ConstantFolding.h to try to fold constants.  If they cannot be folded,
   they should return a null pointer.
3. The implementation of ConstantFolding can do whatever it wants, and only
   has one client (Constants.cpp)

This cuts down on the wierd dependencies, and eliminates the two interfaces.
The old constanthandling interface was especially bad for clients to use
because almost none of them took the failure condition into consideration,
thus leading to obscure problems.

llvm-svn: 10807
2004-01-12 21:13:12 +00:00