Chris Lattner
ccac6e36fb
I can't believe the incompetence of the people I have to deal with around here.
...
These fools don't even wrap code at 80 columns.
Oh wait, _I_ wrote that. That explains a lot!!
llvm-svn: 9999
2003-11-14 16:34:25 +00:00
Chris Lattner
0ba2cec700
Fix PR 110: the constant folding code assumes that if something is not a
...
constant expression, but is of (for example) ubyte type, then it is a
ConstantUInt. This was not true for placeholders.
llvm-svn: 9994
2003-11-14 06:38:46 +00:00
Chris Lattner
34b44fd809
Expose the verifier to opt
...
llvm-svn: 9984
2003-11-13 19:47:29 +00:00
Chris Lattner
fe4e3f7108
Implement feature: InstCombine/2003-11-13-ConstExprCastCall.ll
...
llvm-svn: 9981
2003-11-13 19:17:02 +00:00
Chris Lattner
ca8f3561c2
Trying to get the dsgraph for an external function is bad for DSA's health
...
llvm-svn: 9979
2003-11-13 18:48:11 +00:00
Brian Gaeke
d966bbe9bf
Change LLI's internal representation of va_list to a pointer to the next
...
argument to be returned by va_arg. This allows va_lists to be passed
between different LLVM procedures (though it is unlikely that an LLI
va_list would make sense to an external function, except by chance.)
llvm-svn: 9965
2003-11-13 06:06:01 +00:00
Chris Lattner
88bf4d25a0
Implement the CompleteBU pass
...
llvm-svn: 9964
2003-11-13 05:05:41 +00:00
Chris Lattner
547205d4bc
Minor code cleanup
...
llvm-svn: 9962
2003-11-13 05:04:19 +00:00
Chris Lattner
8508dec429
Disable integer tracking by default
...
llvm-svn: 9960
2003-11-13 03:10:49 +00:00
Chris Lattner
55ad096ff8
Add an initial version of the CompleteBUDataStructures class, which is currently
...
identical to the BU pass, but has an accurate call graph
llvm-svn: 9956
2003-11-13 01:43:00 +00:00
Misha Brukman
1c95e95551
Include the file before we close the llvm namespace.
...
llvm-svn: 9954
2003-11-13 00:23:05 +00:00
Misha Brukman
58f9d30da4
Substantially re-organized this file:
...
* There is now only one pass to print out assembly instead of two
* It is a FunctionPass
* The Module-level printing of globals is now in doFinalization() method of the
FunctionPass
* The code has been reformatted to follow LLVM coding standards
* Some comments, not all, were doxygenified
* Last but not least, the function to create an instance of this pass is also no
longer a method in the UltraSparc class.
llvm-svn: 9953
2003-11-13 00:22:19 +00:00
Misha Brukman
5c858a33cb
The function to create an instance of this pass is no longer a method of
...
the UltraSparc class.
llvm-svn: 9952
2003-11-13 00:19:02 +00:00
Misha Brukman
e3afd442f1
The functions to create new instances of passes are no longer methods in the
...
UltraSparc class. Comments are also doxygen-compatible now.
llvm-svn: 9951
2003-11-13 00:17:20 +00:00
Misha Brukman
aa553825b1
* Put command-line switches in their own namespace
...
* Pass creation functions are no longer in the UltraSparc class
llvm-svn: 9950
2003-11-13 00:16:28 +00:00
Misha Brukman
310200f573
Force a dependency on the .inc file, which must be generated!
...
llvm-svn: 9949
2003-11-13 00:05:09 +00:00
Chris Lattner
b60823472a
Fine-grainify namespaces for this library
...
llvm-svn: 9948
2003-11-12 23:11:14 +00:00
Chris Lattner
95d0b541c1
Add new argument to disable checking
...
llvm-svn: 9922
2003-11-12 17:58:22 +00:00
Chris Lattner
e72202b5b8
Detect problems with PHI node operands!
...
llvm-svn: 9916
2003-11-12 07:13:37 +00:00
Chris Lattner
e73452b42d
Print return nodes for graphs with multiple functions in them correctly
...
llvm-svn: 9914
2003-11-12 04:58:19 +00:00
Chris Lattner
87ad20251a
Don't crash if no gg
...
llvm-svn: 9913
2003-11-12 04:57:58 +00:00
Chris Lattner
be56c11ccc
Fix bug PR107, patch contributed by Reid Spencer!
...
llvm-svn: 9911
2003-11-12 04:40:30 +00:00
Chris Lattner
a08ef02e96
Cleanups
...
llvm-svn: 9907
2003-11-12 00:40:34 +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
Brian Gaeke
ba8e968641
Move IsArchive and IsBytecode here from gccld. Refactor into CheckMagic.
...
llvm-svn: 9901
2003-11-11 21:53:50 +00:00
Chris Lattner
6deb20046e
Compute node offsets correctly
...
llvm-svn: 9895
2003-11-11 20:12:32 +00:00
Brian Gaeke
9384aa95cc
Add implementation of FileOpenable().
...
Refactor MakeFileExecutable() & MakeFileExecutable() into AddPermissionsBits().
llvm-svn: 9892
2003-11-11 18:27:21 +00:00
Chris Lattner
365bda897c
Add new method for computing node mappings. This is used by the pool allocator
...
llvm-svn: 9880
2003-11-11 05:08:59 +00:00
Brian Gaeke
612254327c
Fix problems linking against the reoptimizer; _llvm_regAllocState must have
...
externally-visible linkage, and SaveStateToModule must default to true for llc.
I don't remember why I made it const; perhaps it should be deconstified.
llvm-svn: 9858
2003-11-10 07:12:01 +00:00
Chris Lattner
7dd63c59d1
Reorganize code for locality, improve comments
...
llvm-svn: 9857
2003-11-10 04:42:42 +00:00
Chris Lattner
e0d83d79e4
Adjust to new critical edge interface
...
llvm-svn: 9853
2003-11-10 04:10:50 +00:00
Brian Gaeke
490bf81152
Operand numbers are now ints. Save the register allocation of the value
...
each instruction produces as "operand" -1, and the other operands as 0
.. n, as before. PhyRegAlloc::saveState() is refactored into
PhyRegAlloc::saveStateForValue().
llvm-svn: 9842
2003-11-10 00:05:26 +00:00
Chris Lattner
b63e179816
More additions
...
llvm-svn: 9834
2003-11-09 19:54:30 +00:00
Chris Lattner
f40566184d
Fix PR95. I'm checking this patch in for Reid Spencer, who figured it out
...
and wrote it up. Thanks!!
llvm-svn: 9832
2003-11-09 19:39:48 +00:00
Chris Lattner
95e79d0097
Add an assertion
...
llvm-svn: 9831
2003-11-09 15:51:07 +00:00
Brian Gaeke
d542ca6af1
Fix PR103
...
llvm-svn: 9830
2003-11-09 07:08:34 +00:00
Chris Lattner
953f23925f
Do NOT inline self recursive calls into other functions. This is causing the
...
pool allocator no end of trouble, and doesn't make a lot of sense anyway. This
does not solve the problem with mutually recursive functions, but they are much less common.
llvm-svn: 9828
2003-11-09 05:05:36 +00:00
Chris Lattner
a1040ce57e
Untypo
...
llvm-svn: 9827
2003-11-09 05:04:25 +00:00
Chris Lattner
a3444ad7e0
Add more functions
...
llvm-svn: 9826
2003-11-09 04:10:41 +00:00
Chris Lattner
6e7ff9a44d
None of the __llvm_* functions call into the program. This makes the
...
callgraph MUCH simpler for eh using program.
llvm-svn: 9825
2003-11-09 04:00:59 +00:00
Chris Lattner
e63e580e56
Add support for memmove
...
llvm-svn: 9824
2003-11-09 03:32:52 +00:00
Brian Gaeke
46510fbed5
Remove #include of PassManager.h which was marked FIXME, and apparently is no
...
longer used.
llvm-svn: 9823
2003-11-09 03:15:40 +00:00
Chris Lattner
eb36733092
Handle bzero and memset in the local analysis, because we were missing the fact
...
that memset returns its argument!!
llvm-svn: 9811
2003-11-08 21:55:50 +00:00
Chris Lattner
28d77c2122
This doesn't use DSCallSiteIterator
...
llvm-svn: 9809
2003-11-08 21:17:37 +00:00
Brian Gaeke
5159888ea4
Fix two typos I found in comments.
...
llvm-svn: 9806
2003-11-08 18:12:24 +00:00
Misha Brukman
feb806084d
For some reason, LICM and GCSE like to crash the FunctionPassManager when they
...
are being added as FunctionPasses... Sigh.
llvm-svn: 9798
2003-11-08 00:01:39 +00:00
Brian Gaeke
d246e0be30
Implement vaarg instruction. This is not quite perfect: 2003-08-11-VaListArg
...
still causes a crash. But it's better than before.
llvm-svn: 9794
2003-11-07 21:20:47 +00:00
Misha Brukman
9ddec59660
Implement branching to a PC-relative constant (not a BasicBlock).
...
llvm-svn: 9793
2003-11-07 21:07:30 +00:00
Brian Gaeke
22bfc41ae1
popStackAndReturnValueToCaller() must advance instruction pointer to normal
...
destination, if returning from an invoke.
Implement 'unwind' instruction.
llvm-svn: 9792
2003-11-07 20:44:58 +00:00
Misha Brukman
fbd3f16961
PreSelection is not optional, it performs a necessary and vital transformation
...
for the Sparc backend: breaking up constant expressions. Thus, we cannot have it
guarded by a conditional, it should never be disabled.
Also, it's now available for the JIT since it is a FunctionPass.
llvm-svn: 9791
2003-11-07 20:33:25 +00:00
Misha Brukman
4b82908055
Remove the *BIG UGLY HACK* from the JIT: PreSelection is now a FunctionPass.
...
llvm-svn: 9790
2003-11-07 20:32:08 +00:00
Brian Gaeke
88a4c1b68b
Add stub version of unwind support
...
llvm-svn: 9789
2003-11-07 20:07:06 +00:00
Brian Gaeke
059af2222a
visitCallInst --> visitCallSite.
...
Use visitCallSite to implement both CallInsts and InvokeInsts.
llvm-svn: 9788
2003-11-07 20:04:22 +00:00
Brian Gaeke
f7f7310b47
Make the operation of visitCallInst() only depend on the CallSite.
...
llvm-svn: 9787
2003-11-07 19:59:08 +00:00
Brian Gaeke
29d6325ca3
Use CallSites for call sites, instead of CallInsts. A revolutionary concept.
...
llvm-svn: 9784
2003-11-07 19:26:23 +00:00
Misha Brukman
d04d2ef54d
Switch to emitting MachineConstantPool the way it was meant to be done.
...
llvm-svn: 9777
2003-11-07 18:06:26 +00:00
Misha Brukman
8fe318a705
Switch to using the standard representation of the constant pool -- namely, the
...
MachineConstantPool. This involved refactoring the two classes involved in
printing out Sparc assembly. In fact, they should share all this code anyway.
llvm-svn: 9776
2003-11-07 17:45:28 +00:00
Misha Brukman
3f43ed6586
We accept TargetMachine as a const reference.
...
llvm-svn: 9775
2003-11-07 17:44:18 +00:00
Misha Brukman
c866cfb251
PreSelection and PeepholeOpts are now FunctionPasses.
...
llvm-svn: 9774
2003-11-07 17:43:43 +00:00
Misha Brukman
1c726348d1
* Stop making a global for each constant that cannot live in an instruction;
...
it will be converted to a MachineConstantPool index during instruction
selection
* This is now eligible to become a FunctionPass since it does not have any side
effects outside of the function it is processing.
llvm-svn: 9773
2003-11-07 17:31:22 +00:00
Misha Brukman
575a02e8db
* Use the MachineConstantPool for storing constants instead of a hash_set;
...
* Do not create new globals for constants!
Also, order #includes as per coding style guide
llvm-svn: 9772
2003-11-07 17:29:48 +00:00
Misha Brukman
ccdf8e85e0
Use basename $<
to get just the filename, not full path, for ease of reading.
...
llvm-svn: 9770
2003-11-07 17:26:27 +00:00
Misha Brukman
acc53cc7c6
Declare FunctionPasses as such so that they can be used in FunctionPassManager.
...
llvm-svn: 9768
2003-11-07 17:20:18 +00:00
Brian Gaeke
252fd99794
Refactor the return-from-function code into popStackAndReturnValueToCaller().
...
Make external function calls slightly less special; now they get a stack frame.
llvm-svn: 9765
2003-11-07 05:22:49 +00:00
Chris Lattner
8f8109ebdb
Hopefully this will fix PR98
...
llvm-svn: 9762
2003-11-07 00:38:09 +00:00
Chris Lattner
ca7a346fce
Hopefully fix the objdir != srcdir issue
...
llvm-svn: 9761
2003-11-07 00:34:33 +00:00
Chris Lattner
e060df5b2c
Fix warnings building on sparc
...
llvm-svn: 9758
2003-11-06 21:30:05 +00:00
Chris Lattner
8e2385eb4d
Various cleanups and efficiency improvements
...
llvm-svn: 9753
2003-11-06 19:46:29 +00:00
Chris Lattner
8321e79ea6
Fix bug: PR93
...
llvm-svn: 9752
2003-11-06 19:18:49 +00:00
Misha Brukman
de3f241f5f
* Make the comment header 80 columns long
...
* Alphabetize #includes
llvm-svn: 9751
2003-11-06 18:06:13 +00:00
Misha Brukman
6667a74caf
Let's not forget about our friends -- Constant Pool indices.
...
llvm-svn: 9750
2003-11-06 00:04:11 +00:00
Chris Lattner
58016b49ef
Fix the problem with running cleanups in bugpoint: We were deleting arguments
...
of intrinsic functions, causing the verifier to fail.
llvm-svn: 9745
2003-11-05 21:53:41 +00:00
Chris Lattner
f7304f3379
Split behavior into two pieces
...
llvm-svn: 9741
2003-11-05 21:43:02 +00:00
Chris Lattner
a8d3699eb3
Yet more fixes for constant expr shifts
...
llvm-svn: 9739
2003-11-05 20:43:58 +00:00
Chris Lattner
dba798775b
Further fixes for PR93
...
llvm-svn: 9738
2003-11-05 20:37:01 +00:00
Chris Lattner
2df84a62cd
no need for endl
...
llvm-svn: 9736
2003-11-05 19:53:32 +00:00
Chris Lattner
352ad83271
Add support for constant expr shifts
...
llvm-svn: 9735
2003-11-05 19:53:03 +00:00
Chris Lattner
530eb1ffb5
If we're not checking, don't check!
...
llvm-svn: 9732
2003-11-05 19:09:40 +00:00
Chris Lattner
9b9fdd0f17
Fix flawed logic that was breaking several SPEC benchmarks, including gzip and crafty.
...
llvm-svn: 9731
2003-11-05 17:31:36 +00:00
Misha Brukman
c7c4e197fc
We know exactly what the value of $< is, so instead of using basename $<
to
...
get just the filename and not the full path, just use the filename directly.
llvm-svn: 9730
2003-11-05 06:43:36 +00:00
Chris Lattner
1370c57a42
Do not use a class before it is defined.
...
Be gcc 3.4 clean
llvm-svn: 9727
2003-11-05 06:25:06 +00:00
Chris Lattner
3099f615fa
Be friendly to gcc 3.4... good compiler. Nice compiler.
...
llvm-svn: 9726
2003-11-05 06:20:27 +00:00
Chris Lattner
f7a909f914
Be gcc 3.4 clean
...
llvm-svn: 9725
2003-11-05 06:12:18 +00:00
Chris Lattner
b5a2959ef2
Fix name collision
...
llvm-svn: 9722
2003-11-05 05:55:45 +00:00
Chris Lattner
e0249593df
Make code gcc 3.4 clean
...
llvm-svn: 9719
2003-11-05 05:15:42 +00:00
Brian Gaeke
ee15c93eda
Abort when the user program calls abort, instead of printing a funny message and calling exit(1).
...
llvm-svn: 9716
2003-11-05 01:18:49 +00:00
Chris Lattner
fd8ec07a8e
Fix bug with previous implementation:
...
- // ~(c-X) == X-(c-1) == X+(-c+1)
+ // ~(c-X) == X-c-1 == X+(-c-1)
Implement: C - ~X == X + (1+C)
llvm-svn: 9715
2003-11-05 01:06:05 +00:00
Brian Gaeke
251ac27789
Use regular old malloc to emulate malloc/alloca instructions.
...
llvm-svn: 9713
2003-11-05 01:02:14 +00:00
Brian Gaeke
246426591b
Remove a comment which no longer applies.
...
llvm-svn: 9712
2003-11-05 00:59:28 +00:00
Chris Lattner
ac2e4e15dd
Minor cleanup, plus implement InstCombine/xor.ll:test17
...
llvm-svn: 9711
2003-11-04 23:50:51 +00:00
Chris Lattner
a309338bd4
Implement InstCombine/xor.ll:test(15|16)
...
llvm-svn: 9708
2003-11-04 23:37:10 +00:00
Alkis Evlogimenos
c6a7c83333
Change all machine basic block modifier functions in MRegisterInfo to
...
return the number of instructions added to/removed from the basic block
passed as their first argument.
Note: This is only needed because we use a std::vector instead of an
ilist to keep MachineBasicBlock instructions. Inserting an instruction
to a MachineBasicBlock invalidates all iterators to the basic
block. The return value can be used to update an index to the machine
basic block instruction vector and circumvent the iterator elimination
problem but this is really not needed if we move to a better
representation.
llvm-svn: 9704
2003-11-04 22:57:09 +00:00
Brian Gaeke
8dadbe31dc
Update verifySavedState()'s comment, so that it reflects its current
...
status. In doFinalization(), skip over external functions, just like
Anand's mapping info does.
llvm-svn: 9703
2003-11-04 22:42:41 +00:00
Brian Gaeke
f641ebe313
Add comments.
...
llvm-svn: 9697
2003-11-04 18:25:56 +00:00
Chris Lattner
c4cfc20335
Fix problems in previous changes. This fixes several regressions last night.
...
llvm-svn: 9694
2003-11-04 16:04:32 +00:00
John Criswell
3e30e40801
Checking in Chris's suggestions:
...
Added assert() to ensure symbol table is well formed.
Added code to remember the value that was found; resolving types can change
the symbol table and invalidate the value of the iterator.
Added comments to the ResolveTypes() function (mainly for my own benefit).
Please feel free to correct the comments if they are not accurate.
llvm-svn: 9693
2003-11-04 15:22:26 +00:00
Chris Lattner
414e572f11
Significantly simplify constant emission by unifying the stuff which used to build up
...
strings with the stuff that used to print to an ostream directly. We now NEVER build
up big strings, only to print them once they are formed.
llvm-svn: 9686
2003-11-03 20:19:49 +00:00
Chris Lattner
f100e90240
Incorporate printSingleConstantValue into its single caller
...
llvm-svn: 9684
2003-11-03 19:44:05 +00:00
Chris Lattner
2943114bfd
* Reformat some code
...
* Emit bools as 1/0 instead of true/false, fixing compilation of eon and
PR 83 & Jello/2003-11-03-GlobalBool.llx
llvm-svn: 9683
2003-11-03 19:33:45 +00:00
Chris Lattner
8a01e11594
Fix InstCombine/2003-11-03-VarargsCallBug.ll
...
llvm-svn: 9681
2003-11-03 18:44:58 +00:00