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
Chris Lattner
40b6a81c43
Work around a bug in GCC where it can't handle common variables marked weak.
...
llvm-svn: 9679
2003-11-03 17:35:00 +00:00
Chris Lattner
8e65bbe451
Fix bugs with attribute weak emission
...
llvm-svn: 9678
2003-11-03 17:32:38 +00:00
Chris Lattner
19a418db92
Implement InstCombine/cast-set.ll:test6[a]. This improves code generated for
...
a hot function in em3d
llvm-svn: 9673
2003-11-03 05:17:03 +00:00
Chris Lattner
41e6298462
This simplifies the CWriter code, makes the generated code easier to read,
...
and makes the output work with the intel compiler. Overall, a win.
llvm-svn: 9671
2003-11-03 04:31:54 +00:00
Chris Lattner
d8c97ff65d
Implement InstCombine/cast-set.ll: test1, test2, test7
...
llvm-svn: 9670
2003-11-03 04:25:02 +00:00
Chris Lattner
01dd059e75
Fix bug with zero sized casts
...
llvm-svn: 9667
2003-11-03 01:29:41 +00:00
Chris Lattner
c92cb7905b
Eliminate the silly namedContext member of printType
...
llvm-svn: 9666
2003-11-03 01:01:59 +00:00
Chris Lattner
a71b07eeca
All DSGraphs keep a reference to the targetdata they are created with. This is
...
used to eliminate the hard coded, hacked in, sparc specific, global TargetData.
Changing the TargetData used to actually match the code fixes problems, and
eliminates a crash.
llvm-svn: 9659
2003-11-02 22:27:28 +00:00
Chris Lattner
63fb5bcaac
Fix bug: test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll
...
llvm-svn: 9658
2003-11-02 21:02:20 +00:00
Chris Lattner
e005f61e9e
Fix bug in previous checkin
...
llvm-svn: 9656
2003-11-02 06:54:48 +00:00
Chris Lattner
a06aa3d2f2
Implement transmogriphication of allocation instructions
...
llvm-svn: 9654
2003-11-02 05:57:39 +00:00
Chris Lattner
d6b4a4c1c9
Fix PR78
...
llvm-svn: 9648
2003-11-02 02:06:27 +00:00
Chris Lattner
4db6e0ea7a
The "correct" fix for CBackend/2003-10-23-UnusedType.ll is to not even try
...
to emit types which are not used.
llvm-svn: 9647
2003-11-02 01:29:27 +00:00
Chris Lattner
29f03b2d39
Including the symbol table in the FindUsedTypes analysis was the WRONG way
...
to fix test/Regression/CBackend/2003-10-23-UnusedType.ll. This completely
neutered the deadtypeelim pass.
llvm-svn: 9646
2003-11-02 01:28:41 +00:00
Chris Lattner
18192fe20c
Strip off CPR's manually, because if we don't, the inliner doesn't delete dead
...
functions. GRR
llvm-svn: 9641
2003-10-31 21:05:58 +00:00
Chris Lattner
9c85e0b72c
Make the call graph more precise despite the hated constantpointerrefs.
...
Do you detect the animosity I feel towards CPRs yet?
llvm-svn: 9640
2003-10-31 21:05:12 +00:00
Chris Lattner
78b09155e1
Did I mention that I _HATE_ CPRs?
...
llvm-svn: 9639
2003-10-31 18:38:06 +00:00
Chris Lattner
18283ea9f0
Constant pointer refs are causing these to fail unnecessarily, which is causing
...
a lot of code to be pessimized. I hate CPRs. :(
llvm-svn: 9635
2003-10-31 17:51:16 +00:00
Alkis Evlogimenos
006108d3b6
Use already existing classes for post order iterator.
...
llvm-svn: 9629
2003-10-31 03:02:34 +00:00
Chris Lattner
c49a7fd37d
Make use of the new AssemblyAnnotationWriter interface
...
llvm-svn: 9619
2003-10-30 23:41:03 +00:00
Brian Gaeke
29d56dd004
Include llvm/CodeGen/MachineCodeForInstruction.h. Use it to start
...
implementing verifySavedState().
In saveState(), use the new AllocInfo::AllocStateTy enum, and increment
Insn each time through the loop.
llvm-svn: 9617
2003-10-30 21:21:33 +00:00
Brian Gaeke
e78feb1c40
Make AllocState an enum.
...
Move the stringifying method for that enum into class AllocInfo.
llvm-svn: 9616
2003-10-30 21:21:22 +00:00
Alkis Evlogimenos
30f4eb0dc0
Output types in reverse postorder. This will allow the ByteCode/Reader
...
to create the minimum number of opaque types for each type with a
cycle in its type graph.
llvm-svn: 9615
2003-10-30 21:04:44 +00:00
Alkis Evlogimenos
9430d79c1f
Put DEBUG_OUTPUT at the top along with TRACE_LEVEL. Also fix the code
...
inside DEBUG_OUTPUT so that it compiles.
llvm-svn: 9614
2003-10-30 18:33:58 +00:00
Chris Lattner
586db4056a
When someone includes CallGraph.h, make sure that they link in CallGraph.cpp
...
llvm-svn: 9611
2003-10-30 05:17:30 +00:00
Chris Lattner
034bfaddf0
Make sure that PHI node operands are first class types
...
llvm-svn: 9607
2003-10-30 01:38:18 +00:00
Chris Lattner
c8ea13f032
Fix bug: 2003-10-29-CallSiteResolve.ll & PR70
...
llvm-svn: 9600
2003-10-30 00:46:41 +00:00
Chris Lattner
f24ae5a0ed
Print the names of more opaque types
...
llvm-svn: 9598
2003-10-30 00:22:33 +00:00
Chris Lattner
a2fcab56e3
Make sure to print opaque types names if they are available.
...
llvm-svn: 9597
2003-10-30 00:12:51 +00:00
Chris Lattner
7c5cf380af
Refactor code, initial implementation of -insert-block-profiling pass
...
llvm-svn: 9593
2003-10-29 21:24:22 +00:00
Brian Gaeke
ee245ddcdf
Explicitly cast type, so we aren't passing output_vbr a size_t.
...
llvm-svn: 9590
2003-10-29 20:09:01 +00:00
Brian Gaeke
0d26a4c53d
Tweak sed commands so that they filter out more # stuff and also
...
work on Mac OS X. Also turn ${...} into $(...); we do not speak BSD
Make.
llvm-svn: 9589
2003-10-29 20:07:35 +00:00
Chris Lattner
cb21ea9a32
Fix PR66 & ScalarRepl/2003-10-29-ArrayProblem.ll
...
llvm-svn: 9585
2003-10-29 17:55:44 +00:00
Chris Lattner
89b33b1999
Fix bug: ConstantMerge/2003-10-28-MergeExternalConstants.ll & PR64
...
llvm-svn: 9579
2003-10-29 06:01:26 +00:00
Brian Gaeke
d6816f603f
In VM::create(), comment out almost the whole function if NO_JITS_ENABLED,
...
because the Arch variable will likely be undefined.
llvm-svn: 9576
2003-10-29 04:24:09 +00:00
Alkis Evlogimenos
81ad09e0ab
Add more debugging info to help tracing the SlotCalculator.
...
llvm-svn: 9575
2003-10-29 03:12:12 +00:00
Chris Lattner
01c0589d69
Check in statistifying patch for Bill
...
llvm-svn: 9572
2003-10-28 23:14:59 +00:00
Chris Lattner
305fcb1536
Fix PR62, and llvm/test/Regression/CBackend/2003-10-28-CastToPtrToStruct.ll
...
ConstantExpr's can use unrelated types, make sure to scan them.
llvm-svn: 9569
2003-10-28 23:09:45 +00:00
Chris Lattner
19e529f0e3
Pass in argc & argv
...
llvm-svn: 9563
2003-10-28 22:42:24 +00:00
Chris Lattner
7e6b286041
Initial checkin of profiling instrumentation pass. So far, despite the
...
file name, we only support function profiling. This will be fixed in the
near future.
llvm-svn: 9547
2003-10-28 18:59:04 +00:00
Chris Lattner
51c13a0c9a
Eliminate using declarations
...
llvm-svn: 9543
2003-10-27 21:44:09 +00:00
Chris Lattner
bbca4bb7a6
Propagating constants to arguments can make other arguments constant. For now
...
do something dumb, and inefficient, but more complete.
llvm-svn: 9542
2003-10-27 21:09:00 +00:00
Chris Lattner
00fed59c28
Fix test: Linker/2003-10-27-LinkOncePromote.ll
...
Fix PR58
llvm-svn: 9530
2003-10-27 16:39:39 +00:00
Chris Lattner
4fb1540128
Get the list of PHI node values before the basic block is split. Also, add
...
PHI node entries for unwind instructions just like for call instructions which
became invokes! This fixes PR57, tested by
Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll
llvm-svn: 9526
2003-10-27 05:33:09 +00:00