Misha Brukman
e5a8dcc695
Start allocating stack space at [ebp-4] to not overwrite the return address.
...
Also make all loads & stores 4-byte aligned for performance. ;)
llvm-svn: 4982
2002-12-13 04:34:02 +00:00
Misha Brukman
20c9c61c6d
Moves now select correct opcode based on the data size.
...
llvm-svn: 4981
2002-12-13 04:24:53 +00:00
Chris Lattner
10f305cec7
Remove extranous #include
...
llvm-svn: 4980
2002-12-13 04:12:24 +00:00
Chris Lattner
723ca2522d
Rename MemArg* to Arg*
...
llvm-svn: 4979
2002-12-13 03:51:55 +00:00
Chris Lattner
b698cd8236
Make mem size an assert
...
Add mem size flags to all instructions using an imm
llvm-svn: 4978
2002-12-13 03:50:13 +00:00
Misha Brukman
6a5788bb6f
This is supposed to provide correct size for datatypes. Supposedly.
...
llvm-svn: 4977
2002-12-13 02:13:15 +00:00
Misha Brukman
12bec4ecef
Take advantage of our knowledge of 2-address X86 instructions and
...
register-allocated them appropriately.
llvm-svn: 4976
2002-12-12 23:20:31 +00:00
Misha Brukman
bf2857eb5c
Added the flag to mark instructions which are really 2-address instructions in
...
X86, but would be 3-address in any normail architecture.
llvm-svn: 4974
2002-12-12 23:19:11 +00:00
Brian Gaeke
9b38597288
This checkin is brought to you by the brian gaeke allnighter fund.
...
(lib/Target/X86) InstSelectSimple.cpp:
Include llvm/DerivedTypes.h and iostream.
Refactor visitMul out into a wrapper around doMultiply(), so that we
can do multiplications on temporary values when we are doing
getelementptrs.
Refactor part of getReg out into makeAnotherReg, so that we can create
registers willy-nilly to hold temporary values, when we are doing
getelementptrs.
Add stub implementations of visitMallocInst and visitAllocaInst.
Add initial implementation of visitGetElementPtrInst.
In copyConstantToRegister:
We throw a *lot* of our asserts here. So, when we want to throw an
assert, print out to stderr whatever expr or whatever constant made
us barf.
Support copying ConstantPointerNull to register, using a move immediate
of zero.
Rename FLDr4 and FLDr8 to FLDr32 and FLDr64, so that they match the meanings
of the numbers in the other instruction names. All uses modified.
Teach visitCallInst to extract byte- and short-class return values
from subregs of EAX. Add a FIXME note about how we would do it for
float-class return values.
Add a FIXME note about how we would cast float to int and back.
X86InstrInfo.def:
Rename FLDr4 and FLDr8 to FLDr32 and FLDr64, so that they match the meanings
of the numbers in the other instruction names. All uses modified.
(tools/jello) GlobalVars.cpp:
Include iostream.
If we have to emit a floating-point constant to memory, gamble and use
the same method as for ints.
If we have to emit a ConstantPointerNull to memory, try using a "void *"
and "NULL".
Otherwise, if we are going to throw an assert, print out whatever constant
made us barf, first.
llvm-svn: 4973
2002-12-12 15:33:40 +00:00
Misha Brukman
1264a03c8a
'graph' is spelled without a 'c'.
...
Also added Statistic counters for NoAlias and MayAlias.
llvm-svn: 4972
2002-12-12 05:34:10 +00:00
Chris Lattner
8d4b4b020e
Remove #includes
...
llvm-svn: 4968
2002-12-12 03:47:27 +00:00
Vikram S. Adve
6c46fba526
External routines used to identify Cilk operations inserted by the
...
parallelization pass.
llvm-svn: 4965
2002-12-10 13:08:48 +00:00
Vikram S. Adve
a9966ae8ad
This file implements the function DemoteRegToStack(), which takes a
...
virtual register computed by an Instruction& X and replaces it with
a slot in the stack frame, allocated via alloca.
llvm-svn: 4964
2002-12-10 13:07:58 +00:00
Vikram S. Adve
849346ee23
This file implements a pass that automatically parallelizes a program,
...
using the Cilk multi-threaded runtime system to execute parallel code.
The current version inserts too many sync() operations in the program
because it does not attempt to optimize their placement.
llvm-svn: 4962
2002-12-10 00:43:34 +00:00
Vikram S. Adve
c9617fde54
Iterator that enumerates the ProgramDependenceGraph (PDG) for a function,
...
i.e., enumerates all data and control dependences for the function.
llvm-svn: 4958
2002-12-08 14:13:19 +00:00
Vikram S. Adve
90bc3110b6
An explicit representation of dependence graphs, and a pass that
...
computes a dependence graph for data dependences on memory locations
using interprocedural Mod/Ref information.
llvm-svn: 4957
2002-12-08 13:26:29 +00:00
Chris Lattner
883827db1c
Namespacify more
...
llvm-svn: 4956
2002-12-08 06:01:34 +00:00
Chris Lattner
f525e2f95e
Add support to count the number of dynamic instructions executed by LLI
...
llvm-svn: 4955
2002-12-08 05:51:08 +00:00
Chris Lattner
5f4d7d2801
Add total instruction, bb, & function counts
...
llvm-svn: 4954
2002-12-07 23:24:24 +00:00
Chris Lattner
fc15b7a661
Fix bug that was bugging bugpoint
...
llvm-svn: 4953
2002-12-07 21:27:16 +00:00
Chris Lattner
be53e88459
Remove dead code
...
llvm-svn: 4952
2002-12-07 18:42:13 +00:00
Vikram S. Adve
773fe59c79
Two bug fixes:
...
(1) Make entries for Constant values in the ScalarMap.
(2) Set MOD bit for the node pointed to by the
argument of a free instruction.
llvm-svn: 4948
2002-12-06 21:17:10 +00:00
Vikram S. Adve
cb7daf77e8
Fix several related bugs in DSNode::mergeWith() caused by the
...
fact that the incoming nodes may be merged away at intermediate
steps. Use an extra level of indirection via DSNodeHandles
to track the nodes being merged. All this now happens in a
static helper function MergeNodes().
llvm-svn: 4947
2002-12-06 21:15:21 +00:00
Brian Gaeke
250d5a3e95
Implement a lot of cast functionality (no FP or 64)
...
llvm-svn: 4944
2002-12-06 10:49:33 +00:00
Chris Lattner
6c9d57c590
Fix bug: 2002-12-05-MissedConstProp.ll pointed out by Casey Carter
...
llvm-svn: 4935
2002-12-05 22:41:53 +00:00
Vikram S. Adve
ab3a68a7c3
Cute bug fix: when moving links from N to this, some links could have
...
been missed if node *this got merged away due to recursive merging!
Also, links were not moved correctly if a node is collapsed.
llvm-svn: 4933
2002-12-05 17:17:26 +00:00
Brian Gaeke
dbc34a2a95
Target/X86/Printer.cpp: Add sizePtr function, and use it instead of
...
" <SIZE> PTR " string when emitting assembly.
Target/X86/X86InstrInfo.def: Tidy up a bit:
Squashed everything down to 118 chars wide, wrapping lines so that
comment is at the same point on each line. Rename "NoImpRegs" as
"NoIR". (most instructions have NoImpRegs twice on a line, so this
saves 10 columns).
Also, annotate various instructions with flags for size of memory operand.
(MemArg16, MemArg32, MemArg64, etc.)
Target/X86/X86InstrInfo.h: Define flags for size of memory operand.
(MemArg16, MemArg32, MemArg64, etc.)
llvm-svn: 4932
2002-12-05 08:30:40 +00:00
Misha Brukman
8f56246d62
Added code generation for function prologues and epilogues.
...
llvm-svn: 4930
2002-12-04 23:58:08 +00:00
Misha Brukman
7dc6877ce2
Implemented functions for emitting prologues and epilogues;
...
removed EBP from the list of callee-saved registers (it isn't one).
llvm-svn: 4929
2002-12-04 23:57:03 +00:00
Misha Brukman
e93c7f9d32
Added push and pop instructions.
...
llvm-svn: 4928
2002-12-04 23:56:26 +00:00
Chris Lattner
70aa4e41ce
Fix handling of function calls that return void
...
llvm-svn: 4925
2002-12-04 23:50:28 +00:00
Chris Lattner
b71d7b4dab
Implement initial support for return values from call instructions
...
llvm-svn: 4924
2002-12-04 23:45:28 +00:00
Misha Brukman
566bac5ec1
Fun arithmetic with iterators aimed at fixing a bug: inserting instructions
...
after the *current* instruction while keeping the iterator in the same
'logical' place.
llvm-svn: 4923
2002-12-04 19:24:45 +00:00
Misha Brukman
f8634130dc
Adjust the stack pointer after a function call, proportional to the number of
...
arguments pushed onto the stack.
llvm-svn: 4922
2002-12-04 19:22:53 +00:00
Misha Brukman
cf80ad35f3
Added instructions to add/subtract imm32 to/from a reg32.
...
llvm-svn: 4921
2002-12-04 19:15:22 +00:00
Chris Lattner
96edaabdb2
Fix bogus assertion failures
...
llvm-svn: 4919
2002-12-04 17:32:52 +00:00
Chris Lattner
b538ae0dba
Avoid bad assertion
...
llvm-svn: 4918
2002-12-04 17:28:40 +00:00
Chris Lattner
feeb16616e
Remove think-o assertion
...
llvm-svn: 4917
2002-12-04 17:18:30 +00:00
Chris Lattner
e21cfc9b6c
Avoid crashing on Arguments, just silently miscompile
...
llvm-svn: 4916
2002-12-04 17:15:34 +00:00
Misha Brukman
101076f586
storeReg2RegOffset() and loadRegOffset2Reg() now take the iterator by value
...
instead of by reference, since they return the modified iterator.
llvm-svn: 4914
2002-12-04 17:14:13 +00:00
Misha Brukman
6e1c4851ea
Moved buildReg2RegClassMap() into from X86RegisterInfo to MRegisterInfo, since
...
it is target-independent.
llvm-svn: 4911
2002-12-04 16:47:04 +00:00
Chris Lattner
29f4c79239
Add a "Lazy Function Resolution in Jello" section
...
Remove some todo's
llvm-svn: 4910
2002-12-04 16:12:54 +00:00
Chris Lattner
6c1a85e870
Fix a bug I introduced in a previous change
...
llvm-svn: 4909
2002-12-04 06:56:56 +00:00
Chris Lattner
73ac28801e
Add support for referencing global variables/functions
...
llvm-svn: 4907
2002-12-04 06:45:19 +00:00
Chris Lattner
994984de43
Print out direct global references
...
llvm-svn: 4906
2002-12-04 06:44:41 +00:00
Misha Brukman
f13126a427
This should fix the bug seen with some registers not being allocated
...
correctly: skipping instructions by incorrectly incrementing the pointer.
Also adds support for building a reg-to-regclass map, and splits the function
for saving register to stack into two, one suitable for virtual registers
(which also assigns it a physical register) and one for simply storing back
physical registers.
llvm-svn: 4898
2002-12-03 23:15:19 +00:00
Misha Brukman
5639a6279e
Added support for callee- and caller-save registers.
...
llvm-svn: 4897
2002-12-03 23:11:21 +00:00
Chris Lattner
8cadeb99ab
Fix broken ret opcode, grr...
...
llvm-svn: 4895
2002-12-03 22:50:02 +00:00
Chris Lattner
47478b4dce
Checkin debug implementation of MCE
...
llvm-svn: 4893
2002-12-03 20:56:42 +00:00
Chris Lattner
a31be4e958
Fix instsel for calls
...
llvm-svn: 4891
2002-12-03 20:30:12 +00:00
Chris Lattner
18b9a192e1
Simplify code
...
llvm-svn: 4886
2002-12-03 19:40:16 +00:00
Chris Lattner
dd9d97436d
Fix big bug introduced with symbol table changes
...
llvm-svn: 4885
2002-12-03 18:32:30 +00:00
Chris Lattner
5629544811
Fix the build
...
llvm-svn: 4884
2002-12-03 18:15:59 +00:00
Brian Gaeke
c850694f49
brg
...
Add support for cast ... to bool in visitCastInst (it's a start, anyways...)
llvm-svn: 4883
2002-12-03 07:36:03 +00:00
Chris Lattner
5f0614914e
Split the machine code emitter completely out of the printer
...
llvm-svn: 4882
2002-12-03 06:34:06 +00:00
Chris Lattner
99e7784512
* Move information about Implicit Defs/Uses into X86InstrInfo.def.
...
* Expose information about implicit defs/uses of register through the
MachineInstrInfo.h file.
llvm-svn: 4877
2002-12-03 05:42:53 +00:00
Chris Lattner
56c48a37a8
Initialize implicit uses/defs fields for sparc backend to empty list
...
llvm-svn: 4876
2002-12-03 05:41:54 +00:00
Brian Gaeke
48759a6af9
brg
...
X86Implicit.cpp, X86Implicit.h: New files.
InstSelectSimple.cpp: Add some clarifications in visitCallInst comments.
llvm-svn: 4874
2002-12-03 00:51:09 +00:00
Chris Lattner
e66d3e90ce
More support for machine code emission: raw instructions
...
llvm-svn: 4872
2002-12-02 21:56:18 +00:00
Chris Lattner
c1d0d21002
Expose explicit type
...
llvm-svn: 4871
2002-12-02 21:50:41 +00:00
Chris Lattner
f48a330fd8
Start implementing MachineCodeEmitter
...
llvm-svn: 4870
2002-12-02 21:44:34 +00:00
Chris Lattner
cd65711437
Eliminate OtherFrm
...
llvm-svn: 4868
2002-12-02 21:40:58 +00:00
Chris Lattner
e8640c05cc
Remove comment
...
Remove handling of OtherFrm
llvm-svn: 4867
2002-12-02 21:40:46 +00:00
Chris Lattner
8227eea4fe
Initial support for machine code emission
...
llvm-svn: 4866
2002-12-02 21:24:12 +00:00
Misha Brukman
cbaebd813a
Ignore generated files Lexer.cpp and llvmAsmParser.*
...
llvm-svn: 4861
2002-12-02 21:14:54 +00:00
Misha Brukman
f776547336
* Abstracted out stack space allocation into its own function
...
* Added saving of register values to the stack
llvm-svn: 4858
2002-12-02 21:11:58 +00:00
Misha Brukman
0b310e3359
Fix order of operands on a store from reg to [reg+offset].
...
llvm-svn: 4857
2002-12-02 21:10:35 +00:00
Chris Lattner
89de3f1fc5
Add rawfrm flags
...
llvm-svn: 4841
2002-12-01 23:25:59 +00:00
Chris Lattner
d7ae75d381
Don't add implicit regs
...
llvm-svn: 4840
2002-12-01 23:24:58 +00:00
Brian Gaeke
1700fefdeb
brg
...
InstSelectSimple.cpp: Refactor out conversion of byte, short -> int
from visitReturnInst() to new method, promote32().
Use it in both visitReturnInst() and visitCallInst().
llvm-svn: 4839
2002-11-30 11:57:28 +00:00
Brian Gaeke
b6fc905124
brg
...
InstSelectSimple.cpp: First draft of visitCallInst method, handling
int/float args.
X86InstrInfo.def: Add entries for CALL with 32-bit pc relative arg, and
PUSH with 32-bit reg arg.
llvm-svn: 4838
2002-11-29 12:01:58 +00:00
Vikram S. Adve
b0371788d9
Fix logical error in TD pass: we should clear Mod/Ref bits of each caller
...
before inlining their graphs into a function. To support this,
added flags to CloneFlags to strip/keep Mod/Ref bits.
llvm-svn: 4836
2002-11-27 17:41:13 +00:00
Vikram S. Adve
8788221a72
(1) Bug fix that was causing nodes with dangling references to be freed.
...
We run removeDeadNodes() on the TD graph up front before using it.
(2) Major enhancement to printing of results: now we list the actual objects
that are mod/ref instead of just printing the bit vectors.
Also an important bug fix in TDDataStructures pass (no change here):
clear Mod/Ref bits of callers before inlining into a function.
llvm-svn: 4833
2002-11-27 17:37:46 +00:00
Brian Gaeke
d944e15946
brg
...
InstSelectSimple.cpp: Add some comments that say what I'm going to do for
calls and casts.
llvm-svn: 4832
2002-11-26 10:43:30 +00:00
Vikram S. Adve
7bbda247e2
Keep global nodes in each DS Graph (by forcing them to be marked live).
...
llvm-svn: 4831
2002-11-25 18:21:25 +00:00
Misha Brukman
3ba057b8c4
Oops. Got the MOVrm and MOVmr mixed up. Fixed. We can now print out
...
instructions correctly.
llvm-svn: 4830
2002-11-22 23:15:27 +00:00
Misha Brukman
a301022017
Enable the register allocator pass.
...
llvm-svn: 4829
2002-11-22 22:45:07 +00:00
Misha Brukman
021bf57248
A simple (spilling) register allocator.
...
llvm-svn: 4828
2002-11-22 22:44:32 +00:00
Misha Brukman
02c0acabb9
Added methods to read/write values to stack in .h, fixed implementation in
...
.cpp to return the iterator correctly.
llvm-svn: 4827
2002-11-22 22:43:47 +00:00
Misha Brukman
23d923ff18
Added -*- C++ -*- mode to the comments.
...
llvm-svn: 4826
2002-11-22 22:42:50 +00:00
Misha Brukman
e43fe85591
Add a simple way to add memory locations of format [reg+offset]
...
llvm-svn: 4825
2002-11-22 22:42:12 +00:00
Brian Gaeke
2d771c7b5f
lib/Target/X86/InstSelectSimple.cpp: Add visitCallInst, visitCastInst.
...
llvm-svn: 4821
2002-11-22 11:07:01 +00:00
Chris Lattner
fe85dd13d2
Handle cmp Reg, 0 correctly
...
llvm-svn: 4819
2002-11-21 23:30:00 +00:00
Chris Lattner
6021c0d120
Printing support for more stuff
...
llvm-svn: 4818
2002-11-21 22:49:46 +00:00
Chris Lattner
a147d38780
Don't add implicit operands
...
llvm-svn: 4817
2002-11-21 22:49:20 +00:00
Chris Lattner
de36dd3a36
Fix off by one bug
...
llvm-svn: 4816
2002-11-21 22:48:15 +00:00
Chris Lattner
de6d53e549
Add fixme
...
llvm-svn: 4815
2002-11-21 22:48:01 +00:00
Chris Lattner
93c5c3ff44
Minor code cleanups
...
llvm-svn: 4814
2002-11-21 21:04:50 +00:00
Chris Lattner
af8c29b47d
Implement printing of store instructions
...
llvm-svn: 4813
2002-11-21 21:03:39 +00:00
Chris Lattner
918179475a
The big change here is to handle printing/emission of X86II::MRMSrcMem
...
instructions. Right now the only users are load instructions, and Misha's
spill code
llvm-svn: 4812
2002-11-21 20:44:15 +00:00
Chris Lattner
2112a6d7b8
Remove implicit information from instruction selector
...
llvm-svn: 4811
2002-11-21 18:54:29 +00:00
Chris Lattner
c9e824d750
Add printing information for MUL and DIV
...
llvm-svn: 4810
2002-11-21 18:54:14 +00:00
Chris Lattner
d2207d5464
Fix a bug that prevented compilation of multiple functions
...
llvm-svn: 4809
2002-11-21 17:26:58 +00:00
Chris Lattner
fab5468d86
Remove opcode information for instructions that are completely defined now
...
llvm-svn: 4805
2002-11-21 17:12:55 +00:00
Chris Lattner
d432d2f75e
Add printing support for sahf & setcc
...
llvm-svn: 4804
2002-11-21 17:10:57 +00:00
Chris Lattner
766d0da035
Add printing support for /0 /1 type instructions
...
llvm-svn: 4803
2002-11-21 17:09:01 +00:00
Chris Lattner
9f9d6aef08
Add support for /0 /1, etc type instructions
...
llvm-svn: 4802
2002-11-21 17:08:49 +00:00
Chris Lattner
5a5648e935
User defined operators are not supposed to live beyond the lifetime of the
...
pass. Detect and flag them.
llvm-svn: 4801
2002-11-21 16:54:22 +00:00
Chris Lattner
b1b5855551
Rename the SetCC X86 instructions to reflect the fact that they are the
...
register versions
llvm-svn: 4800
2002-11-21 16:19:42 +00:00
Chris Lattner
d6236d8100
Simplify setcc code a bit
...
llvm-svn: 4799
2002-11-21 15:52:38 +00:00
Chris Lattner
2f9488d131
Support Registers of the form (B8+ rd) for example
...
llvm-svn: 4798
2002-11-21 02:00:20 +00:00
Chris Lattner
32bfb6a115
Dont' set flags
...
llvm-svn: 4797
2002-11-21 01:59:50 +00:00
Chris Lattner
aa8aa73902
Implement printing more, implement opcode output more
...
llvm-svn: 4796
2002-11-21 01:33:44 +00:00
Chris Lattner
53a9c9aac6
Huge diff do to reindeinting comments.
...
Basically just adds OpSize flags for instructions that need them.
llvm-svn: 4795
2002-11-21 01:33:28 +00:00
Chris Lattner
92a3c2c77d
Add new prefix flag
...
llvm-svn: 4794
2002-11-21 01:32:55 +00:00
Chris Lattner
228180c2ae
Print another class of instructions correctly, giving us: xorl EDX, EDX
...
for example.
llvm-svn: 4793
2002-11-21 00:30:01 +00:00
Misha Brukman
5d89dbcf41
Booleans are types too. And they get stored in bytes. And InstructionSelection
...
doesn't assert fail. And everyone's happy. Yay!
llvm-svn: 4792
2002-11-21 00:25:56 +00:00
Chris Lattner
6aa0ec26d5
Initial checkin of Module cloning support stuff
...
llvm-svn: 4788
2002-11-20 20:47:41 +00:00
Chris Lattner
26052792dd
X86 target builds fine now
...
llvm-svn: 4786
2002-11-20 20:17:03 +00:00
Chris Lattner
58944216ff
Fix symbol table problem
...
llvm-svn: 4785
2002-11-20 19:32:43 +00:00
Misha Brukman
96283090dc
Add definitions for function headers from MRegisterInfo.h:
...
Some functions are in X86RegisterInfo.cpp, others, because of the data they
need, are in X86RegisterClasses.cpp, which also defines some register classes:
byte, short, and int.
llvm-svn: 4784
2002-11-20 18:59:43 +00:00
Misha Brukman
42f51b24e1
Check not only for MO_VirtualRegister, but MO_MachineRegister as well when
...
printing out assembly. After all, we want the real thing too.
llvm-svn: 4783
2002-11-20 18:56:41 +00:00
Misha Brukman
2bf32bfea1
Initialize the SSARegMap.
...
llvm-svn: 4782
2002-11-20 18:55:27 +00:00
Chris Lattner
2f7f21cd13
Don't build X86 target yet
...
llvm-svn: 4780
2002-11-20 18:37:37 +00:00
Chris Lattner
b5027095e5
- Eliminated the deferred symbol table stuff in Module & Function, it really
...
wasn't an optimization and it was causing lots of bugs.
llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner
ec0df74910
Fix minor bugs
...
llvm-svn: 4778
2002-11-20 18:32:31 +00:00
Chris Lattner
46b6e30fef
Eliminate the concept of a deferred symbol table. The optimization really isn't,
...
and it causes obscure bugs to show up in passes.
llvm-svn: 4777
2002-11-20 18:07:48 +00:00
Misha Brukman
505ca2e419
Add mapping in MachineFunction from SSA regs to Register Classes. Also,
...
uncovered a bug where registers were not being put in a map if they were not
found...
llvm-svn: 4776
2002-11-20 00:58:23 +00:00
Misha Brukman
8d3bef2e1b
Sigh. Fixed some speling.
...
llvm-svn: 4775
2002-11-20 00:56:42 +00:00
Misha Brukman
00d8343760
Thanks to the R8, R16, and R32 macros, I can now deal with registers that
...
belong to different register classes easier.
llvm-svn: 4773
2002-11-20 00:47:40 +00:00
Chris Lattner
62629300d3
Remove unneccesary #include
...
llvm-svn: 4772
2002-11-19 23:12:53 +00:00
Chris Lattner
4053d2dd12
Implement the CloneFunction function
...
llvm-svn: 4771
2002-11-19 23:12:22 +00:00
Chris Lattner
e5a05ec13b
Minor changes to cloning interface
...
llvm-svn: 4770
2002-11-19 22:54:01 +00:00
Chris Lattner
aff50cfe1d
Fix two fixmes: integrate with inlining, and document
...
llvm-svn: 4769
2002-11-19 22:04:49 +00:00
Chris Lattner
27bf5916fb
Rework inline pass to use cloning infrastructure to do the dirty work
...
llvm-svn: 4766
2002-11-19 21:54:07 +00:00
Chris Lattner
ccb8790bc4
Start using the new function cloning header
...
llvm-svn: 4764
2002-11-19 20:59:41 +00:00
Chris Lattner
7e4c65114b
Move MutatStructTypes.h out of IPO
...
llvm-svn: 4762
2002-11-19 20:49:40 +00:00
Chris Lattner
17da38496e
Rename CloneFunction.h to Cloning.h
...
llvm-svn: 4760
2002-11-19 20:08:24 +00:00
Chris Lattner
adea9960ab
Move the function extractor pass from tools/extract into lib/Xform/IPO
...
llvm-svn: 4759
2002-11-19 18:42:59 +00:00
Chris Lattner
bd2cbecb05
Add a new Module::getNamedFunction method
...
llvm-svn: 4758
2002-11-19 18:41:44 +00:00
Brian Gaeke
49acd3c0ba
Brian Gaeke says:
...
lib/Target/X86/InstSelectSimple.cpp: Add a little something to
visitBranchInst which supports conditional branches.
lib/Target/X86/X86InstrInfo.def: Add defs of JNE, JE, CMPri8
llvm-svn: 4755
2002-11-19 09:08:47 +00:00
Nick Hildenbrandt
cd79631bb1
*** empty log message ***
...
llvm-svn: 4754
2002-11-18 22:21:52 +00:00
Chris Lattner
8118f6db93
Add peak memory usage measurement capability
...
Add (currently disabled) faciility to try to filter out pool allocation overhead from memory usage stats
llvm-svn: 4753
2002-11-18 21:47:09 +00:00
Chris Lattner
ad3955d6a5
Add peak memory usage measurement stuff
...
Add structure padding optimizations
llvm-svn: 4749
2002-11-18 21:44:46 +00:00
Chris Lattner
f179a40a00
Add peak memory usage support
...
llvm-svn: 4748
2002-11-18 21:44:19 +00:00
Chris Lattner
25a8814af0
Add stats
...
llvm-svn: 4747
2002-11-18 21:42:45 +00:00
Nick Hildenbrandt
d97c216a21
*** empty log message ***
...
llvm-svn: 4745
2002-11-18 20:55:50 +00:00
Chris Lattner
cd1f56fc36
Start trying to print instructions more correctly. For now we also print out the opcode for each instruction as well.
...
llvm-svn: 4743
2002-11-18 06:56:51 +00:00
Chris Lattner
8301d751ee
Expose base opcode
...
llvm-svn: 4742
2002-11-18 06:56:24 +00:00
Chris Lattner
54bb9d64a3
Start to add more information to instr.def
...
llvm-svn: 4741
2002-11-18 05:37:11 +00:00
Chris Lattner
e921369cf7
Add instruction annotation about whether it has a 0x0F opcode prefix
...
llvm-svn: 4740
2002-11-18 01:59:28 +00:00
Chris Lattner
acf38562df
Add more void flags
...
llvm-svn: 4739
2002-11-18 01:37:48 +00:00
Chris Lattner
7a67557e29
Set the void flag on instructions that should get it
...
llvm-svn: 4738
2002-11-18 01:34:36 +00:00
Chris Lattner
3afc487fba
Print is const!
...
llvm-svn: 4737
2002-11-17 23:22:13 +00:00
Chris Lattner
f0a1010d2c
Pass on a targetmachine
...
llvm-svn: 4736
2002-11-17 23:22:03 +00:00
Chris Lattner
a7d7b16161
Arrange to have a TargetMachine available in X86InstrInfo::print
...
llvm-svn: 4734
2002-11-17 23:20:37 +00:00
Chris Lattner
700e8f6a01
Wow, I'm incapable of the simplest things today...
...
llvm-svn: 4732
2002-11-17 23:05:21 +00:00
Chris Lattner
1cd77c9933
Rename registers to follow the intel style of all caps
...
llvm-svn: 4731
2002-11-17 23:03:46 +00:00
Chris Lattner
0bf125c617
Fix misleading indentation
...
llvm-svn: 4730
2002-11-17 22:57:23 +00:00
Chris Lattner
5374a3be97
Reorganize printing interface a bit
...
llvm-svn: 4728
2002-11-17 22:53:13 +00:00
Chris Lattner
a55e8dba9b
Add default implementation of printing interface
...
llvm-svn: 4727
2002-11-17 22:53:03 +00:00
Chris Lattner
970ae6d569
Fix minor detail
...
llvm-svn: 4725
2002-11-17 22:33:26 +00:00
Chris Lattner
38bc372a49
Add hack to only consider indirect calls indirect if they do more than cast
...
their source function
llvm-svn: 4723
2002-11-17 22:17:12 +00:00
Chris Lattner
322901a840
Add MaxSCC statistics
...
llvm-svn: 4722
2002-11-17 22:16:28 +00:00
Chris Lattner
acfc11664a
Count CallInsts correctly, remove unneccesary initializers
...
S: ----------------------------------------------------------------------
llvm-svn: 4721
2002-11-17 22:15:40 +00:00
Chris Lattner
8ac4eea84b
Remove only uses of markDef/markDefAndUse methods
...
llvm-svn: 4719
2002-11-17 22:14:08 +00:00
Chris Lattner
72e99c8344
Fix Mul/Div clobbers
...
llvm-svn: 4718
2002-11-17 21:56:38 +00:00
Chris Lattner
dcb6f1dbf9
Fix a few typos, implement load/store
...
llvm-svn: 4716
2002-11-17 21:11:55 +00:00
Chris Lattner
06066e17c3
Add functions to buld X86 specific constructs
...
llvm-svn: 4714
2002-11-17 21:03:35 +00:00
Chris Lattner
5e21732045
Add information about memory index representation
...
llvm-svn: 4712
2002-11-17 20:33:26 +00:00
Chris Lattner
99b5e2f073
Add load/store instructions
...
llvm-svn: 4711
2002-11-17 20:33:12 +00:00
Chris Lattner
fb67938381
Switch visitRet to use getClass()
...
llvm-svn: 4710
2002-11-17 20:07:45 +00:00
Brian Gaeke
492e05ba01
include/llvm/CodeGen/MachineInstrBuilder.h: Add addClobber() inline
...
convenience method. Fix typo in comment.
lib/Target/X86/InstSelectSimple.cpp: Explicitly specify some implicit uses.
Use MOVZX/MOVSX instead of MOV instructions with sign extend instructions.
Take out LEAVE instructions.
32-bit IDIV and DIV use CDQ, not CWQ (CWQ is a typo).
Fix typo in comment and remove some FIXME comments.
lib/Target/X86/Printer.cpp: Include X86InstrInfo.h and llvm/Function.h.
Add some simple code to Printer::runOnFunction to iterate over
MachineBasicBlocks and call X86InstrInfo::print().
lib/Target/X86/X86InstrInfo.def: Make some more instructions with
implicit defs "Void". Add more sign/zero extending "move" insns
(movsx, movzx).
lib/Target/X86/X86RegisterInfo.def: Add EFLAGS as a register.
llvm-svn: 4707
2002-11-14 22:32:30 +00:00
Dinakar Dhurjati
9da9f0534e
Gives the count for various instructions.
...
llvm-svn: 4706
2002-11-13 18:22:13 +00:00
Vikram S. Adve
2dfc11dc3b
Pass to compute various statisics related to DSGraphs.
...
For now, this just computes the #indirect call sites and
the avg. #callees per indirect call site (actually it prints
both totals and the average is their ratio).
llvm-svn: 4705
2002-11-13 15:41:00 +00:00
Chris Lattner
996bf14a4f
Fix bug: 2002-11-13-PointerFunction.ll
...
This should fix codegen on vortex to work much better
llvm-svn: 4704
2002-11-13 06:54:20 +00:00
Chris Lattner
b257e87db5
Inline graphs from outside the SCC into the SCC before SCC resolution starts
...
llvm-svn: 4701
2002-11-12 15:58:08 +00:00
Chris Lattner
cd37857ad0
Fix two bugs:
...
* The globals vector was getting broken and unsorted, this caused vortex
to get badly pessimized
* Node offset handling was being handled really poorly, and in particular
we were not merging types with offsets right. This causes several graphs
to be non-merged.
llvm-svn: 4699
2002-11-12 07:20:45 +00:00
Chris Lattner
3b303e5ab8
Fix bug
...
llvm-svn: 4697
2002-11-11 22:23:56 +00:00
Chris Lattner
f56a5282d2
Handle a mismatch between # function args and call site args
...
llvm-svn: 4696
2002-11-11 21:36:05 +00:00
Chris Lattner
6fcb6f1472
Elimiante calls to a node with nothing in it.
...
llvm-svn: 4695
2002-11-11 21:35:38 +00:00
Chris Lattner
0052b69a32
Complete rewrite of BU code to use Tarjan's SCC finding algorithm to drive
...
the algorithm instead of hand coded depth first iteration
llvm-svn: 4694
2002-11-11 21:35:13 +00:00
Brian Gaeke
8cfe5d95f1
InstSelectSimple.cpp: (visitReturnInst) Add return instructions with return
...
values.
X86InstrInfo.def: add LEAVE instruction.
llvm-svn: 4691
2002-11-11 19:37:09 +00:00
Chris Lattner
fb44e1ff28
Mark stuff reachable by _AUX_ calls as incomplete in the BU graph
...
llvm-svn: 4690
2002-11-11 03:36:55 +00:00
Chris Lattner
f05d126a68
Fix infinite loop in the BU algorithm. Unfortunately this dies a serious
...
death when handling moderately sized SCC's, but what can you do
llvm-svn: 4689
2002-11-11 00:01:34 +00:00
Chris Lattner
a7302da4e8
Print the right call set size
...
llvm-svn: 4688
2002-11-11 00:01:02 +00:00
Chris Lattner
41bf6e1bc6
Use call site mergeWith method to simplify code
...
llvm-svn: 4687
2002-11-11 00:00:46 +00:00
Chris Lattner
0fe1af497d
Fix a bug that could trigger when varargs call sites had non-matching number of arguments
...
llvm-svn: 4683
2002-11-10 07:46:08 +00:00
Chris Lattner
928e9c012b
* Dramatically rework liveness evaluation.
...
* Implement the first step of the Globals graph: Deleting nodes from function
graphs. In practice, these nodes need to be moved to the globals graph, but
this will be taken care of later. Note that the graphs computed right now are
not strictly correct!
llvm-svn: 4681
2002-11-10 06:59:55 +00:00
Chris Lattner
f5667969d1
Honor the shouldPrintAuxCalls flag
...
llvm-svn: 4678
2002-11-10 06:53:59 +00:00
Chris Lattner
2597c1158f
Initialize PrintAuxCalls member
...
llvm-svn: 4677
2002-11-10 06:53:38 +00:00
Chris Lattner
a30663385f
* Bottom-Up graphs print the Aux call vector
...
* Significantly improve DEBUG output
* Aggressively fold calls together if we inlined a graph that provides
call nodes.
* Add a bailout if the current graph has over 200 call nodes in it, this is
a really whacky case that should never happen.
llvm-svn: 4675
2002-11-10 06:52:47 +00:00
Chris Lattner
96d1bfd014
Fix testcase: FunctionResolve/2002-11-09-ExternFn.ll
...
llvm-svn: 4668
2002-11-10 03:36:55 +00:00
Chris Lattner
1fe76d2385
eliminate the ability to remove global nodes from deadNodeElminate... for now.
...
This slows stuff down a bit, but it should get much better before it gets any
worse.
llvm-svn: 4666
2002-11-09 22:07:02 +00:00
Chris Lattner
d9c732c581
Remove obsolete code
...
llvm-svn: 4665
2002-11-09 21:41:44 +00:00
Chris Lattner
20d264e16b
Fix logic
...
llvm-svn: 4664
2002-11-09 21:40:58 +00:00
Chris Lattner
0752756a6a
Add globals graphs to all three passes
...
llvm-svn: 4663
2002-11-09 21:12:07 +00:00
Chris Lattner
f6ea37ce99
Move maskNodeTypes to header file
...
llvm-svn: 4661
2002-11-09 21:02:26 +00:00
Chris Lattner
e726eb5ea7
Clean up DSGraph::removeDeadNodes interface
...
llvm-svn: 4660
2002-11-09 21:00:49 +00:00
Chris Lattner
3e54e8f3ca
Make removeTriviallyDeadNodes a private interface of DSGraph
...
llvm-svn: 4659
2002-11-09 20:55:24 +00:00
Chris Lattner
082bbe3069
Don't put constants into the scalar map!
...
llvm-svn: 4657
2002-11-09 20:14:03 +00:00
Chris Lattner
1c5c03d6f7
Add initial support for a globals graph
...
llvm-svn: 4656
2002-11-09 20:01:01 +00:00
Chris Lattner
5a11bf70c3
Tighten up array handling
...
llvm-svn: 4655
2002-11-09 19:25:27 +00:00
Chris Lattner
6172544663
#include Datastructure.h first
...
llvm-svn: 4654
2002-11-09 19:25:10 +00:00
Chris Lattner
0141841bc4
Fix warning
...
llvm-svn: 4649
2002-11-09 00:49:43 +00:00
Chris Lattner
b3580d5111
Fix warning & release build
...
llvm-svn: 4648
2002-11-09 00:49:05 +00:00
Chris Lattner
f03f32d2e8
Fix spelling error
...
llvm-svn: 4645
2002-11-08 23:18:37 +00:00
Chris Lattner
608bb157f7
Fold arrays down to a single element. This causes huge wins on some benchmarks
...
for example: 197.parser (64M->14M), 164.gzip (14M->2.7M). The actual graphs
represented should not change at all.
llvm-svn: 4643
2002-11-08 22:49:57 +00:00
Chris Lattner
4baa01ba61
ONLY merge in the aux call sites, this causes a HUGE speedup
...
llvm-svn: 4640
2002-11-08 22:27:25 +00:00
Chris Lattner
380395f58e
Allow specification of whether the call sites should be copied, AND whether
...
the aux call sites should be copied
llvm-svn: 4639
2002-11-08 22:27:09 +00:00
Chris Lattner
5cffea23bb
Reenable 'quick exit' case
...
llvm-svn: 4638
2002-11-08 22:26:43 +00:00
Chris Lattner
8cd66f734f
Reduce amount of work needed to compute ip/modref
...
llvm-svn: 4637
2002-11-08 22:17:01 +00:00
Chris Lattner
b3bf781d44
Reimplement TD pass completely it now works
...
llvm-svn: 4635
2002-11-08 21:28:37 +00:00
Chris Lattner
f1e963a98c
Cannot modify original call sites vector
...
llvm-svn: 4634
2002-11-08 21:27:37 +00:00
Chris Lattner
427b472549
- Add a bunch of checking to make sure that dead nodes are not used after they
...
are marked DEAD. This helped track down some bugs
- Fix a bunch of bugs where we were doing work on nodes after they became dead
- Add support for aux function call sites
- Add support for not cloning call sites
llvm-svn: 4633
2002-11-08 21:27:12 +00:00
Chris Lattner
4feccc4d45
Remove gunk used by broken TD pass
...
llvm-svn: 4632
2002-11-08 21:25:24 +00:00
Chris Lattner
7252fe359e
Use the new getMainFunction() method to efficiently locate main
...
llvm-svn: 4630
2002-11-08 20:34:21 +00:00
Chris Lattner
2698f71007
Add a method "getMainFunction()" that efficiently locates 'main' in a module
...
llvm-svn: 4629
2002-11-08 20:34:02 +00:00
Chris Lattner
30e3d26423
Fix IPModRef to use new DS interface
...
llvm-svn: 4628
2002-11-08 19:13:14 +00:00
Chris Lattner
dda5d522bc
Implement feof
...
llvm-svn: 4627
2002-11-08 19:10:26 +00:00
Chris Lattner
22e36c86cd
Use DSNodeHandleMap instead to be safe
...
llvm-svn: 4622
2002-11-08 05:01:14 +00:00
Chris Lattner
986ec528fd
* actually handle constants (especially constantexprs) correctly.
...
- This seems to dramatically improve many benchmarks, only slowing down
gzip significantly.
llvm-svn: 4621
2002-11-08 05:00:44 +00:00
Chris Lattner
86b5e92d45
Add flush
...
llvm-svn: 4619
2002-11-08 01:21:07 +00:00
Chris Lattner
d5dc2c1417
Fix bug: FunctionResolve/2002-11-07-RetMismatch.ll
...
llvm-svn: 4618
2002-11-08 00:38:20 +00:00
Chris Lattner
3de4680d56
_REALLY_ fix the float constant problem
...
llvm-svn: 4609
2002-11-07 22:12:53 +00:00
Chris Lattner
d57a4ec976
Print out 'float' constants correctly
...
llvm-svn: 4607
2002-11-07 19:43:59 +00:00
Chris Lattner
8674baf660
Implement freopen for burg
...
llvm-svn: 4606
2002-11-07 19:33:50 +00:00
Chris Lattner
419dd5f0c1
Make command line arguments setup be endian correct!!
...
llvm-svn: 4605
2002-11-07 19:29:31 +00:00
Brian Gaeke
100510d2a8
Add instruction selection code and tests for setcc instructions
...
llvm-svn: 4603
2002-11-07 17:59:21 +00:00
Chris Lattner
f13f9c585e
Implement ResolveCallSiteModRefInfo for IPModRef. computeModRef is not yet done though!
...
llvm-svn: 4602
2002-11-07 07:12:23 +00:00
Chris Lattner
450e1fbc76
Instead of using a bool that constant has to be explained, use a self
...
explanitory enum instead.
llvm-svn: 4600
2002-11-07 07:06:20 +00:00
Chris Lattner
7d2624d4f3
Implement a new mergeInGraph method, which basically factors code out of
...
the BU class.
This will be used by the IPModRef class to do stuff, eventually perhaps the
TD pass will use it also.
Speaking of the TD pass, this also eliminates the self recursive case, which
was broken, and couldn't occur anyway.
llvm-svn: 4599
2002-11-07 06:31:54 +00:00
Chris Lattner
dfba076f5b
Rename DataStructureAnalysis namespace to DS
...
llvm-svn: 4596
2002-11-07 05:20:53 +00:00
Chris Lattner
a0d26350c6
Fix problem with dangling referrers
...
llvm-svn: 4595
2002-11-07 05:00:35 +00:00
Chris Lattner
d68d0a9037
Minor bugfix to enable generation of methcall.llvm.lib, objinst.llvm.lib, and
...
The problem was merging two unsized types like function's, ie int (int*) with
int (uint *)
llvm-svn: 4594
2002-11-07 04:59:28 +00:00
Chris Lattner
b0de126c1a
Compute total number of nodes and # call nodes
...
llvm-svn: 4592
2002-11-07 02:18:46 +00:00
Chris Lattner
f352eadeb3
Move printouts to be wrapped in DEBUG() macros
...
llvm-svn: 4588
2002-11-07 01:54:56 +00:00
Chris Lattner
1efa9f0247
When the -only-print-main-ds option is specified, still print out graph size
...
statistics for skipped functions
llvm-svn: 4587
2002-11-07 01:54:44 +00:00
Chris Lattner
84ed927ae7
Implement fprintf
...
llvm-svn: 4585
2002-11-06 23:05:03 +00:00
Chris Lattner
b1a9401c59
Implement fputc and ungetc to allow burg to run in lli
...
llvm-svn: 4584
2002-11-06 22:59:28 +00:00
Nick Hildenbrandt
1fddd12bae
Fixes escapeing bug in strings. Fixes test case test/Regression/CBackend/2002-11-06-PrintEscaped.c
...
llvm-svn: 4583
2002-11-06 21:40:23 +00:00
Nick Hildenbrandt
4c3112f3cb
Loads and stores can't be inlined. This fixes test/Singlesource/matrixTranspose
...
llvm-svn: 4579
2002-11-06 20:07:54 +00:00
Chris Lattner
9870fb032e
Allow the ResolveCallSiteModRefInfo method to return a mapping of nodes,
...
implement the mod/ref bit masking
llvm-svn: 4578
2002-11-06 19:59:33 +00:00
Chris Lattner
f7e839f435
Add a stub to implement the context sensitive mod/ref info for call sites
...
llvm-svn: 4577
2002-11-06 19:38:43 +00:00
Chris Lattner
00de4338dc
Give a back pointer to the IPModRef object to the FunctionModRefInfo object
...
llvm-svn: 4576
2002-11-06 19:07:13 +00:00
Chris Lattner
0e158e64ff
Remove a couple of #includes, move some code from .h file
...
llvm-svn: 4575
2002-11-06 18:38:18 +00:00
Chris Lattner
97722c2dad
Change Steens class to build with Vikram's changes
...
llvm-svn: 4572
2002-11-06 18:08:32 +00:00
Chris Lattner
6a019cdff5
Make PointerSize & Shift be enums
...
Fix problem with recursive merging
llvm-svn: 4570
2002-11-06 18:01:39 +00:00
Vikram S. Adve
201d4e3639
Make query operations non-const to allow demand-driven analyses.
...
llvm-svn: 4569
2002-11-06 17:17:55 +00:00
Vikram S. Adve
2a1c1171e7
An interprocedural analysis pass that computes flow-insensitive
...
IP Mod and Ref information for every function and every call site.
llvm-svn: 4567
2002-11-06 17:02:03 +00:00
Chris Lattner
d0387e7e11
Dramatically simplify internal DSNode representation, get implementation
...
*FULLY OPERATIONAL* and safe. We are now capable of completely analyzing
at LEAST the Olden benchmarks + 181.mcf
llvm-svn: 4562
2002-11-06 06:20:27 +00:00
Chris Lattner
304e29942d
Delete "StripScalars" argument to cloneInto method
...
llvm-svn: 4560
2002-11-06 06:16:30 +00:00
Vikram S. Adve
51aa205bd1
Remove a nasty little semi-colon someone introduced which
...
prevented any machine instrs from being printed!
llvm-svn: 4557
2002-11-06 00:34:26 +00:00
Chris Lattner
b09aadd633
Attempted fixes to the mergemap to make it work better.
...
Ended up disabling merge map merging completely. It shall be removed.
llvm-svn: 4550
2002-11-05 00:01:58 +00:00
Chris Lattner
fe090b7d1f
Simplify code
...
llvm-svn: 4547
2002-11-04 21:06:54 +00:00
Chris Lattner
45a7acb725
Sun can now use mallinfo()
...
llvm-svn: 4546
2002-11-04 21:05:21 +00:00
Chris Lattner
c23b57a60d
No need to explicitly inclue ExportSymbols now
...
llvm-svn: 4543
2002-11-04 20:50:57 +00:00
Chris Lattner
da3f2f6133
Allow memory sizes to be negative, remove obsolete TmpRSS field
...
llvm-svn: 4538
2002-11-04 19:19:36 +00:00
Chris Lattner
33a0632b24
mallinfo is not available on sun apparently :(
...
llvm-svn: 4537
2002-11-04 19:01:41 +00:00
Chris Lattner
aaf2fa34a5
Instcombine this away:
...
%A = getelementptr [4 x int]* %M, long 0, long 0
%B = getelementptr int* %A, long 2
llvm-svn: 4536
2002-11-04 16:43:32 +00:00
Chris Lattner
ecddf3396f
Add a transformation to turn:
...
malloc Ty, C
int
malloc [C x Ty], 1
llvm-svn: 4534
2002-11-04 16:18:53 +00:00
Vikram S. Adve
b7afa2004a
Simple passes that print out SCCs in the CFGs or in the CallGraph of a module.
...
llvm-svn: 4532
2002-11-04 14:20:22 +00:00
Chris Lattner
5c467c7d99
Change the "Cannot merge two portions of the same node yet" from an assertion
...
into a "oh crap, lets collapse" case
llvm-svn: 4530
2002-11-04 06:48:26 +00:00
Chris Lattner
e27815a482
Ack: Fix bug in previous checkin.
...
llvm-svn: 4526
2002-11-04 05:50:42 +00:00
Chris Lattner
81135c4c57
Be more generous about level raising constant expressions don't force each
...
constant to one particular type.
llvm-svn: 4525
2002-11-04 05:46:37 +00:00
Chris Lattner
b9fa84c1ed
Make sure to _delete_ memory allocated by worklists
...
llvm-svn: 4523
2002-11-04 02:54:22 +00:00
Chris Lattner
4e4beb637b
Give a better error message in an unhandled case
...
llvm-svn: 4521
2002-11-04 02:29:15 +00:00
Chris Lattner
471179e6b9
Minor fix to space accounting
...
llvm-svn: 4520
2002-11-04 01:49:45 +00:00
Chris Lattner
a7cdb12f6c
Implement MaxRSS in terms of mallinfo instead of the system RSS. This gives
...
us much more accurate numbers and actually WORKS.
llvm-svn: 4518
2002-11-04 00:32:44 +00:00
Chris Lattner
aaf17e11b1
Allow the call graph to be called from analyze naturally with print implemented
...
llvm-svn: 4517
2002-11-04 00:21:19 +00:00
Chris Lattner
8d63aab886
Rename ValueMap to ScalarMap
...
llvm-svn: 4516
2002-11-03 21:27:48 +00:00
Chris Lattner
0ee058644e
Rename NewNode flag to HeapNode
...
llvm-svn: 4515
2002-11-03 21:24:04 +00:00
Chris Lattner
7287a8f9a8
Change the letters used to represent stack and heap allocations to "S" and "H"
...
respectively. This is to make presentation easier in the paper.
llvm-svn: 4514
2002-11-03 19:46:15 +00:00
Anand Shukla
bf2fc13a2f
code to lightly instrument at branches
...
llvm-svn: 4511
2002-11-03 01:45:20 +00:00
Chris Lattner
0478222ec2
Move function to cpp file from header
...
llvm-svn: 4510
2002-11-02 22:07:51 +00:00
Chris Lattner
79296d7609
Implement signed and unsigned division and remainder
...
llvm-svn: 4508
2002-11-02 20:54:46 +00:00
Chris Lattner
234cc2848a
Implement multiply operator
...
llvm-svn: 4506
2002-11-02 20:28:58 +00:00
Chris Lattner
efa2b8226f
* Implement subtract
...
* Merge add code into logical code
llvm-svn: 4503
2002-11-02 20:13:22 +00:00
Chris Lattner
5d1648c792
shuffle code around a bit, implement and, or, xor
...
llvm-svn: 4502
2002-11-02 20:04:26 +00:00
Chris Lattner
45000f0eb7
Add PHI node support, add comment for branch function
...
llvm-svn: 4500
2002-11-02 19:45:49 +00:00
Chris Lattner
d4010481a7
Implement unconditional branching support
...
llvm-svn: 4498
2002-11-02 19:27:56 +00:00
Chris Lattner
2634141328
* Fix nonconstant shift case
...
* Turn table into 2d table
llvm-svn: 4496
2002-11-02 01:41:55 +00:00
Chris Lattner
14ce86f5b0
Use a more table driven approach to handling types. Seems to simplify the
...
code a bit
llvm-svn: 4493
2002-11-02 01:15:18 +00:00
Chris Lattner
ef1d6548bb
Make switch statements denser, but only because of the follow-on patch
...
llvm-svn: 4492
2002-11-02 00:49:56 +00:00
Chris Lattner
b3e08ace0c
* Remove dead variable
...
* Shift amount is always guaranteed to be 8 bits
llvm-svn: 4491
2002-11-02 00:44:25 +00:00
Chris Lattner
702ac95902
Implement the "unknown flag" which mainly consists of aligning printing code
...
llvm-svn: 4490
2002-11-02 00:36:03 +00:00
Chris Lattner
53f7777f77
Oops, this was not meant to be checked in
...
llvm-svn: 4489
2002-11-02 00:26:32 +00:00
Chris Lattner
226c503f31
Stop representing scalars as explicit nodes in the graph. Now the only
...
nodes in the graph are memory objects, which is very nice. This also greatly
reduces the size and memory footprint for DSGraphs. For example, the local
DSGraph for llu went from 65 to 13 nodes with this change. As a side bonus,
dot seems to lay out the graphs slightly better too. :)
llvm-svn: 4488
2002-11-02 00:13:20 +00:00
Nick Hildenbrandt
cb64b4ce99
Fixed bug in Regression/CBackend/2002-10-30-FunctionPointerAlloca.ll
...
llvm-svn: 4486
2002-11-01 17:37:09 +00:00
Chris Lattner
251a8d9df5
Fix comments, steens is context sensitive, we just haven't implemented
...
mod/ref apis yet
llvm-svn: 4485
2002-11-01 17:34:23 +00:00
Chris Lattner
4b8d170d55
New iostream definitions
...
llvm-svn: 4482
2002-11-01 16:46:05 +00:00
Chris Lattner
d94208782e
Make sure to include name information if we have it
...
llvm-svn: 4481
2002-11-01 04:49:06 +00:00
Chris Lattner
52b845cd0c
Add a fixme
...
llvm-svn: 4479
2002-10-31 23:24:00 +00:00
Brian Gaeke
2ad8a9cf8b
InstSelectSimple.cpp: Include llvm/iOther.h for ShiftInst.
...
Add ISel::visitShiftInst() to instruction select shift instructions.
Add a comment in visitAdd about how to do 64 bit adds.
X86InstrInfo.def: Add register-to-register move opcodes and shift opcodes.
llvm-svn: 4477
2002-10-31 23:03:59 +00:00
Chris Lattner
32eb8c3659
* Minor optimization: when merging nodes, merge the smaller one into the
...
larger one.
* Handle the case where we are merging two nodes of different size better.
llvm-svn: 4476
2002-10-31 22:41:15 +00:00
Chris Lattner
dbf49d6266
Reassociate pass now works
...
llvm-svn: 4473
2002-10-31 17:16:18 +00:00
Chris Lattner
b913f4e785
Fixes to the reassociate pass to make it respect dominance properties
...
Huge thanks go to Casey Carter for writing this fix, reassociate is now
reoperational!
llvm-svn: 4471
2002-10-31 17:12:59 +00:00
Chris Lattner
31bbb65ef8
Fix nasty bug in ::isNeg()
...
llvm-svn: 4470
2002-10-31 17:09:06 +00:00
Vikram S. Adve
8ecd939ce9
Restore support for indirect function calls (which briefly wasn't working
...
after I removed annotations on MachineInstr for the CallDescriptor).
llvm-svn: 4469
2002-10-31 15:34:48 +00:00
Chris Lattner
07c1f70586
Remove dead code
...
llvm-svn: 4467
2002-10-31 06:52:26 +00:00
Chris Lattner
317daff9bf
This fixes all kinds of problems with array handling. There are still bugs to
...
be fixed, but we are getting much closer now.
* Make DSNode::TypeRec a full fledged DSTypeRec type.
* Add methods used to update and access the typerecords elements
* Add methods to query if and to cause a node to be completely folded
* DSGraph construction doesn't use the allocation type for anything at all,
now nodes get their type information based on how they are used.
* Fixed a bug with global value handling introduced in the last checkin
* GEP support is now much better, arrays are handled correctly. The array
flag is now updated in type records. There are still cases that are not
handled yet (we do not detect pessimizations), but getting much closer.
llvm-svn: 4465
2002-10-31 05:45:02 +00:00
Chris Lattner
c084f3ab67
Can simplify code now with the isCommutative() method.
...
llvm-svn: 4461
2002-10-31 04:24:23 +00:00
Chris Lattner
d4c9998d7a
Use new isCommutative interface, which gives us SetEQ and SetNE for free.
...
Thanks fly out to Casey Carter for this fix.
llvm-svn: 4460
2002-10-31 04:20:07 +00:00
Chris Lattner
2ce9a55285
New isAssociative/isCommutative inspection methods, graciously contributed by
...
Casey Carter.
llvm-svn: 4459
2002-10-31 04:14:01 +00:00
Chris Lattner
1ec9725ef8
BreakCriticalEdges should update dominance frontier information as well as
...
other dominance stuff. Patch contributed by Casey Carter
llvm-svn: 4457
2002-10-31 02:44:36 +00:00
Chris Lattner
0396c5461e
Fix two problems:
...
* Load Implementation can cause unaligned memory accesses, which caused
problems for sparc.
* cast from pointer to pointer would zero the upper 32 bits of the pointer
which obviously causes problems on 64 bit hosts.
llvm-svn: 4454
2002-10-30 21:47:57 +00:00
Vikram S. Adve
913883dd6e
In getID(), don't call getValidSymbolName to mangle external names!
...
llvm-svn: 4451
2002-10-30 20:16:38 +00:00
Chris Lattner
47bbeeac43
Add lots more info
...
llvm-svn: 4450
2002-10-30 06:04:46 +00:00
Chris Lattner
8fa0840abd
Remove fixme
...
llvm-svn: 4447
2002-10-30 02:02:37 +00:00
Chris Lattner
98e6bad1ee
Add special code to make printing SSA form machine instructions nicer
...
llvm-svn: 4446
2002-10-30 01:55:38 +00:00
Chris Lattner
cbbc96bd8d
Make sure to set the destination register correctly
...
llvm-svn: 4444
2002-10-30 01:49:01 +00:00
Chris Lattner
d18210e53f
Set the destination register field based on the target specific flags
...
llvm-svn: 4442
2002-10-30 01:15:31 +00:00
Chris Lattner
80f1f696e8
Add flag to specify when no value is produced by an instruction
...
llvm-svn: 4441
2002-10-30 01:09:34 +00:00
Chris Lattner
9e8fab4aa1
Sparc backend doesn't use target specific flags yet
...
llvm-svn: 4440
2002-10-30 01:07:12 +00:00
Chris Lattner
8dfb0ef7b0
Use MRegisterInfo, if available, to print symbolic register names
...
llvm-svn: 4438
2002-10-30 00:58:19 +00:00
Chris Lattner
a8069b87b3
Implement the new optional getRegisterInfo
...
llvm-svn: 4437
2002-10-30 00:56:18 +00:00
Chris Lattner
2cfa08e4bf
Implement structured machine code printing
...
llvm-svn: 4435
2002-10-30 00:48:05 +00:00
Chris Lattner
faa5c82486
Print machine code after instruction selection
...
llvm-svn: 4434
2002-10-30 00:47:49 +00:00
Chris Lattner
40d5ff97c1
Make sure to pass the LLVM basic block in
...
llvm-svn: 4433
2002-10-30 00:47:40 +00:00
Chris Lattner
4352ba0640
Construct annotation, to make sure it's attached to function
...
llvm-svn: 4429
2002-10-29 23:40:58 +00:00
Chris Lattner
e89cb8ba64
Make argsize calculation stuff optional, so that Targets without FrameInfo
...
objects yet don't die
llvm-svn: 4427
2002-10-29 23:40:03 +00:00
Chris Lattner
64fa3f3e97
Implement autoinserting ctor
...
llvm-svn: 4426
2002-10-29 23:19:00 +00:00
Chris Lattner
de3938a592
Rename annotation id
...
llvm-svn: 4425
2002-10-29 23:18:43 +00:00
Misha Brukman
c9c721edf0
Fix spelling of `propagate'.
...
llvm-svn: 4423
2002-10-29 23:06:16 +00:00
Chris Lattner
d3b57a0084
Convert backend to use passes, implement X86TargetMachine
...
llvm-svn: 4421
2002-10-29 22:37:54 +00:00
Chris Lattner
5e881d4c19
These are no longer virtual methods
...
llvm-svn: 4420
2002-10-29 22:01:44 +00:00
Chris Lattner
5d798b7887
* Privatize the TargetName
...
* Move optSizeForSubWordData to TargetData
* Remove unused fields
llvm-svn: 4417
2002-10-29 21:48:17 +00:00
Chris Lattner
94fb0d4b03
Implement findOptimalStorageSize a bit more generally
...
llvm-svn: 4416
2002-10-29 21:47:50 +00:00
Chris Lattner
eec571dce8
Allow TargetMachine to refuse static code gen
...
llvm-svn: 4415
2002-10-29 21:12:46 +00:00
Chris Lattner
82479f668c
Rename X86InstructionInfo to X86InstrInfo
...
llvm-svn: 4413
2002-10-29 21:05:24 +00:00
Chris Lattner
0518ad4aea
Minor renaming
...
llvm-svn: 4410
2002-10-29 20:48:56 +00:00
Chris Lattner
bc44fbfd6d
Remove unneccesary #includes
...
llvm-svn: 4408
2002-10-29 20:47:46 +00:00
Chris Lattner
d589e36f4e
Rename Sparc.h to TargetMachineImpls.h
...
llvm-svn: 4407
2002-10-29 20:47:26 +00:00
Chris Lattner
a1ab3b1636
Reenable X86 backend, even though it doesn't do much, at least it compiles
...
llvm-svn: 4404
2002-10-29 20:29:34 +00:00
Chris Lattner
fc88414ffd
Merge with sparc backend
...
llvm-svn: 4403
2002-10-29 20:10:58 +00:00
Chris Lattner
0ac25d509c
X86 merge is complete, eliminate unused code
...
llvm-svn: 4400
2002-10-29 20:07:16 +00:00
Vikram S. Adve
4acb69b4ea
Remove separate vector of implicit refs from MachineInstr, and
...
instead record them as extra operands in the operands[] vector.
Also, move CallArgsDescriptor into this class instead of making it an
annotation on the machine instruction.
llvm-svn: 4399
2002-10-29 19:41:18 +00:00
Vikram S. Adve
1730a958ea
Move CallArgsDescriptor into this class instead of making it an
...
annotation on the machine instruction.
llvm-svn: 4398
2002-10-29 19:38:46 +00:00
Vikram S. Adve
fa70a60209
Bug fix: align size for dynamic allocas according to stack pointer
...
alignment restrictions. This is incomplete for one case.
llvm-svn: 4397
2002-10-29 19:37:31 +00:00
Chris Lattner
af52d6564a
Switch to generating machineinstr's instead of MInstructions
...
llvm-svn: 4396
2002-10-29 17:43:55 +00:00
Chris Lattner
483afe2221
Be compatible with sparc backend
...
llvm-svn: 4395
2002-10-29 17:43:38 +00:00
Chris Lattner
9e3867d6d3
Implement MachineInstrInfo interface
...
llvm-svn: 4394
2002-10-29 17:43:19 +00:00
Chris Lattner
f963781fcb
Switch to different flag set
...
llvm-svn: 4393
2002-10-29 17:42:40 +00:00
Chris Lattner
b49e35e745
Move TargetInstrDescriptors extern to the one .cpp file that refers to it:
...
MachineInstr.cpp
llvm-svn: 4392
2002-10-29 17:40:30 +00:00
Chris Lattner
79caf1109b
Move TargetInstrDescriptors to MachineInstrInfo.cpp
...
llvm-svn: 4391
2002-10-29 17:37:48 +00:00
Chris Lattner
1a53fc24c7
*** empty log message ***
...
llvm-svn: 4390
2002-10-29 17:35:41 +00:00
Chris Lattner
fa303f1bb7
Use higher level methods, don't use TargetInstrDescriptors directly!
...
llvm-svn: 4389
2002-10-29 17:35:39 +00:00
Chris Lattner
c3e30fed7b
Use higher level method
...
llvm-svn: 4386
2002-10-29 17:25:41 +00:00
Chris Lattner
80c0746b11
Remove #include, misleading comment, and a typedef used only once
...
llvm-svn: 4383
2002-10-29 17:08:05 +00:00
Chris Lattner
8ae0be7897
Inline typedef, eliminate unused method
...
llvm-svn: 4382
2002-10-29 17:03:19 +00:00
Chris Lattner
8ab1906b5f
Remove long dead #if 0
...
llvm-svn: 4381
2002-10-29 17:00:19 +00:00
Chris Lattner
9739fc7ff1
Add #includes that were eliminated from headers
...
llvm-svn: 4380
2002-10-29 16:51:05 +00:00
Chris Lattner
0493b81eef
De-inline methods
...
llvm-svn: 4379
2002-10-29 16:50:33 +00:00
Chris Lattner
6c092a9ea7
Remove #include
...
llvm-svn: 4378
2002-10-29 16:50:20 +00:00
Chris Lattner
4aba455989
Remove unneeded #include
...
llvm-svn: 4377
2002-10-29 16:50:06 +00:00
Chris Lattner
f658cf4988
Remove forward decl
...
llvm-svn: 4376
2002-10-29 16:49:44 +00:00
Chris Lattner
0cff6f7e16
Make assertIGNode be private to the InterferenceGraph.cpp file
...
llvm-svn: 4375
2002-10-29 16:42:34 +00:00
Chris Lattner
e185af9a93
MachineInstrInfo doesn't need a TargetMachine
...
llvm-svn: 4372
2002-10-29 15:45:20 +00:00
Chris Lattner
dfc584443d
Don't build X86 target until it builds properly again
...
llvm-svn: 4369
2002-10-28 23:56:41 +00:00
Chris Lattner
75d561d6f9
Seperate code out of TargetMachine into MachineInstrInfo
...
llvm-svn: 4368
2002-10-28 23:55:33 +00:00