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
Chris Lattner
7285258cc0
Remove a whole bunch more ugliness. This is actually getting to the point of
...
this whole refactoring: allow constant folding methods to return something
other than predefined classes, allow them to return generic Constant*'s.
llvm-svn: 10806
2004-01-12 21:02:29 +00:00
Chris Lattner
d757923e11
Move ConstantHandling.h into lib/VMCore and out of include/llvm
...
llvm-svn: 10805
2004-01-12 20:48:11 +00:00
Chris Lattner
f6f9aafee4
Move this file to lib/VMCore
...
llvm-svn: 10804
2004-01-12 20:47:29 +00:00
Chris Lattner
0c243f5c04
Eliminate a lot of out-of-date comments, and all of the wierd overloaded
...
operator constant folding stuff.
llvm-svn: 10803
2004-01-12 20:43:44 +00:00
Chris Lattner
abdd592bb1
Eliminate usage of the wierd overloaded operator constant folders
...
llvm-svn: 10802
2004-01-12 20:41:05 +00:00
Chris Lattner
b420886171
Eliminate ConstantFoldShiftInstruction reference
...
llvm-svn: 10801
2004-01-12 20:40:42 +00:00
Chris Lattner
2ff33e72ba
Remove use of ConstantHandling itf
...
llvm-svn: 10800
2004-01-12 20:13:04 +00:00
Chris Lattner
7bfaf8bba8
Clean up #includes
...
llvm-svn: 10799
2004-01-12 19:56:36 +00:00
Chris Lattner
68c5d9e0d6
Fix bug in previous checkin
...
llvm-svn: 10798
2004-01-12 19:47:05 +00:00
Chris Lattner
cf1d9df549
The getShift method is no obsolete
...
llvm-svn: 10797
2004-01-12 19:37:26 +00:00
Chris Lattner
7d2328f69c
Eliminate use of ConstantHandling and ConstantExpr::getShift interfaces
...
llvm-svn: 10796
2004-01-12 19:35:11 +00:00
Chris Lattner
f4c2dcbe21
Add header file I accidentally removed in teh shuffle
...
llvm-svn: 10795
2004-01-12 19:15:20 +00:00
Chris Lattner
35771f4fd2
Fix out of date comment, remove use of ConstantExpr::getShift
...
llvm-svn: 10794
2004-01-12 19:12:58 +00:00
Chris Lattner
de401bbd4b
Remove use of the ConstantHandling interfaces
...
llvm-svn: 10793
2004-01-12 19:12:50 +00:00
Chris Lattner
47e9056669
Remove use of ConstantExpr::getShift
...
llvm-svn: 10792
2004-01-12 19:10:58 +00:00
Chris Lattner
758109ce2e
Don't use ConstantExpr::getShift anymore
...
llvm-svn: 10791
2004-01-12 19:08:43 +00:00
Chris Lattner
52759f5c5e
Make ConstantExpr::get work for shifts as well
...
llvm-svn: 10790
2004-01-12 19:04:55 +00:00
Chris Lattner
23da5dbed6
Remove use of ConstantHandling
...
llvm-svn: 10789
2004-01-12 18:35:03 +00:00
Chris Lattner
4db788b6c5
Remove unneeded #include
...
llvm-svn: 10788
2004-01-12 18:33:54 +00:00
Chris Lattner
98a45667fb
llvm::ConstantFoldInstruction
...
llvm-svn: 10787
2004-01-12 18:25:56 +00:00
Chris Lattner
28e5347635
Move prototype of llvm::ConstantFoldInstruction
...
llvm-svn: 10786
2004-01-12 18:25:44 +00:00
Chris Lattner
7242f6af5f
Move llvm::ConstantFoldInstruction from VMCore to here, next to ConstantFoldTerminator
...
llvm-svn: 10785
2004-01-12 18:25:22 +00:00
Chris Lattner
e6b9c1001b
Move llvm::ConstantFoldInstruction from here to Transforms/Utils
...
llvm-svn: 10784
2004-01-12 18:25:03 +00:00
Chris Lattner
a5101c4743
Remove uses of ConstantHandling itf
...
llvm-svn: 10783
2004-01-12 18:12:44 +00:00
Chris Lattner
41ac9c82f9
Eliminate use of ConstantHandling itf
...
llvm-svn: 10782
2004-01-12 18:08:18 +00:00
Chris Lattner
c290310e9f
Remove use of ConstantHandling itf
...
llvm-svn: 10781
2004-01-12 18:02:15 +00:00
Chris Lattner
a2612e417c
Eliminate use of ConstantHandling itf
...
llvm-svn: 10780
2004-01-12 17:57:32 +00:00
Chris Lattner
5a9246fb56
Use constantexprs for casts. Eliminate use of the ConstantHandling interfaces
...
llvm-svn: 10779
2004-01-12 17:43:40 +00:00
Chris Lattner
8e3cb82d12
Fix fairly severe bug in my last checking where we treated all unfoldable
...
constants as being "true" when evaluating branches. This was introduced
because we now create constantexprs for the constants instead of failing the
fold.
llvm-svn: 10778
2004-01-12 17:40:36 +00:00
Chris Lattner
91b68d6a5a
Eliminate annoying warnings from the tester, hopefully for real this time.
...
llvm-svn: 10777
2004-01-12 16:55:30 +00:00
John Criswell
572ea1a080
Modified the configure script so that it defines BISON as the bison
...
binary and YACC as bison -y.
llvm-svn: 10776
2004-01-12 16:18:21 +00:00
John Criswell
e6439708ea
The configure script now defines BISON as the name of the bison program and
...
YACC as bison -y. In this way, we ensure that bison is being used, but
the Makefiles have macros for using bison itself and for getting bison to
act like it is traditional yacc.
llvm-svn: 10774
2004-01-12 16:14:54 +00:00
Alkis Evlogimenos
44747c570a
Output mov %REG = 0 instead of xor %REG, %REG, %REG to clear a
...
register so that LiveVariable analysis is not confused.
llvm-svn: 10773
2004-01-12 07:22:45 +00:00
Chris Lattner
88ea3eff8c
Bug fixed
...
llvm-svn: 10770
2004-01-12 05:15:04 +00:00
Chris Lattner
c45c2bdbad
Testcase for PR204
...
llvm-svn: 10769
2004-01-12 05:01:48 +00:00
Chris Lattner
6c47632b4d
Add support for %llvmgcc
...
llvm-svn: 10768
2004-01-12 05:01:13 +00:00
Chris Lattner
a523d45c39
* Implement minor performance optimization for the getelementptr case
...
* Implement SCCP of load instructions, implementing Transforms/SCCP/loadtest.ll
This allows us to fold expressions like "foo"[2], even if the pointer is only
a conditional constant.
llvm-svn: 10767
2004-01-12 04:29:41 +00:00
Chris Lattner
fec681ed7c
Test to make sure we can SCCP load instructions
...
llvm-svn: 10766
2004-01-12 04:28:32 +00:00
Chris Lattner
cb0fc1ce41
Do not hack on volatile loads. I'm not sure what the point of a volatile load
...
from constant memory is, but lets not take chances.
llvm-svn: 10765
2004-01-12 04:13:56 +00:00
Chris Lattner
1269b71517
Implement SCCP/phitest.ll
...
llvm-svn: 10763
2004-01-12 03:57:30 +00:00
Chris Lattner
4bfeceb15a
New testcase, allow folding of binary operators that use PHI nodes, as long
...
as the result of the binary operator is always constant. This does not require
the PHI itself to be constant though.
llvm-svn: 10762
2004-01-12 03:57:00 +00:00
Chris Lattner
40c667e0bc
Implement Transforms/ScalarRepl/phinodepromote.ll, which is an important
...
case that the C/C++ front-end generates.
llvm-svn: 10761
2004-01-12 01:18:32 +00:00
Chris Lattner
f4af28db0c
New testcase
...
llvm-svn: 10760
2004-01-12 01:17:42 +00:00
Chris Lattner
a4f199b80c
Implement: Assembler/2004-01-11-getelementptrfolding.llx
...
llvm-svn: 10759
2004-01-11 23:56:33 +00:00
Chris Lattner
68bae4ff19
This isn't really an assembler test. This tests to make sure the
...
ConstantExpr::getGetElementPtr method folds two getelementptr instructions
when possible.
llvm-svn: 10758
2004-01-11 23:56:03 +00:00
Chris Lattner
1e781891a5
Urg, remove testing code.
...
llvm-svn: 10757
2004-01-11 23:30:03 +00:00
Chris Lattner
7fb38d32a0
Fix a regression that I introduced yesterday. :(
...
llvm-svn: 10756
2004-01-11 23:29:26 +00:00
Alkis Evlogimenos
ef7c077e63
Make LiveVariables::HandlePhysRegUse and
...
LiveVariables::HandlePhysRegDef private they use information that is
not in memory when LiveVariables finishes the analysis.
Also update the TwoAddressInstructionPass to not use this interface.
llvm-svn: 10755
2004-01-11 09:18:45 +00:00