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
363cd9e4b8
Add a new ConstantAggregateZero class, to fix PR239. This makes zero
...
initializers for constant structs and arrays take constant space, instead of
space proportinal to the number of elements. This reduces the memory usage of
the LLVM compiler by hundreds of megabytes when compiling some nasty SPEC95
benchmarks.
llvm-svn: 11470
2004-02-15 05:53:04 +00:00
Chris Lattner
0f819b9523
ConstantArray::get and ConstantStruct::get now just return pointers to
...
'Constant', instead of specific subclass pointers. In the future, these will
return an instance of ConstantAggregateZero if all of the inputs are zeros.
llvm-svn: 11467
2004-02-15 04:14:47 +00:00
Chris Lattner
52cc69f39e
Remove dependence on return type of ConstantStruct::get
...
llvm-svn: 11466
2004-02-15 04:07:32 +00:00
Chris Lattner
3fd2b573f1
Remove dependence on the return type of ConstantArray::get
...
llvm-svn: 11463
2004-02-15 04:05:58 +00:00
Chris Lattner
c8d0942108
Keep a cache of non-abstract null arrays and structs. This speeds up llvm-dis
...
from 16.57 -> 13.46s on 129.compress.
llvm-svn: 11462
2004-02-15 02:46:46 +00:00
Chris Lattner
16690fad3d
Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
...
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
a61cda01c2
Second half of a fix for PR218 & test/Regression/Assembler/2004-02-01-NegativeZero.llx.
...
Basically we store floating point values as their integral components, instead of relying
on the semantics of floating point < to differentiate between values. This is likely to
make the map search be faster anyway.
llvm-svn: 11064
2004-02-01 22:49:04 +00:00
Chris Lattner
317a6fec82
Fix a problem brian ran into with the bytecode reader asserting. It turns
...
out that the problem was actually the writer writing out a 'null' value
because it didn't normalize it. This fixes:
test/Regression/Assembler/2004-01-22-FloatNormalization.ll
llvm-svn: 10967
2004-01-23 00:55:21 +00:00
Chris Lattner
8767bd75e4
Fix bug in previous checkin: Demorgan would be ashamed of me, I need to
...
lay off the crack.
llvm-svn: 10855
2004-01-14 17:51:53 +00:00
Chris Lattner
a991025919
Implement ConstantArray::isString
...
llvm-svn: 10851
2004-01-14 17:06:38 +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
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
b420886171
Eliminate ConstantFoldShiftInstruction reference
...
llvm-svn: 10801
2004-01-12 20:40:42 +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
52759f5c5e
Make ConstantExpr::get work for shifts as well
...
llvm-svn: 10790
2004-01-12 19:04:55 +00:00
Chris Lattner
a1da49a55c
Finegrainify namespacification
...
llvm-svn: 10131
2003-11-21 20:23:48 +00:00
Chris Lattner
1f762c7571
The ConstantPointer class is now gone.
...
llvm-svn: 10057
2003-11-17 19:47:21 +00:00
Brian Gaeke
d25f86d683
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
352ad83271
Add support for constant expr shifts
...
llvm-svn: 9735
2003-11-05 19:53:03 +00:00
Chris Lattner
4347464e2a
Fix bug: instcombine/2003-10-23-InstcombineNullFail.ll
...
llvm-svn: 9403
2003-10-23 05:21:48 +00:00
Chris Lattner
53d92d23b0
Fix problem which effected linking apache
...
llvm-svn: 9335
2003-10-21 17:39:59 +00:00
John Criswell
b402729b30
Added LLVM project notice to the top of every C++ source file.
...
Header files will be on the way.
llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
bd123c6e51
Add a sanity check for constant expression casts
...
llvm-svn: 8951
2003-10-07 22:19:19 +00:00
Chris Lattner
b5f0d32b91
Type tables are now AbstractTypeUsers. This allows them to merge together
...
constants as necessary due to type resolution. With this change, the
following spec benchmarks now link: 176.gcc, 177.mesa, 252.eon,
253.perlbmk, & 300.twolf. IOW, all SPEC INT and FP benchmarks now link.
llvm-svn: 8853
2003-10-05 00:17:43 +00:00
Chris Lattner
06dbcc0540
Minor random speedup: make Constant::getNullValue only call ConstantFOO::get
...
once!
llvm-svn: 8845
2003-10-03 19:34:51 +00:00
Chris Lattner
101d5058cb
These methods are dead, remove them. Because the bodies will soon be
...
ressurected, just ifdef them out for now.
llvm-svn: 8840
2003-10-03 18:39:57 +00:00
Chris Lattner
83856d0df1
There is no reason for Value to be an AbstractTypeUser. This just makes things
...
significantly more complete. Instead, just make DerivedType's AbstractTypeUser's,
and make Value contain a PATypeHolder.
llvm-svn: 8828
2003-10-02 19:44:40 +00:00
Chris Lattner
286e92a9ef
Implement "unsafe" replaceAllUsesWWith stuff for use during type resolution.
...
llvm-svn: 8209
2003-08-29 05:36:46 +00:00
Chris Lattner
a2a7b891e5
Refactor code to make it useful outside of Constants.cpp
...
llvm-svn: 8205
2003-08-29 05:09:37 +00:00
Misha Brukman
cda7f97dbb
The word dependent' has no
a'.
...
llvm-svn: 8030
2003-08-21 22:14:26 +00:00
Chris Lattner
9fed232059
Fix linking bug in xboard
...
llvm-svn: 7952
2003-08-18 16:54:48 +00:00
Chris Lattner
6457a808f0
Fix a bug that brian reported
...
llvm-svn: 7428
2003-07-30 19:04:37 +00:00
Chris Lattner
6ad460b336
Simplify code by using ConstantInt::getRawValue instead of checking to see
...
whether the constant is signed or unsigned, then casting
llvm-svn: 7252
2003-07-23 15:22:26 +00:00
Chris Lattner
b40f50e3d1
Fix bug: InstCombine/2003-06-22-ConstantExprCrash.ll
...
llvm-svn: 6857
2003-06-22 20:48:30 +00:00
Chris Lattner
343c4d4987
Fix bug: Linker/2003-06-02-TypeResolveProblem2.ll
...
llvm-svn: 6699
2003-06-16 12:11:33 +00:00
Chris Lattner
37b01d74e4
* Make assertion message useful
...
* Kill dead conditional
llvm-svn: 6544
2003-06-02 17:42:47 +00:00
Chris Lattner
c17deffb2b
Fix bug: Linker/2003-06-02-TypeResolveProblem.ll
...
llvm-svn: 6542
2003-06-02 17:25:46 +00:00
Chris Lattner
fbb45c1b92
Fix problem with last checkin.
...
llvm-svn: 6328
2003-05-25 16:15:32 +00:00
Chris Lattner
500984b918
Fix Bug: Linker/2003-04-26-NullPtrLinkProblem.ll
...
This was a problem with constants having their types resolved to some new type,
but there was already a constant of the new type created. Before, these types
were never merged together, now they are.
llvm-svn: 6314
2003-05-23 20:03:32 +00:00
Chris Lattner
0462d7b16d
Add support for shift constant expressions
...
llvm-svn: 6260
2003-05-21 17:49:25 +00:00
Chris Lattner
872fe63520
Fix bug: Assembler/2003-05-15-AssemblerProblem.llx
...
llvm-svn: 6234
2003-05-15 19:37:21 +00:00
Chris Lattner
e02634b9aa
Remove unnecessary casts
...
llvm-svn: 6201
2003-05-14 17:51:05 +00:00
Chris Lattner
a33d9882ce
Eliminate using declarations
...
llvm-svn: 6179
2003-05-13 21:37:02 +00:00
Chris Lattner
eacb88d2e9
Don't build constantexprs that could be folded
...
llvm-svn: 5801
2003-04-17 19:24:48 +00:00
Chris Lattner
bb00f755ed
Change the interface to constant expressions to allow automatic folding
...
llvm-svn: 5793
2003-04-16 22:40:51 +00:00
Chris Lattner
5e5950b7e0
Fix ConstantUInt::isAllOnesValue
...
llvm-svn: 5734
2003-03-10 22:39:02 +00:00
Chris Lattner
90932ffc26
Remove #include
...
Extend getNullValue to work with struct and array types
llvm-svn: 5718
2003-03-06 21:02:18 +00:00
Chris Lattner
5b41b28fb6
- Dramatically simplify the Constant::mutateReferences implementation,
...
allowing it to be called on all constant types (structures/arrays)
llvm-svn: 4160
2002-10-14 03:30:23 +00:00
Chris Lattner
fdf2ca9468
- Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
...
reflect the fact that it's a range being defined.
llvm-svn: 4147
2002-10-13 19:39:16 +00:00