1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

2503 Commits

Author SHA1 Message Date
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
Chris Lattner
152b53fc64 Initial stab at MachineInstr'ication
llvm-svn: 4367
2002-10-28 23:55:19 +00:00
Chris Lattner
7d6709e213 MachineInstrInfo no longer #includes this header, so we must
llvm-svn: 4366
2002-10-28 23:54:47 +00:00
Chris Lattner
f262fc83e2 Use BuildMI instead of explicit code.
llvm-svn: 4362
2002-10-28 21:43:57 +00:00
Chris Lattner
566b2147f9 Remove all traces of the "Opcode Mask" field in the MachineInstr class
llvm-svn: 4359
2002-10-28 21:17:20 +00:00
Chris Lattner
11f52470a0 Remove more default arguments that are never used
llvm-svn: 4358
2002-10-28 21:02:40 +00:00
Chris Lattner
990e074c2e Remove default operands that are never used
llvm-svn: 4357
2002-10-28 20:59:49 +00:00
Chris Lattner
de6ac9b0ff * Make MachineOperand ctors private, so MachineOperand can only be created
by MachineInstr.
* Add a bunch of new methods to allow incremental addition of operands to the
  machine instr instance.

llvm-svn: 4356
2002-10-28 20:48:39 +00:00
Chris Lattner
51efa81c85 Fix minor bug
llvm-svn: 4355
2002-10-28 20:11:17 +00:00
Chris Lattner
02d7156e35 Don't pass default args
llvm-svn: 4354
2002-10-28 20:10:56 +00:00
Misha Brukman
c4be791be2 Fixed spelling and grammar.
llvm-svn: 4353
2002-10-28 20:01:52 +00:00
Misha Brukman
6f3b1a31a1 Rewrote uses of deprecated `MachineFunction::get(BasicBlock *BB)'.
llvm-svn: 4352
2002-10-28 20:01:13 +00:00
Misha Brukman
f9d06cfc80 Replaced uses of deprecated `MachineFunction::get(BasicBlock *BB)'.
llvm-svn: 4351
2002-10-28 20:00:31 +00:00
Nick Hildenbrandt
f3846a75f1 Casting NULL can cause problems so lets just not cast NULL to anything.
llvm-svn: 4349
2002-10-28 19:54:06 +00:00
Chris Lattner
74f9160190 Remove two arguments that are never specified
llvm-svn: 4348
2002-10-28 19:46:59 +00:00
Chris Lattner
8ce9d60bc0 Don't bother passing in default value
llvm-svn: 4347
2002-10-28 19:46:25 +00:00
Chris Lattner
4b652d5505 Rename some regalloc fields
llvm-svn: 4346
2002-10-28 19:43:23 +00:00
Chris Lattner
9a346a4ded Fixes to work with updated RegAlloc
llvm-svn: 4345
2002-10-28 19:32:07 +00:00
Chris Lattner
bd1add2005 Eliminate usage of MachineBasicBlock::get
llvm-svn: 4344
2002-10-28 19:22:04 +00:00
Nick Hildenbrandt
57a54cb166 *** empty log message ***
llvm-svn: 4343
2002-10-28 19:05:12 +00:00
Chris Lattner
fdca057f8d Remove usage of MachineBasicBlock::get
llvm-svn: 4342
2002-10-28 19:01:16 +00:00
Chris Lattner
a7ca1bd65c Remove usage of MachineBasicBlock::get
llvm-svn: 4341
2002-10-28 18:50:08 +00:00
Chris Lattner
d6e5d73aa8 Eliminate uses of MachineBasicBlock::get
llvm-svn: 4340
2002-10-28 18:01:21 +00:00
Chris Lattner
2263f89d3b Eliminate unneccesary use of MachineBasicBlock::get
llvm-svn: 4339
2002-10-28 06:01:57 +00:00
Chris Lattner
f2cd0a8266 s/method/function
llvm-svn: 4338
2002-10-28 05:58:46 +00:00
Chris Lattner
7cdc2977f0 Change MachineBasicBlock's to not be Annotations, instead they are kept as
part of a linked list tracked by MachineFunction.  MachineBasicBlock::get
is now linear time instead of constant time, and thus is deprecated!

llvm-svn: 4337
2002-10-28 05:30:46 +00:00
Chris Lattner
dce9493440 Make sched class unsigned
llvm-svn: 4336
2002-10-28 04:59:43 +00:00
Chris Lattner
89a424167f Make Scheduling Class variables be 'unsigned' instead of 'int'
llvm-svn: 4333
2002-10-28 04:53:02 +00:00
Chris Lattner
e309cdbc95 Rename the redundant MachineOperand::getOperandType() to MachineOperand::getType()
llvm-svn: 4331
2002-10-28 04:45:29 +00:00
Chris Lattner
7000bbb63f Fairly major overhaul of MachineInstr & Operand classes
- Inline methods that are mostly a single line anyway
  - Eliminate several methods that were never called
  - Group methods a bit more consistently

llvm-svn: 4329
2002-10-28 04:24:49 +00:00
Chris Lattner
dd22b9e8b6 Add #includes now that MachineInstr.h doesn't include llvm/Target/MachineInstrInfo.h
llvm-svn: 4327
2002-10-28 02:28:39 +00:00
Chris Lattner
a7e9d3e90f Don't #include <Support/*>, #include "Support/*"
llvm-svn: 4325
2002-10-28 02:11:53 +00:00
Chris Lattner
df1d87f5f3 *** empty log message ***
llvm-svn: 4323
2002-10-28 02:01:37 +00:00
Chris Lattner
6b66fadf2c MachineFunction now includes MachineBasicBlock so there is no need to
reinclude it

llvm-svn: 4322
2002-10-28 02:01:35 +00:00
Chris Lattner
b8c6acfbc0 Rename MachineCodeForBasicBlock to MachineBasicBlock
llvm-svn: 4318
2002-10-28 01:41:47 +00:00
Chris Lattner
ef1475aa32 *** empty log message ***
llvm-svn: 4317
2002-10-28 01:41:27 +00:00
Chris Lattner
4f2c612b21 Inline some methods from .cpp files into .h files, minor cleanups
llvm-svn: 4313
2002-10-28 01:21:55 +00:00
Chris Lattner
61e42343e5 Minor cleanups
llvm-svn: 4312
2002-10-28 01:16:38 +00:00
Chris Lattner
33b00d8186 Move machine code generation/destruction passes out of Sparc.cpp because
they are generic

llvm-svn: 4310
2002-10-28 01:12:41 +00:00
Chris Lattner
e15e3807a1 Move addPassesToEmitAssembly from TargetMachine to UltraSparc because it
really is sparc specific.

llvm-svn: 4308
2002-10-28 01:03:43 +00:00
Chris Lattner
ce3ede5938 Prune #includes
llvm-svn: 4307
2002-10-28 01:02:51 +00:00
Chris Lattner
ffa0482331 Updates to match misha's changes
llvm-svn: 4302
2002-10-28 00:37:53 +00:00
Misha Brukman
142795fd17 Changed MachineCodeForMethod' to MachineFunction'.
llvm-svn: 4301
2002-10-28 00:28:31 +00:00
Chris Lattner
28d6f5bc40 Remove dead fixme
llvm-svn: 4300
2002-10-27 21:23:43 +00:00
Chris Lattner
e4e731b30c Instruction select constant arguments correctly
llvm-svn: 4297
2002-10-27 21:16:59 +00:00
Chris Lattner
046cb65220 Add instruction definitions for mov r, imm instructions
llvm-svn: 4296
2002-10-27 21:16:44 +00:00
Chris Lattner
cf9b4b2971 change ++ to +1 when using random access iterators
llvm-svn: 4292
2002-10-27 19:09:51 +00:00
Chris Lattner
8f38efd9dd Add #include
llvm-svn: 4291
2002-10-27 19:08:03 +00:00
Chris Lattner
c44cc692c6 Fix a major bug in lli
llvm-svn: 4289
2002-10-26 01:57:15 +00:00
Chris Lattner
d25a097994 Initial checkin of X86 backend.
We can instruction select exactly one instruction 'ret void'.  Wow.

llvm-svn: 4284
2002-10-25 22:55:53 +00:00
Chris Lattner
cfa05a3de9 Build the X86 target as well
llvm-svn: 4283
2002-10-25 22:55:05 +00:00
Chris Lattner
a952881e00 Initial checkin of codegen infrastructure for LLVM-JIT
llvm-svn: 4282
2002-10-25 22:54:41 +00:00
Chris Lattner
25173c1b4d Prune #includes
llvm-svn: 4277
2002-10-25 02:01:33 +00:00
Chris Lattner
877a38f48e Fix misspelling
llvm-svn: 4276
2002-10-25 01:43:26 +00:00
Nick Hildenbrandt
d23deb3ebe Malloc prototyping now works even if the original file had its own prototype for malloc
llvm-svn: 4271
2002-10-23 18:59:40 +00:00
Chris Lattner
47508d5c0f Tell PassManager that this pass does not invalidate the CFG so that dominator
information and Loop info will not have to be recomputed after this runs.

llvm-svn: 4269
2002-10-23 03:30:47 +00:00
Chris Lattner
b43b03614e Minor cleanups
Make sure to have a pass name

llvm-svn: 4268
2002-10-23 01:12:01 +00:00
Chris Lattner
dd74dc44b6 - Fix a really nasty bug in the bytecode reader that caused it to fail
reading bytecode files with > 255 types in them, but only when optimization
    is enabled.  This was caused by GCC shrinking an enum to a single byte
    instead of a whole word.

llvm-svn: 4266
2002-10-23 00:51:54 +00:00
Chris Lattner
a2c2d8af59 Wow, for some reason, when reading bytecode from stdin, we were only reading
4 bytes at a time.  Change this to read blocks of 4k

llvm-svn: 4265
2002-10-22 23:55:24 +00:00
Chris Lattner
b8ffbe6966 Ensure definate initialization
llvm-svn: 4263
2002-10-22 23:34:11 +00:00
Chris Lattner
dfc8fbf16b - Two minor improvements to the MachineInstr class to reduce footprint and
overhead: Merge 3 parallel vectors into 1, change regsUsed hash_set to be a
    bitvector.  Sped up LLC a little less than 10% in a debug build!

llvm-svn: 4261
2002-10-22 23:16:21 +00:00
Chris Lattner
296c58a00c - Make sure to only keep track of mappings that the TD pass may need in the
future.  This prevents having spurious map entries to nodes that we really
    don't care about.  This allows us to reenable the DeadNodeElim, which was
    disabled.

llvm-svn: 4260
2002-10-22 16:01:03 +00:00
Chris Lattner
61b32b3ab0 The callee is not correct, and confuses the TD pass. Null it out.
llvm-svn: 4259
2002-10-22 15:58:46 +00:00
Chris Lattner
b565d3ac5b - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
setPreservesCFG to be less confusing.

llvm-svn: 4255
2002-10-21 20:00:28 +00:00
Chris Lattner
1157e5dafb Delete unused arguments to DSGraph::cloneInto method
llvm-svn: 4253
2002-10-21 19:50:29 +00:00
Chris Lattner
4410178282 - Add "ResolvingCaller" to the CallSite record. This keeps track of which
function was finally able to resolve the function call.  Adding this allows
    the TD pass to actually work right!
  - Temporarily disable dead node pruning.  This will be reenabled soon.

llvm-svn: 4252
2002-10-21 19:47:18 +00:00
Chris Lattner
7588e35aa8 Add another copy ctor form
llvm-svn: 4251
2002-10-21 15:32:34 +00:00
Chris Lattner
1276c50e7b As it turns out, we don't need a fully generic mapping copy ctor, we just need
something that maps through a std::map.  Since this simplified the client and
implementation code, do so now.

llvm-svn: 4250
2002-10-21 15:04:18 +00:00
Chris Lattner
8929f75913 Don't create a new node for every reference to a global. This caused a huge
node explosion that doesn't help anything at all.  In previous versions of
the representation this DID help, but not anymore.

llvm-svn: 4249
2002-10-21 13:51:30 +00:00
Chris Lattner
9f6ddf9bdd Fix a confusing bug that caused return value and callee pointers to not
be printed!

llvm-svn: 4248
2002-10-21 13:47:57 +00:00
Chris Lattner
01fc78de5f Remove some unneccesary 'using' directives
llvm-svn: 4246
2002-10-21 13:31:48 +00:00
Chris Lattner
1953a9de17 Fix bug with prior checkin
llvm-svn: 4242
2002-10-21 02:18:55 +00:00
Chris Lattner
2914391ab6 - Make DSCallSite not inherit from std::vector. Renamed methods slightly.
Make copy ctor have two versions to avoid dealing with conditional template
    argument.  DSCallSite ctor now takes all arguments instead of taking one
    and being populated later.

llvm-svn: 4240
2002-10-21 02:08:03 +00:00
Chris Lattner
189b9b5397 Avoid extra copy
llvm-svn: 4239
2002-10-20 22:12:06 +00:00
Chris Lattner
9d0418d007 Simplify code a bit, add comment flyer
llvm-svn: 4238
2002-10-20 22:11:44 +00:00
Chris Lattner
4eec37a762 Split some long lines
llvm-svn: 4237
2002-10-20 22:11:17 +00:00
Vikram S. Adve
85a358583f Remove spurious caller pointer in DSCallSite.
Also add functions to access pointer argument nodes cleanly.

llvm-svn: 4235
2002-10-20 21:41:02 +00:00
Chris Lattner
ff8176c481 This function can be static
llvm-svn: 4234
2002-10-20 20:39:31 +00:00
Chris Lattner
cf6f36ae27 Fix previous checkin :(
llvm-svn: 4233
2002-10-20 20:39:17 +00:00
Chris Lattner
2f778ae5aa Avoid extra callSite copy
llvm-svn: 4232
2002-10-20 20:32:13 +00:00
Chris Lattner
3af7377974 Print the array flag
llvm-svn: 4231
2002-10-20 20:29:10 +00:00
Vikram S. Adve
c02c96c3de Added a first-class representation for each call site that can be
used in the DS graphs.  Essentially, what was vector<DSNodeHandle>
before is now a DSCallSite with the same vector, plus pointers to the
CallInst and the caller Function.  The special-purpose class
BUDataStructure::CallSite is no longer needed.

llvm-svn: 4228
2002-10-20 18:07:37 +00:00
Chris Lattner
efc251af3d Convert typerec to be a structure instead of a pair
llvm-svn: 4226
2002-10-18 18:22:46 +00:00
Chris Lattner
bd5e932aeb Print Mod/ref info
llvm-svn: 4224
2002-10-17 22:13:28 +00:00
Chris Lattner
51b2abb899 Calculate mod/ref info
llvm-svn: 4223
2002-10-17 22:13:19 +00:00
Chris Lattner
4e44ccce8a Remove more obsolete code
llvm-svn: 4221
2002-10-17 20:53:12 +00:00
Chris Lattner
2ffe6a8e0b * Make the DSGraph cloner automatically merge global nodes
* BUClosure doesn't have to worry about global nodes
 * TDClosure now works with global nodes
 * Reenable DNE on TD pass, now that globals work right

llvm-svn: 4220
2002-10-17 20:09:52 +00:00
Chris Lattner
79cf8950f1 * Apparently string::find doesn't work right on our sun boxes. Work around this.
llvm-svn: 4219
2002-10-17 16:22:08 +00:00
Chris Lattner
920190f83a Remove obsolete code
llvm-svn: 4218
2002-10-17 04:58:10 +00:00
Chris Lattner
90ccd73585 Enable incompleteness marking
llvm-svn: 4217
2002-10-17 04:57:28 +00:00
Chris Lattner
15d0113fc6 Really disable pool allocator
llvm-svn: 4216
2002-10-17 04:57:09 +00:00
Chris Lattner
5028142e9a * First try at implementing TD pass this does not merge global nodes yet,
among other things.
  * Significant rewrite of TD pass to avoid potentially N^2 algorithms if
    possible.  It is still not complete, but at least it's checked in now.

llvm-svn: 4215
2002-10-17 04:26:54 +00:00
Chris Lattner
b61fe19f98 Reenable printing of TD analysis
llvm-svn: 4214
2002-10-17 04:24:30 +00:00
Chris Lattner
0c48561a9e * Add data structures and code to track the call sites for each function
llvm-svn: 4213
2002-10-17 04:24:08 +00:00
Chris Lattner
516c8391c7 Cleanup data structure graph printer, eliminate hard coded printing in
favor of generic printer.

llvm-svn: 4209
2002-10-17 01:02:46 +00:00
Chris Lattner
1e46327844 Make sure to print out the call nodes as well
llvm-svn: 4203
2002-10-16 20:16:16 +00:00
Chris Lattner
461fc88db8 Fix bug: CBackend/2002-10-16-External.ll
llvm-svn: 4201
2002-10-16 20:08:47 +00:00
Chris Lattner
278e5a3fe6 * Print the "return" node in the graphs
llvm-svn: 4199
2002-10-16 02:04:36 +00:00
Chris Lattner
3702063ff3 The second element of the iterator is really an offset, not a link
llvm-svn: 4196
2002-10-16 01:43:11 +00:00
Chris Lattner
9ed6bfa052 Specify the graph name
llvm-svn: 4195
2002-10-16 01:34:28 +00:00
Chris Lattner
afeca1f7f6 - DSGraph Printing Improvements:
* Print edge source labels again
     * Override node shape to be Mrecord again, instead of just record.

llvm-svn: 4193
2002-10-16 01:18:27 +00:00
Chris Lattner
8eaebbfd80 Fix bug: test/Regression/CBackend/2002-10-15-OpaqueTypeProblem.ll
llvm-svn: 4190
2002-10-16 00:08:22 +00:00
Chris Lattner
cb5f22396e - Fix bug: Assembler/2002-10-15-NameClash.ll
- Clean up code a bit, s/Method/Function/

llvm-svn: 4188
2002-10-15 21:41:14 +00:00
Chris Lattner
7be670ef4b - Eliminate SymbolTable::ParentSymTab, ST::localLookup, and
Function::ParentSymTab.  These aren't needed at all.

llvm-svn: 4186
2002-10-15 21:26:29 +00:00
Chris Lattner
b7af4caaf8 - Fix LLI so that it simulates the endianness of the target machine
correctly, despite the fact that the host machine might not be the same.

llvm-svn: 4180
2002-10-15 20:34:05 +00:00
Chris Lattner
6515ec02aa Make sure to escape \'s when they are output
llvm-svn: 4179
2002-10-15 19:56:24 +00:00
Chris Lattner
294eae6735 - Add an endianness field to the TargetData datastructure
llvm-svn: 4174
2002-10-14 22:41:13 +00:00
Vikram S. Adve
e4413c5804 Print "circular" warning message only in debug mode.
llvm-svn: 4170
2002-10-14 16:32:49 +00:00
Vikram S. Adve
3cb2d3379d Removed misleading const keyword.
llvm-svn: 4169
2002-10-14 16:32:24 +00:00
Vikram S. Adve
3a54b695ce Significant improvement: GEP used by a load or store no longer generates
a separate ADD; instead just use the indexed load/store instruction!
Also, a bug fix: folding a GEP with a leading non-zero index with
its predecessor was incorrect: now it only happens if the predecessor
is pointing to an indexable type (aka SequentialType).

llvm-svn: 4168
2002-10-14 16:30:55 +00:00
Chris Lattner
b16f596ab4 Allow emission of names that start with an underscore. This is needed to
interface with code that uses symbols in the ansi-c protected namespace.  In
most cases this comes from system header files, such as stdio.h.  In particular,
without this change, a reference to the __iob symbol is mangled into ll_iob,
which is not resolved by libc.

llvm-svn: 4165
2002-10-14 06:14:18 +00:00
Chris Lattner
6ee0d4ed15 Clean up code a bit, no functionality changes.
llvm-svn: 4162
2002-10-14 03:34:17 +00:00
Chris Lattner
33988dc76d There is no way to guarantee that constants are not forward referenced.
Handle forward referenced constants in a general way.  This fixes bug:
Assembler/2002-10-13-ConstantEncodingProblem.llx and allows the SPEC
197.parser benchmark to be built

llvm-svn: 4161
2002-10-14 03:33:02 +00:00
Chris Lattner
5b41b28fb6 - Dramatically simplify the Constant::mutateReferences implementation,
allowing it to be called on all constant types (structures/arrays)

llvm-svn: 4160
2002-10-14 03:30:23 +00:00
Chris Lattner
b1696e6aed This loop executed exactly one time, turn it into straightline code
llvm-svn: 4159
2002-10-14 03:28:42 +00:00
Chris Lattner
1492e49a49 Minor cleanups, no changes to functionality
llvm-svn: 4157
2002-10-14 00:48:57 +00:00
Vikram S. Adve
c6fe6822ca Don't try to compute the size of an "array" element if the index is 0:
the size may be unknown, and is not needed.

llvm-svn: 4153
2002-10-13 21:47:44 +00:00
Chris Lattner
82f54dca49 - Change Function's so that their argument list is populated when they are
constructed.  Before, external functions would have an empty argument list,
    now a Function ALWAYS has a populated argument list.

llvm-svn: 4149
2002-10-13 20:57:00 +00:00
Chris Lattner
fdf2ca9468 - Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
reflect the fact that it's a range being defined.

llvm-svn: 4147
2002-10-13 19:39:16 +00:00
Chris Lattner
ee64370eb5 Halfway conversion from custom printing to GraphWriter printing
llvm-svn: 4146
2002-10-13 19:31:57 +00:00
Chris Lattner
9d067ad595 Account for global variables resolved more accurately.
llvm-svn: 4143
2002-10-13 17:30:30 +00:00
Chris Lattner
721a5fac62 Use methods that are more explanatory
llvm-svn: 4142
2002-10-13 17:12:47 +00:00
Vikram S. Adve
e18a54c249 Use vectors instead of hash_maps for issueGaps and conflictLists.
These hash lookups were a major sink of time because they happen so often!
Also, add option to disable scheduling.

llvm-svn: 4138
2002-10-13 00:40:37 +00:00
Vikram S. Adve
211f972d28 Major bug fix: was not adding CD edges for RETURNs!
llvm-svn: 4137
2002-10-13 00:39:22 +00:00
Vikram S. Adve
7387d96d6a Use vectors instead of hash_maps for issueGaps and conflictLists.
These hash lookups were a major sink of time because they happen so often!

llvm-svn: 4136
2002-10-13 00:37:46 +00:00
Vikram S. Adve
7b920c5768 Run LICM before GCSE!
llvm-svn: 4135
2002-10-13 00:34:10 +00:00
Vikram S. Adve
7436df838d Several major fixes, particularly in emitting constant aggregates:
(1) Padding bytes between structure fields (for alignment) were never
    being emitted into the constant pool so the layout did not match!
(2) In printing constants, structures containing structures or arrays
    were never handled.
(3) Support new model for external/uninitialized/initialized globals.
    Uninitialized globals are no longer emitted since they are external.
    Initialized globals may go either in .bss or in .data.

llvm-svn: 4134
2002-10-13 00:32:18 +00:00
Vikram S. Adve
032dee9564 Don't use %l0 for large operands to a SAVE since it is needed *before* SAVE!
We now use %g1 instead since that is shared and volatile.

llvm-svn: 4133
2002-10-13 00:24:06 +00:00
Vikram S. Adve
84fa49d0e5 Don't mark JMPLCALL and JMPLRET as branches.
llvm-svn: 4132
2002-10-13 00:22:32 +00:00
Vikram S. Adve
c78e160ede (1) Try to evaluate constant when multiplying 2 constants.
(2) Use intelligent multiply selection code for array allocas.
(3) Don't use cache padding for alloca'd stack slots!
(4) Bug fix in handling call arguments: was not copying sixth FP arg
    to int reg. when calling a function with no prototype.

llvm-svn: 4130
2002-10-13 00:18:57 +00:00
Vikram S. Adve
df4ed78bc9 Eliminate duplicate target pointer in SparcRegInfo.
llvm-svn: 4129
2002-10-13 00:06:04 +00:00
Vikram S. Adve
6b459791f7 Eliminate duplicate target pointer. Also add a few assertions.
llvm-svn: 4128
2002-10-13 00:05:30 +00:00
Vikram S. Adve
dc9d94262d Make sure to handle small negative values hiding as large unsigned longs --
this is a common case created by the front-end.

llvm-svn: 4127
2002-10-13 00:04:26 +00:00
Vikram S. Adve
29dd99d98b Major fix: extract ConstantExpr nodes and decompose them into symbolic
instructions so that (a) constant folding is done automatically before
code generation, and (b) selection does not have to deal with them.
Also, check for ConstantPointerRefs in additional to GlobalValues
when creating a GEP to load a global address.

llvm-svn: 4126
2002-10-13 00:01:57 +00:00
Anand Shukla
d80a46cb42 Changed to external global var
llvm-svn: 4120
2002-10-12 20:33:47 +00:00
Nick Hildenbrandt
8dba342c37 Instead of adding stdlib we just prototype malloc correctly.
llvm-svn: 4118
2002-10-11 21:40:44 +00:00
Nick Hildenbrandt
27d9b87ed1 Sun requires you to include stdlib to use malloc
llvm-svn: 4117
2002-10-11 18:41:44 +00:00
Vikram S. Adve
be4905b56a Major bug fix: spill code for an instruction in a delay slot was
merrily being inserted before/after the instruction!

llvm-svn: 4116
2002-10-11 16:12:40 +00:00
Vikram S. Adve
f19f08c3ab Don't pad variables in stack slots for performance!
llvm-svn: 4115
2002-10-11 16:10:53 +00:00
Vikram S. Adve
5b3555bdd3 Use PARALLEL_DIRS.
llvm-svn: 4114
2002-10-11 16:08:17 +00:00
Misha Brukman
b4940744de Added capability to get execution count of a loop if it is a predictable
number of iterations.

llvm-svn: 4113
2002-10-11 05:34:32 +00:00
Misha Brukman
d55cfa6b94 Added helper functions in LoopInfo: isLoopExit and numBackEdges.
llvm-svn: 4112
2002-10-11 05:31:10 +00:00
Chris Lattner
8cd34b84b2 Stop using DataStructureGraph.h
llvm-svn: 4106
2002-10-10 20:33:46 +00:00
Chris Lattner
42547124d0 - Dramatically simplify the ConstantMerge code now that
Value::replaceAllUsesWith works with constants correctly.

llvm-svn: 4104
2002-10-09 23:16:04 +00:00
Chris Lattner
266bacb650 - Make Value::replaceAllUsesWith work with constants correctly. This fixes
bug FuncResolve/2002-08-19-ResolveGlobalVars.ll and gzip looks better.

llvm-svn: 4103
2002-10-09 23:12:59 +00:00
Chris Lattner
0acdba0025 - Add new Constant::replaceUsesOfWithOnConstant which has an end result
similar to User::replaceUsesOfWith but actually does the right thing for
    constants.

llvm-svn: 4102
2002-10-09 23:12:25 +00:00
Chris Lattner
83d105d986 Almost a complete rewrite of FunctionResolution to now resolve functions
and global variables.

This fixes bug: FuncResolve/2002-08-19-ResolveGlobalVarsEasier.ll
And bug: SingleSource/UnitTests/2002-10-09-ArrayResolution.c

Note that this does not fix bug:
FunctionResolve/2002-08-19-ResolveGlobalVars.ll because replaceAllUsesWith
breaks when a constantexpr is pointing to the thing being replaced.  This
is more of an infrastructure problem than anything.

llvm-svn: 4099
2002-10-09 21:10:06 +00:00
Chris Lattner
0e7fbf7025 Minor, non-functionality changing, formatting fix
llvm-svn: 4091
2002-10-09 00:25:32 +00:00
Chris Lattner
a8dd29787b - Remove Value::use_remove
llvm-svn: 4090
2002-10-09 00:25:05 +00:00
Chris Lattner
51d98b38f2 - Rename MTy to FTy (no methods exist anymore)
- Fix bug: LevelRaise/2002-10-08-VarArgCallInfLoop.ll

llvm-svn: 4088
2002-10-09 00:16:00 +00:00
Chris Lattner
88de60dd26 Fix NASTY N^2 behavior that was causing the gzip benchmark to take forever to
assemble.  Now we scan the use-list from the back when removing users instead
of from the front.

llvm-svn: 4086
2002-10-08 23:46:55 +00:00
Chris Lattner
4a72e094f9 Fix bug: Assembler/2002-10-08-LargeArrayPerformance.ll by using
std::vector::reserve when possible

llvm-svn: 4085
2002-10-08 23:33:52 +00:00
Chris Lattner
e8160b4dd1 - Fix bug: LevelRaise/2002-10-08-VarArgCall.ll
llvm-svn: 4083
2002-10-08 22:19:25 +00:00
Chris Lattner
d68e6d1718 - Fix bug: cee/2002-10-07-NoImmediateDominator.ll
llvm-svn: 4081
2002-10-08 21:53:51 +00:00
Chris Lattner
c35f54df86 Changes to support PHINode::removeIncoming changes
llvm-svn: 4080
2002-10-08 21:36:34 +00:00
Chris Lattner
9c236351fd Changes to support PHINode::removeIncoming changes
llvm-svn: 4079
2002-10-08 21:36:33 +00:00
Chris Lattner
f868df40b9 - Change PHINode::removeIncomingValue to delete the phi node if the last
incoming value is removed!

llvm-svn: 4078
2002-10-08 21:34:58 +00:00
Chris Lattner
40df2d9d4c - Checkin LARGE number of Changes to CEE pass that will make it much more
powerful, but that are largely disabled.  The basic idea here is that it
    is trying to forward branches across basic blocks that have PHI nodes in
    it, which are crucial to be able to handle cases like whet.ll.
    Unfortunately we are not updating SSA correctly, causing sim.c to die, and I
    don't have time to fix the regression now, so I must disable the
    functionality.

llvm-svn: 4077
2002-10-08 21:34:15 +00:00
Chris Lattner
3cf20c3f14 Expose isCriticalEdge & SplitCriticalEdge methods from crit-edges pass
llvm-svn: 4075
2002-10-08 21:06:27 +00:00
Chris Lattner
b9f59f1533 Expose new "recalculate" method from dominatorset
llvm-svn: 4074
2002-10-08 19:12:08 +00:00
Chris Lattner
b32252aa71 It is illegal for PHI nodes to have zero values, delete the code to handle them
llvm-svn: 4071
2002-10-08 17:07:39 +00:00
Chris Lattner
55c7ae3cdc Fold ashr -1, X into -1
llvm-svn: 4070
2002-10-08 16:16:40 +00:00
Chris Lattner
c532e35cce Non-functionality change just to make it more clear what is going on
llvm-svn: 4060
2002-10-07 18:34:32 +00:00
Chris Lattner
4e19009255 Global variables are now external if they don't have initializers, not
"uninitialized"

llvm-svn: 4052
2002-10-06 22:48:09 +00:00
Chris Lattner
d8244f43d4 Check that we don't have external varaibles with internal linkage
llvm-svn: 4051
2002-10-06 22:47:32 +00:00
Chris Lattner
6408586b7b The parser now accepts "external" global variables, in addition to the backwards
compatible "uninitialized" global variables

llvm-svn: 4050
2002-10-06 22:45:09 +00:00
Chris Lattner
53a414c3c4 PHI nodes are not allowed to exist with zero incoming values, check that
there aren't any like this.

llvm-svn: 4044
2002-10-06 21:00:31 +00:00
Vikram S. Adve
6932399f9b Bug fix: In preventing static global variables from being printed twice,
I also prevented external globals from being printed twice, but they
should (extern declaration and definition).

llvm-svn: 4043
2002-10-05 23:43:10 +00:00
Anand Shukla
d49d35f562 Added #include<unistd.h> to compile with solaris gcc3.2
llvm-svn: 4042
2002-10-04 23:57:01 +00:00
Anand Shukla
02acbe2c93 added cast to unsigned to compile with gcc3.2 (sparc)
llvm-svn: 4041
2002-10-04 23:56:18 +00:00
Chris Lattner
a923b0f49f Handle post dominance correctly in the case where blocks do not have a path to
the exit node.

llvm-svn: 4038
2002-10-04 14:50:20 +00:00
Chris Lattner
85ba0832e5 Fix a nasty problem with dominance calculation for unreachable blocks.
If we had a CFG that look like Entry -> B, Unreachable -> B, then we would
not correctly determine that Entry dominated B, because Entry did not
apparently dominate "unreachable".  This patch fixes this by making the entry
node dominate all blocks, including unreachable ones.

llvm-svn: 4037
2002-10-04 14:45:48 +00:00
Chris Lattner
eeecc3e1b3 Prune function nodes that are no longer referenced due to inlining
llvm-svn: 4036
2002-10-03 21:55:28 +00:00
Chris Lattner
8f603615d8 sgefa uses truely huge data structures nodes. Only print part of them if they
are so big

llvm-svn: 4035
2002-10-03 21:55:13 +00:00
Chris Lattner
31d4a68166 Handle bug exposed by power benchmark
llvm-svn: 4033
2002-10-03 21:06:38 +00:00
Nick Hildenbrandt
1ccdc12400 Add parens around constant calls to getelemptr to properly associate the reference
llvm-svn: 4032
2002-10-03 20:47:24 +00:00
Chris Lattner
fcdb95cd42 Reimplement/port the Bottom Up Closure pass
llvm-svn: 4031
2002-10-03 20:38:41 +00:00
Chris Lattner
e52f808665 DataStructure.h doesn't include DSGraph.h
llvm-svn: 4029
2002-10-02 22:14:38 +00:00
Nick Hildenbrandt
1477c5282f I was wrong on the removing of those references on the last commit.
llvm-svn: 4023
2002-10-02 21:14:33 +00:00
Chris Lattner
bdbc272229 * Implement the getc() function
* Support usage of stdin, stdout & stderr correctly in LLI!

llvm-svn: 4022
2002-10-02 21:12:13 +00:00
Chris Lattner
f6b465732c Cleanup #includes, expose module
llvm-svn: 4021
2002-10-02 21:11:16 +00:00
Chris Lattner
68960ff1c7 Expose TD to ExternalFunctions.cpp
llvm-svn: 4020
2002-10-02 21:10:48 +00:00
Chris Lattner
94a5211b6a - Print the predecessors of a basic block instead of the number of uses of
the block in the AsmWriter

llvm-svn: 4019
2002-10-02 19:38:55 +00:00
Chris Lattner
88c8ffce8b Fix bug: 2002-10-02-SignExtensionProblem.ll
llvm-svn: 4017
2002-10-02 18:53:14 +00:00
Nick Hildenbrandt
d090d15736 Removed unneeded reference and dereferences.
llvm-svn: 4016
2002-10-02 18:34:51 +00:00
Nick Hildenbrandt
5d1a2cf4b1 Cleaned up my last check-in.
llvm-svn: 4014
2002-10-02 18:32:35 +00:00
Nick Hildenbrandt
f9aa2b4886 No longer include malloc.h. If protoypes are needed for memory functions they will be present in the byte code and the generated c as well.
llvm-svn: 4013
2002-10-02 18:20:18 +00:00
Chris Lattner
62ca2aa593 * Implement fully general merging of array subscripts on demand! This
does not handle the initial pointer index case yet though.

llvm-svn: 4012
2002-10-02 06:24:36 +00:00
Chris Lattner
5f38d9c112 When printing DS nodes, print the mergemap index as well to allow easier
debugging of merging process.

llvm-svn: 4010
2002-10-02 05:17:55 +00:00
Chris Lattner
8c25c1a641 * Significant rework of DSNode to support arbitrary aliasing due to merging
* Now all and any bytes of a DSNode can be merged together individually.  This
  is neccesary to support the full generality of C and support aliasing
  correctly.

llvm-svn: 4008
2002-10-02 04:57:39 +00:00
Chris Lattner
3fec0954e8 Changes to work with Statistics rework
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.

llvm-svn: 4004
2002-10-01 22:40:31 +00:00
Chris Lattner
7cf9f6f4b1 Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.

llvm-svn: 4002
2002-10-01 22:38:41 +00:00
Chris Lattner
4cc183889f Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.

llvm-svn: 4001
2002-10-01 22:38:37 +00:00
Chris Lattner
b5d3e33496 Build subdirs in parallel
llvm-svn: 4000
2002-10-01 22:36:35 +00:00
Chris Lattner
c2322d5fac - Rework Statistics:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.

llvm-svn: 3999
2002-10-01 22:35:45 +00:00
Chris Lattner
9fc451723d Initial checkin of Steensgaards context insensitive flow insensitive
alias analysis

llvm-svn: 3997
2002-10-01 22:34:12 +00:00
Chris Lattner
c1b7de86d5 Checkin some major reworks of data structure analysis. This is not done,
nor does it work very well, but I need to get it checked in before I break
the tree unintentionally.

llvm-svn: 3996
2002-10-01 22:33:50 +00:00
Chris Lattner
9a8022871b Make sure to use the TimerGroup that we created!
llvm-svn: 3995
2002-10-01 20:12:06 +00:00
Chris Lattner
10fd9ad81e Make sure not to count the PassManager wrapers
llvm-svn: 3994
2002-10-01 20:08:11 +00:00
Chris Lattner
b7a507eb31 Factor timer code out of PassManager implementation, into a generic interface
exposed by Support/Timer.h.

llvm-svn: 3993
2002-10-01 19:54:07 +00:00
Chris Lattner
9b38808792 Checkin generic interval timer support
llvm-svn: 3992
2002-10-01 19:36:54 +00:00
Nick Hildenbrandt
1defd8270c Fixed to properly escape quotes in strings.
llvm-svn: 3991
2002-09-30 21:11:55 +00:00
Chris Lattner
53be50fb2f Minor tweak
llvm-svn: 3985
2002-09-29 22:59:29 +00:00
Vikram S. Adve
01e64b5eef Bug fix in folding getElementPtr instructions: don't fold one into
a predecessor if it has a non-zero first index and the predecessor
ends with a struct index.

llvm-svn: 3982
2002-09-29 22:55:05 +00:00
Chris Lattner
e3eaa16375 Fix a problem that was caused by stale analyses being in CurrentAnalyses
llvm-svn: 3981
2002-09-29 22:50:22 +00:00
Chris Lattner
61e8de1c61 Fix bug in LICM that caused the previous big win. :(
llvm-svn: 3980
2002-09-29 22:26:07 +00:00
Chris Lattner
ef0e95bb42 Hoist the contents of Loops in depth first order in the dominator tree,
rather than in random order.  This causes LICM to be DRAMATICALLY more
effective. For example, on bzip2.c, it is able to hoist 302 loads and
2380 total instructions, as opposed to 44/338 before.  This  obviously
makes other transformations much more powerful as well!

llvm-svn: 3978
2002-09-29 21:46:09 +00:00
Chris Lattner
45c83d6451 Fix printing of loop information
llvm-svn: 3977
2002-09-29 21:43:04 +00:00
Chris Lattner
2a7dd8373f Improve printing of dominator sets
llvm-svn: 3976
2002-09-29 21:42:42 +00:00
Chris Lattner
b731880895 Fix major bugs in dominator set & tree information updating
llvm-svn: 3975
2002-09-29 21:41:38 +00:00
Vikram S. Adve
69d19cf9a9 Convert DIRS to PARALLEL_DIRS. They can be built independently.
llvm-svn: 3972
2002-09-29 11:52:14 +00:00
Vikram S. Adve
59778ef96d Added a couple of helper methods for live range construction.
llvm-svn: 3970
2002-09-28 17:05:43 +00:00
Vikram S. Adve
2710051771 Live ranges for Return value and return address of a Call are now
created here, simply by handling all implicit operands (which should
have been done anyway).

llvm-svn: 3969
2002-09-28 17:05:22 +00:00
Vikram S. Adve
7e39b876eb Fixed method getReturnValue(): it should return NULL if the
callee does not return a value.

llvm-svn: 3968
2002-09-28 17:03:54 +00:00
Vikram S. Adve
7c0175962a Fixed incorrect assertion: spill code for function ptr should be
handled like normal operands, not like other call arguments.

llvm-svn: 3967
2002-09-28 17:02:40 +00:00
Vikram S. Adve
eb6d37c32b Return address register should be marked as "result" for the JMPL instruction
since it is defined by the instruction.

llvm-svn: 3966
2002-09-28 17:00:15 +00:00
Vikram S. Adve
06742cc0e0 Live ranges for Return value and return address of a Call are no longer
created here.  Instead they are created in LiveRangeInfo.cpp.  This
simplifies the code here quite a bit.

llvm-svn: 3965
2002-09-28 16:59:05 +00:00
Vikram S. Adve
1aed35b2e5 Simplified code that handles call args and rets, so it no longer
needs the RegClass list to be passed in.

llvm-svn: 3964
2002-09-28 16:56:59 +00:00
Vikram S. Adve
33b21ec523 Simplify Call translation slightly.
llvm-svn: 3963
2002-09-28 16:55:41 +00:00
Vikram S. Adve
940f3fa91b Overhaul integer conversions to match C++ ISO standard.
Don't allow direct FP-to-uint conversion (must be eliminated by preselection).
Address arithmetic for arrays is now entirely 64-bit so no sign-ext needed.

llvm-svn: 3961
2002-09-27 14:33:08 +00:00
Vikram S. Adve
ae0af2a164 Modify operand order for Create{Sign,Zero}ExtensionInstructions.
llvm-svn: 3960
2002-09-27 14:29:45 +00:00
Vikram S. Adve
2a87b4496f Bug fix: some redundant copies were not being deleted after detection :-|.
llvm-svn: 3959
2002-09-27 14:27:37 +00:00
Vikram S. Adve
c795b90eac Sign-extend integer constants from original type size to 64 bits!
llvm-svn: 3958
2002-09-27 14:26:20 +00:00
Vikram S. Adve
6cff79b3e1 Decompose FP-to-UInt casts into FP-to-ULong-toUInt.
llvm-svn: 3957
2002-09-27 14:24:45 +00:00
Chris Lattner
a9bc408104 First try at implementing the AliasSetTracker class. I'm sure it will need
revision as I start to use it though.

llvm-svn: 3954
2002-09-26 21:49:07 +00:00
Chris Lattner
0bbb8f6e06 - Further cleanups of LICM pass, remove extra work from previous implementation
- Do not clone instructions then insert clone outside of loop.  Just move them.

llvm-svn: 3951
2002-09-26 19:40:25 +00:00