John Criswell
987ad1945d
Fixed inconsistent indentation.
...
llvm-svn: 13363
2004-05-04 21:46:05 +00:00
Misha Brukman
da546eac70
class AssemblyWriter:
...
* Make contained ostream pointer, not reference
* Allow setting of that ostream via setStream()
class CachedWriter:
* setStream() in turn calls setStream() on the AssemblyWriter
llvm-svn: 13247
2004-04-28 19:24:28 +00:00
Misha Brukman
4685e26bc7
* Add ability to print out type as symbolic
...
* Add Module accessor to AssemblyWriter
llvm-svn: 13227
2004-04-28 15:31:21 +00:00
Chris Lattner
2d3a7a6ff0
Changes to fix up the inst_iterator to pass to boost iterator checks. This
...
patch was graciously contributed by Vladimir Prus.
llvm-svn: 13185
2004-04-27 15:13:33 +00:00
Misha Brukman
3bcead7201
I'm allergic to the word `stuff'.
...
llvm-svn: 13096
2004-04-21 18:27:56 +00:00
Misha Brukman
ede10c9185
Fix retriving parent Function.
...
llvm-svn: 13001
2004-04-16 17:37:12 +00:00
Misha Brukman
0af4a9c12b
Assert if deleting BasicBlock before removing it from Function.
...
llvm-svn: 12983
2004-04-16 15:47:21 +00:00
Chris Lattner
0377e4384f
Make sure to check for a very bad class of errors: an instruction
...
that does not dominate all of its users, but is in the same basic block as
its users. This class of error is what caused the mysterious CBE only
failures last night.
llvm-svn: 12979
2004-04-16 05:51:47 +00:00
John Criswell
c4e72c9a0a
Remove the return type check for llvm.readio. This check is done for all
...
functions and is not needed here.
Simplify the pointer type check per Chris's suggestions.
llvm-svn: 12945
2004-04-14 15:06:48 +00:00
John Criswell
0c654c6a4e
Added code to verify that llvm.readio's pointer argument returns something
...
that matches its return type.
llvm-svn: 12944
2004-04-14 14:49:36 +00:00
John Criswell
23c48d63d6
Finish adding the llvm.readio and llvm.writeio intrinsics.
...
Sorry these didn't get in yesterday.
llvm-svn: 12942
2004-04-14 13:46:52 +00:00
Chris Lattner
192e326cd3
Add a missing break, which caused a crash in an obscure situation
...
llvm-svn: 12825
2004-04-11 01:29:30 +00:00
John Criswell
2b4c96e758
Reversed the order of the llvm.writeport() operands so that the value
...
is listed first and the address is listed second.
llvm-svn: 12795
2004-04-09 19:09:14 +00:00
John Criswell
5201004ef9
Added the llvm.readport and llvm.writeport intrinsics.
...
The Verifier ensures that their parameters are of integral types and have
the correct sign, but it does not enforce any size restrictions because
such restrictions are platform dependent.
llvm-svn: 12781
2004-04-08 20:27:38 +00:00
Chris Lattner
69193f93b6
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
dd28474610
Add ConstantExpr::get(Sign|Zero)Extend methods
...
llvm-svn: 12648
2004-04-04 23:20:30 +00:00
Chris Lattner
a45a216ff6
Make the verifier API more complete and useful.
...
Patch contributed by Reid Spencer
llvm-svn: 12609
2004-04-02 15:45:08 +00:00
Chris Lattner
467cb2bc5d
Add support for constant expr casts
...
llvm-svn: 12564
2004-03-31 02:56:11 +00:00
Chris Lattner
b7897ce431
Fix a latent bug in select constantexpr handling that was broke 253.perlbmk
...
llvm-svn: 12562
2004-03-30 22:51:03 +00:00
Chris Lattner
3cdc27c868
Handle -0.0 correctly
...
llvm-svn: 12530
2004-03-29 19:51:24 +00:00
Chris Lattner
817175f883
Add a bunch of methods that should have been added a long time ago.
...
llvm-svn: 12526
2004-03-29 02:37:53 +00:00
Chris Lattner
5f126b74d3
Add another check
...
llvm-svn: 12525
2004-03-29 00:29:36 +00:00
Chris Lattner
587a9f1416
Fix an assertion
...
Contributed by Reid Spencer
llvm-svn: 12524
2004-03-29 00:17:20 +00:00
Chris Lattner
04d6d9d606
Add two methods which have been needed for a long time: Type::get(Un)signedVersion
...
llvm-svn: 12522
2004-03-26 21:43:22 +00:00
Chris Lattner
9ece94b02b
Catch some more cases of broken code. The loop extractor seems to be creating
...
situations where there is a branch that goes to a block in another function.
llvm-svn: 12379
2004-03-14 03:23:54 +00:00
Chris Lattner
b870ca7766
verifyFunction has been broken for a long time now. Fix it.
...
llvm-svn: 12377
2004-03-14 03:16:15 +00:00
Chris Lattner
071a5e5649
Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
...
Intrinsic::va*. This avoid conflicting with macros in the stdlib.h file.
llvm-svn: 12356
2004-03-13 00:24:00 +00:00
Misha Brukman
a447feac33
Keep transitively-required passes alive for queries to work after the initial
...
user pass is destroyed.
llvm-svn: 12332
2004-03-12 06:16:28 +00:00
Chris Lattner
75648e7ae4
Add support for checking the select instruction
...
llvm-svn: 12325
2004-03-12 05:54:31 +00:00
Chris Lattner
8337d4462f
Know the opcode name of the select instruction
...
llvm-svn: 12324
2004-03-12 05:54:20 +00:00
Chris Lattner
6e415c06c2
Add support for select constant expressions. Use reserve a bit more to avoid
...
memory wasteage.
llvm-svn: 12323
2004-03-12 05:54:04 +00:00
Chris Lattner
16375e30b0
Add new function
...
llvm-svn: 12322
2004-03-12 05:53:41 +00:00
Chris Lattner
6ea4b52903
Teach the constant folder how to do select instructions
...
llvm-svn: 12321
2004-03-12 05:53:32 +00:00
Chris Lattner
52bd5cb967
Print select instructions correctly
...
llvm-svn: 12320
2004-03-12 05:53:14 +00:00
Misha Brukman
1df51ed4e5
Fix indentation.
...
llvm-svn: 12298
2004-03-11 23:53:51 +00:00
Chris Lattner
96cdd27b65
Adjust to new interface
...
llvm-svn: 12231
2004-03-08 18:51:45 +00:00
Chris Lattner
ea0789ca7b
Implement test/Regression/Assembler/2004-03-07-FunctionAddressAlignment.llx
...
llvm-svn: 12218
2004-03-08 06:17:35 +00:00
Chris Lattner
c3ecaae16c
Remove Module::mutateConstantPointerRef, which is now thankfully dead!
...
This is one small step towards the complete obliteration of
ConstantPointerRef's entirely!! Woot!
llvm-svn: 12216
2004-03-08 06:16:10 +00:00
Chris Lattner
9f4918ab93
Eliminate nightmarish API
...
llvm-svn: 12214
2004-03-08 06:11:10 +00:00
Misha Brukman
c566ca36a1
Doxygenify comments.
...
llvm-svn: 12071
2004-03-02 00:22:19 +00:00
Misha Brukman
b22d09cc5e
* If a badref has a name, print it out for ease of debugging
...
* Doxygenify (some) comments
llvm-svn: 12057
2004-03-01 19:48:13 +00:00
Chris Lattner
43640d7138
Fix -debug-pass=Executions, which relied on Function, Module, and BasicBlock
...
being annotable
llvm-svn: 12013
2004-02-29 22:37:04 +00:00
Brian Gaeke
465a5cc291
Fix typo in comment
...
llvm-svn: 11966
2004-02-28 21:55:18 +00:00
Chris Lattner
3705370df1
Fix Regression/Assembler/2004-02-27-SelfUseAssertError.ll
...
llvm-svn: 11913
2004-02-27 17:28:25 +00:00
Chris Lattner
120035898b
Make sure that at least one virtual method is defined in a .cpp file to avoid
...
having the compiler emit RTTI and vtables to EVERY translation unit.
llvm-svn: 11871
2004-02-26 07:24:18 +00:00
Chris Lattner
d996e543eb
Make the verifier a little more explicit about this problem.
...
llvm-svn: 11811
2004-02-24 22:06:07 +00:00
Chris Lattner
a9eddae213
Get all instruction definitions
...
llvm-svn: 11706
2004-02-22 06:25:38 +00:00
Chris Lattner
ecc7d6e27a
Adjust to recent changes
...
llvm-svn: 11514
2004-02-17 03:03:47 +00:00
Chris Lattner
04b60fe5ad
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
303ca1e509
By default, llvm.setjmp/llvm.longjmp intrinsics get lowered to their libc counterparts
...
llvm-svn: 11483
2004-02-15 22:24:51 +00:00
Chris Lattner
25530a12a1
Refactor code. Now the intrinsic lowering pass tries to recycle preexisting
...
prototypes, even if they don't precisely match what it would prefer to use.
This fixes: CBackend/2004-02-15-PreexistingExternals.llx compiling it into:
ltmp_0_30 = memcpy(l14_C, 4u, 17);
ltmp_1_30 = memcpy(((int *)l27_A), ((unsigned )(long)l27_B), ((int )123u));
instead of:
ltmp_0_30 = memcpy(l14_C, 4u, 17);
ltmp_1_27 = l43_memcpy(l27_A, l27_B, 123u);
Which does the wrong thing as you could imagine.
llvm-svn: 11481
2004-02-15 22:16:39 +00:00
Chris Lattner
76b2ff4ded
Adjustments to support the new ConstantAggregateZero class
...
llvm-svn: 11474
2004-02-15 05:55:15 +00:00
Chris Lattner
9fba3da879
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
015e821279
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
37a716fa80
Remove dependence on return type of ConstantStruct::get
...
llvm-svn: 11466
2004-02-15 04:07:32 +00:00
Chris Lattner
c75bf528c1
Remove dependence on the return type of ConstantArray::get
...
llvm-svn: 11463
2004-02-15 04:05:58 +00:00
Chris Lattner
5d56c478ba
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
0c48a03374
A target that doesn't support these intrinsics will still meet spec (the
...
intrinsic will always produce zero), but it will behave unexpectedly, so
warn like GCC does.
llvm-svn: 11444
2004-02-14 04:52:06 +00:00
Chris Lattner
dc632111bf
Add llvm.memset/frameaddress/returnaddress intrinsics.
...
llvm-svn: 11431
2004-02-14 02:47:17 +00:00
Chris Lattner
5ed171e317
Add support for the llvm.memmove intrinsic
...
Patch graciously contributed by Reid Spencer!
llvm-svn: 11355
2004-02-12 18:11:20 +00:00
Chris Lattner
17d028d52b
Implement the llvm.memcpy intrinsic
...
llvm-svn: 11349
2004-02-12 17:01:09 +00:00
Chris Lattner
2be4744c5e
Remove obsolete method
...
llvm-svn: 11302
2004-02-11 01:17:33 +00:00
Chris Lattner
54b582f11d
Remove the statistics
...
llvm-svn: 11243
2004-02-09 21:01:23 +00:00
Chris Lattner
478fac37e4
Speed up type resolution some more. On the testcase in PR224, for example,
...
this speeds up a release llvm-as from 21.95s to 11.21s, because before it
would do an expensive traversal of the type-graph of every type resolved.
llvm-svn: 11242
2004-02-09 20:23:44 +00:00
Chris Lattner
aedce9d6b1
Implement the hashing scheme in an attempt to speed up the "slow" case in
...
type resolution. Unfortunately it doesn't help.
Also delete some dead debugging code.
llvm-svn: 11237
2004-02-09 18:32:40 +00:00
Chris Lattner
eecaba0c33
Code cleanup in preparation for later changes. Now that ContainedTy's are
...
consistent across the various type classes, we can factor out a LOT more
almost-identical code. Also, add a couple of temporary statistics.
llvm-svn: 11232
2004-02-09 16:35:14 +00:00
Chris Lattner
cbd34b2ae6
Now that all of the derived types have disciplined interfaces, we can eliminate
...
all of the ad-hoc storage of contained types. This allows getContainedType to
not be virtual, and allows us to entirely delete the TypeIterator class.
llvm-svn: 11230
2004-02-09 05:40:24 +00:00
Chris Lattner
ac6db755c3
Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
...
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
fa829be4d3
Start using the new and improve interface to FunctionType arguments
...
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
2eaf58775e
Two problems with these lines of code:
...
1. The "work" was not in the assert, so it was punishing the optimized release
2. getNamedFunction is _very_ expensive in large programs. It is not designed
to be used like this, and was taking 7% of the execution time of the code
generator on perlbmk.
Since the assert "can never fail", I'm just killing it.
llvm-svn: 11214
2004-02-09 00:59:07 +00:00
Chris Lattner
5b6892e37c
Fix PR215: [bcwriter] Problem compactifying ConstantPointerRefs
...
Have I ever mentioned how much I _hate_ constantpointerrefs?
llvm-svn: 11212
2004-02-09 00:15:41 +00:00
Chris Lattner
85195147e1
vi failed me again. :)
...
llvm-svn: 11206
2004-02-08 21:52:30 +00:00
Chris Lattner
144f0efd4c
Rename the invoke 'except' destination to the 'unwind' destination
...
llvm-svn: 11205
2004-02-08 21:52:04 +00:00
Chris Lattner
fae8ab3088
rename the "exceptional" destination of an invoke instruction to the 'unwind' dest
...
llvm-svn: 11202
2004-02-08 21:44:31 +00:00
Chris Lattner
bb5f0db8d6
Adjust to the new BB ctor
...
llvm-svn: 11113
2004-02-04 03:57:50 +00:00
Chris Lattner
9cda4bf8e5
When splitting a basic block, insert the new half immediately after the first
...
half.
llvm-svn: 11110
2004-02-04 03:21:31 +00:00
Chris Lattner
d8a232b716
If changing a parent, don't add then remove the object from the leak detector
...
llvm-svn: 11106
2004-02-04 01:06:38 +00:00
Chris Lattner
c4c7ea5288
In BasicBlock::splitBasicBlock, just use islist::splice to move the instructions,
...
instead of a loop that is really inefficient with large basic blocks.
This speeds up the inliner pass on the testcase in PR209 from 13.8s to 2.24s
which still isn't exactly speedy, but is a lot better. :)
llvm-svn: 11105
2004-02-03 23:11:21 +00:00
Chris Lattner
bcade4b8e6
Floating point negates are -0.0 - X, not 0.0 - X
...
llvm-svn: 11084
2004-02-02 20:21:29 +00:00
Chris Lattner
ac80ea4970
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
125ed54fdc
Fix a crasher bug in my constant folding rewrite
...
llvm-svn: 11044
2004-02-01 01:23:19 +00:00
Chris Lattner
241ed4c500
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
Misha Brukman
2cbec5de52
Let subclasses implement ModuleProvider::materializeModule() which is based on
...
their implementation of book-keeping for which functions need to be materialized
and which don't.
llvm-svn: 10943
2004-01-21 22:54:50 +00:00
Chris Lattner
c70b3f63cc
SlotCalculator.h moved
...
llvm-svn: 10931
2004-01-20 19:50:34 +00:00
Chris Lattner
083c99e347
Major changes. Now we only compactify individual type planes if it is in
...
fact "profitable" to do so. This makes compactification "free" for small
programs (ie, it is completely disabled) and even helps large programs by
not having to encode pointless compactification planes.
On 176.gcc, this saves 50K from the bytecode file, which is, alas only
a couple percent.
This concludes my head bashing against the bytecode format, at least for
now.
llvm-svn: 10922
2004-01-20 00:57:32 +00:00
Chris Lattner
ca1f8afe85
Add support for building the compactiontable for bytecode files. This shrinks
...
the bytecode file for 176.gcc by about 200K (10%), and 254.gap by about 167K,
a 25% reduction. There is still a lot of room for improvement in the encoding
of the compaction table.
llvm-svn: 10913
2004-01-18 21:07:07 +00:00
Chris Lattner
f78819d9ad
Eliminate special case handling for CPR's
...
Fix some problem cases where I was building the slot calculator in bytecode
writer mode instead of asmwriter mode.
llvm-svn: 10911
2004-01-18 21:03:06 +00:00
Chris Lattner
677af4a1cb
Bytecode format for LLVM 1.2 no longer explicitly encodes zeros in primitive
...
type planes. This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.
llvm-svn: 10908
2004-01-17 23:25:43 +00:00
Chris Lattner
2d0e6f6326
Cleanups & efficiency improvements
...
llvm-svn: 10888
2004-01-15 20:24:09 +00:00
Chris Lattner
21699e8f55
The bcwriter does not want ConstantPointerRef's to be indexed, and the asmwriter never did!
...
llvm-svn: 10885
2004-01-15 18:47:15 +00:00
Chris Lattner
de36304453
When emitting bytecode, handle strings specially. Do not add the characters
...
that make up the strings to the slotcalculator.
llvm-svn: 10862
2004-01-14 23:34:39 +00:00
Chris Lattner
2d6902b4b6
Hrm, apparently I missed lowering this intrinsic. :(
...
llvm-svn: 10858
2004-01-14 20:41:29 +00:00
Chris Lattner
e8701f690f
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
e8dfccaabd
Implement ConstantArray::isString
...
llvm-svn: 10851
2004-01-14 17:06:38 +00:00
Chris Lattner
02062823f7
Fix check. PHI nodes must be handled specially, of course.
...
llvm-svn: 10842
2004-01-14 05:42:52 +00:00
Chris Lattner
ec5089a223
Tighten up verifier checks. The result of an invoke instruction only
...
dominates the normal destination, not the exceptional dest (ie, the result
of a call is undefined on an exception)
llvm-svn: 10841
2004-01-14 04:25:59 +00:00
Chris Lattner
6089bb1f19
The only clients of the slot calculator are now the asmwriter and bcwriter.
...
Since this really only makes sense for these two, change hte instance variable
to reflect whether we are writing a bytecode file or not. This makes it
reasonable to add bcwriter specific stuff to it as necessary.
llvm-svn: 10837
2004-01-14 02:49:34 +00:00
Chris Lattner
061da2f059
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
dab8b6bb50
Implement new Instruction::isRelational method
...
llvm-svn: 10810
2004-01-12 23:18:25 +00:00
Chris Lattner
1dd054c41b
Rearrange and comment code better. No functionality changes
...
llvm-svn: 10808
2004-01-12 22:07:24 +00:00