1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 13:33:37 +02:00
Commit Graph

4362 Commits

Author SHA1 Message Date
Chris Lattner
7310978a8b Update to use correct type cast
llvm-svn: 536
2001-09-10 20:08:08 +00:00
Chris Lattner
b15a10307e Add support for global variables
llvm-svn: 535
2001-09-10 20:07:57 +00:00
Chris Lattner
52084c119f Fix a bug I introduced (assertion failed: Unknown operand type), and convert to predicate style for type checks
llvm-svn: 531
2001-09-10 19:43:38 +00:00
Chris Lattner
9d1629d688 Implement global variable support
llvm-svn: 530
2001-09-10 07:58:01 +00:00
Chris Lattner
3e7417ba99 Add support for external methods
llvm-svn: 529
2001-09-10 04:50:17 +00:00
Chris Lattner
34c9e1a6fb Genericize support for calling functions a bit
Add external method support

llvm-svn: 528
2001-09-10 04:49:44 +00:00
Chris Lattner
0754f2306a Remove the definitions of 3 global functions that don't belong in the core
llvm-svn: 526
2001-09-09 23:02:07 +00:00
Chris Lattner
69a3da6f4d Implement the subset of the GetConstantValueAsSignedInt function that is needed, locally. Remove the two support functions to inline their contents.
llvm-svn: 525
2001-09-09 23:01:47 +00:00
Chris Lattner
3bce6b369a Implement the subset of the GetConstantValueAsSignedInt function that is needed, locally.
llvm-svn: 524
2001-09-09 23:01:32 +00:00
Chris Lattner
9985e9db71 Rename contype to subtype
llvm-svn: 522
2001-09-09 22:26:58 +00:00
Chris Lattner
c583ae1a1a Make ADCE more robust, it still has problems, but it's getting closer
llvm-svn: 521
2001-09-09 22:26:47 +00:00
Chris Lattner
d681b883a6 Fix problems with freeing memory twice
llvm-svn: 520
2001-09-09 22:26:29 +00:00
Chris Lattner
4bb7fcff1b Rename file to be consistent with header name
llvm-svn: 519
2001-09-09 21:59:43 +00:00
Chris Lattner
45768e6fe5 Clean up Type class by removing mutable ConstRules member and use annotations insead
llvm-svn: 516
2001-09-09 21:02:38 +00:00
Chris Lattner
91858f96f2 Clean up ConstRules stuff to use annotations instead of a mutable member in Type
llvm-svn: 515
2001-09-09 21:01:20 +00:00
Vikram S. Adve
5458bc59fd Handle cast float-to-float or cast double-to-double.
llvm-svn: 512
2001-09-09 20:35:34 +00:00
Chris Lattner
2e74f6ba1f Fix build breakage. :(
llvm-svn: 511
2001-09-09 19:52:23 +00:00
Chris Lattner
b095aaa8f4 I really don't like it when people break the build.
llvm-svn: 510
2001-09-09 19:41:52 +00:00
Ruchira Sasanka
4f3751ecdd Committed for compliation. Not yet final.
--Ruchira

llvm-svn: 505
2001-09-08 14:22:50 +00:00
Ruchira Sasanka
1c3c6a2fd2 --Ruchira
llvm-svn: 504
2001-09-08 14:10:34 +00:00
Chris Lattner
5e9c4e67c2 Make use of the new TOOLNAME/USEDLIBS options provided in Makefile.common
llvm-svn: 501
2001-09-07 22:59:25 +00:00
Chris Lattner
74dcfcd89b Updates to work with new lack of constant pool
llvm-svn: 490
2001-09-07 21:22:57 +00:00
Chris Lattner
beefdaad8b Remove unneeded #includes
llvm-svn: 489
2001-09-07 21:22:28 +00:00
Chris Lattner
fd10317614 Remove unnecesary #include add dump calls pulled out of .h file
llvm-svn: 488
2001-09-07 21:21:03 +00:00
Chris Lattner
c1ca76ff89 * Remove lots of #includes
llvm-svn: 487
2001-09-07 21:19:42 +00:00
Chris Lattner
9aac44442d Add tags so emacs knows these are C++ files
llvm-svn: 483
2001-09-07 21:04:20 +00:00
Chris Lattner
9570fbc913 Moved functionality into the other constant pool stuff
llvm-svn: 477
2001-09-07 18:00:19 +00:00
Chris Lattner
e1acc842ba The header file for a translation unit should always be included first
System headers should be last

llvm-svn: 475
2001-09-07 17:18:30 +00:00
Chris Lattner
796e9f8118 A file should always include it's private header file *FIRST* see the
coding guidelines

llvm-svn: 474
2001-09-07 17:15:18 +00:00
Chris Lattner
78c2f4ab17 Annotations are now const
llvm-svn: 470
2001-09-07 16:59:15 +00:00
Chris Lattner
078b48a3f4 Cleanup
llvm-svn: 467
2001-09-07 16:57:29 +00:00
Chris Lattner
1dd250de63 Support abstract types
Remove constant pool support

llvm-svn: 466
2001-09-07 16:57:07 +00:00
Chris Lattner
873e0fdbf9 Support a abstract, opaque, and recursive types
Remove lockty, remove fillerty
Make type lookup more efficient
Support shared generic factory code

llvm-svn: 465
2001-09-07 16:56:42 +00:00
Chris Lattner
daf98ba299 Types and constnats are wierd objects in the symtabs
Support abstract types in symtab

llvm-svn: 464
2001-09-07 16:48:17 +00:00
Chris Lattner
e3a3aa89f3 Modules must have a valid, nonnull type. Make them void
llvm-svn: 463
2001-09-07 16:47:42 +00:00
Chris Lattner
aeaeab832b Support new setName interface
llvm-svn: 462
2001-09-07 16:47:18 +00:00
Chris Lattner
0e510b8267 * Support new setname interface
* Add assertion for sanity checking

llvm-svn: 461
2001-09-07 16:47:03 +00:00
Chris Lattner
9c4eb70eae * Cnstants are now global objects
* ConstantPools no longer exist
* Constants are global objects in the LLVM system
* Constants are structurally equilivant if they are pointer equilivant
* Support abstract & opaque types
* Support setName on constants even though they don't track names
* Constnats don't get copy ctors anymore
* ConstPoolVal::equals is no longer useful [use ptr equivalency]
* Support generic factory classes to create and maintain constants

llvm-svn: 460
2001-09-07 16:46:31 +00:00
Chris Lattner
d2c013e34c Support new setName itf
llvm-svn: 459
2001-09-07 16:44:17 +00:00
Chris Lattner
99e8b0589f Annotations are const objects now
llvm-svn: 458
2001-09-07 16:44:01 +00:00
Chris Lattner
e299925703 Types and constants are wierd things in symbol tables now
llvm-svn: 457
2001-09-07 16:43:50 +00:00
Chris Lattner
b82abeff92 * Eliminate reference to ConstantPool class
* Constants are global objects that are not allocated or freed

llvm-svn: 456
2001-09-07 16:43:22 +00:00
Chris Lattner
797730ca28 Constant pool is dead
llvm-svn: 455
2001-09-07 16:42:51 +00:00
Chris Lattner
4fc1bcadd9 Constants are now global unique objects
llvm-svn: 454
2001-09-07 16:42:26 +00:00
Chris Lattner
eaf4551d57 * Eliminate constant pool dependancies:
* Eliminate DoRemoveUnusedConstants

llvm-svn: 453
2001-09-07 16:42:08 +00:00
Chris Lattner
6a211421bf * Supoprt global constants
* Remove support for local constant pools
* Eliminate constant pool merging method, which is no longer neccesary
* Disable invalid optimization (todo: fix it)

llvm-svn: 452
2001-09-07 16:41:30 +00:00
Chris Lattner
652b08d465 * Support global constants
* Eliminate need for constant pool

llvm-svn: 451
2001-09-07 16:40:34 +00:00
Chris Lattner
caac8de99d annotations are now const
llvm-svn: 450
2001-09-07 16:40:04 +00:00
Chris Lattner
28154ea366 * Emit bytecode using a deque instead of a vector to be faster
* Internal rep no longer has a constant pool
* Support emission of recursive types
* Don't output a constant pool for an external method
* The bytecode writer is no longer a module analyzer

llvm-svn: 449
2001-09-07 16:39:41 +00:00
Chris Lattner
0d073caf6c * Remove support for internal constant pool
* Support globally unique constants
* Support recursive and forward referenced types
* Support abstract types
* Add new BCR_TRACE macro to enable debugging of why the bytecode reader
  occasionally refuses to read something

llvm-svn: 448
2001-09-07 16:37:43 +00:00
Chris Lattner
c189163d03 * Assembly writer is not a module analyzer anymore
* There is no constant pool anymore

llvm-svn: 447
2001-09-07 16:36:04 +00:00
Chris Lattner
b8f60e50f3 * Add support for forward referencing types
* Add support for upreferences for recursive types
* Remove support for ConstantPool.h
* Add support for globally unique Constants
* Add support for the opaque type

llvm-svn: 446
2001-09-07 16:35:17 +00:00
Chris Lattner
1a53e079fd Add support for forward referencing types
llvm-svn: 445
2001-09-07 16:33:01 +00:00
Chris Lattner
f590e0c914 Add support for an opaque type
llvm-svn: 444
2001-09-07 16:32:43 +00:00
Chris Lattner
fddd7fbc2c Remove #include of nonexistant header file
llvm-svn: 443
2001-09-07 16:32:10 +00:00
Chris Lattner
35ea5501a8 * Slot calc is now simpler and not based on module analyzer.
* Add new SC_DEBUG option to enable debugging of why stuff doesn't work

llvm-svn: 442
2001-09-07 16:31:52 +00:00
Chris Lattner
f1f36de564 Module analyzer no longer has to iterate over constant pool
llvm-svn: 441
2001-09-07 16:31:23 +00:00
Chris Lattner
8bd3097d81 Simplify code by eliminating need to hang onto constant pool references
llvm-svn: 440
2001-09-07 16:31:04 +00:00
Ruchira Sasanka
fb626ffffe *** empty log message ***
llvm-svn: 412
2001-08-31 20:59:58 +00:00
Vikram S. Adve
28e3131d5c Added directory LiveVar/
llvm-svn: 410
2001-08-28 23:29:31 +00:00
Vikram S. Adve
b79b5f6b8b Added nonterminals for arithmetic operations where one operand is constant.
llvm-svn: 406
2001-08-28 23:25:46 +00:00
Vikram S. Adve
9fd1f9c1c2 Makefile for InstrSched/
llvm-svn: 403
2001-08-28 23:17:22 +00:00
Vikram S. Adve
778fc57b85 Remove source list.
llvm-svn: 402
2001-08-28 23:16:59 +00:00
Vikram S. Adve
49fddd4df3 Added directory InstrSched.
llvm-svn: 401
2001-08-28 23:16:13 +00:00
Vikram S. Adve
789dcfe59c Major changes too hard to document :-)
llvm-svn: 400
2001-08-28 23:12:57 +00:00
Vikram S. Adve
5947c43319 Extensive additions for supporting instruction scheduling.
llvm-svn: 398
2001-08-28 23:10:41 +00:00
Vikram S. Adve
f9fa4cc579 Added class MachineSchedInfo and several supporting classes
as a machine description for instruction scheduling.

llvm-svn: 397
2001-08-28 23:09:36 +00:00
Vikram S. Adve
ad002e37d5 Implementation of instruction scheduling for LLVM.
Currently schedules one basic block at a time.

llvm-svn: 396
2001-08-28 23:07:19 +00:00
Vikram S. Adve
91d73a52d5 Class that encapsulates priority heuristics for instruction scheduling.
llvm-svn: 395
2001-08-28 23:06:49 +00:00
Vikram S. Adve
23be1e0839 Scheduling DAG for instruction scheduling. Currently for a single basic block.
llvm-svn: 394
2001-08-28 23:06:02 +00:00
Vikram S. Adve
8fdc52a63d Moved debug options declaration to header file, and moved
a function to MachineInstr.cpp.

llvm-svn: 393
2001-08-28 23:04:38 +00:00
Vikram S. Adve
89228a786c Moved function PrintMachineInstructions here.
llvm-svn: 392
2001-08-28 23:02:39 +00:00
Vikram S. Adve
fe68c73977 analyze() now checks to see that we don't analyze the same method twice.
Needs a mechnanism to override this check (e.g., after a transformation).

llvm-svn: 391
2001-08-28 22:36:35 +00:00
Vikram S. Adve
4c03772b2a *** empty log message ***
llvm-svn: 390
2001-08-28 22:35:21 +00:00
Chris Lattner
f3b74b4736 I suck
llvm-svn: 385
2001-08-27 18:54:45 +00:00
Chris Lattner
6336546710 Initial checkin of TargetData code
llvm-svn: 384
2001-08-27 16:00:15 +00:00
Chris Lattner
eaebbaf5bc Remove target specific stuff from Type classes
llvm-svn: 383
2001-08-27 15:52:13 +00:00
Chris Lattner
3b527dd79e Remove target specific method from MemAccessInst class
llvm-svn: 382
2001-08-27 15:51:43 +00:00
Chris Lattner
3eb05bbef1 Convert to use the new factored out TargetData class
llvm-svn: 381
2001-08-27 15:51:16 +00:00
Chris Lattner
6ea0dfcd7e Factor code out to the TargetData class
llvm-svn: 380
2001-08-27 15:50:41 +00:00
Chris Lattner
b04aee8d08 Support passing a data pointer to annotation factory methods
llvm-svn: 376
2001-08-27 05:19:10 +00:00
Chris Lattner
d2af693cd9 Demolish explicit source list
llvm-svn: 375
2001-08-27 05:18:35 +00:00
Chris Lattner
0a85e4845d Lots of new functionality
llvm-svn: 372
2001-08-27 05:16:50 +00:00
Chris Lattner
9eaf62df4a Remove explicit source list
llvm-svn: 371
2001-08-25 20:40:32 +00:00
Chris Lattner
a6357a1101 Make sure noone branches to the entry node of the method
llvm-svn: 369
2001-08-24 14:56:34 +00:00
Chris Lattner
d381beea6a Add annotation support
llvm-svn: 366
2001-08-23 17:07:56 +00:00
Chris Lattner
b2c70da37a Handle case where there is no exit node from a flowgraph
llvm-svn: 365
2001-08-23 17:07:19 +00:00
Chris Lattner
5882b500cf Changed an assertion message
llvm-svn: 364
2001-08-23 17:06:38 +00:00
Chris Lattner
8e225d7a21 Initial checkin of interpreter
llvm-svn: 361
2001-08-23 17:05:04 +00:00
Ruchira Sasanka
bc7068b2e4 LV code on machine instructions
llvm-svn: 360
2001-08-20 21:12:49 +00:00
Ruchira Sasanka
74f3230149 LV info on machine instructions
llvm-svn: 359
2001-08-20 21:11:01 +00:00
Vikram S. Adve
33b366f516 Always set isDef for operand in position resultPos.
llvm-svn: 357
2001-08-13 16:32:45 +00:00
Ruchira Sasanka
af7ba34d58 Changed SetMachineOpernad calls in Set3OperandsFromInstr so that the
result position is a def (i.e., added true to the end of call) -- Ruchira

llvm-svn: 356
2001-08-13 16:26:28 +00:00
Ruchira Sasanka
c75929f547 Changed case 64 to make the first arg of phi a defintion
llvm-svn: 355
2001-08-13 16:24:01 +00:00
Ruchira Sasanka
a6cea3a426 *** empty log message ***
llvm-svn: 351
2001-08-07 21:01:23 +00:00
Ruchira Sasanka
01c14da143 added a default isDef arg to SetMachineOperand method - Ruchira
llvm-svn: 350
2001-08-07 20:16:52 +00:00
Vikram S. Adve
d0579dd4ee Add CC operand as 4th operand of SUBcc, and mark it as a def.
llvm-svn: 348
2001-08-06 21:06:10 +00:00
Vikram S. Adve
b1cd3ba259 Also, move burg rule to Makefile.common.
llvm-svn: 346
2001-08-06 19:06:56 +00:00
Vikram S. Adve
95ee2f4d4c Better still, lets move pathname for Burg to Makefile.common.
llvm-svn: 344
2001-08-06 19:01:45 +00:00
Vikram S. Adve
6e358709c6 Use full pathname for burg.
llvm-svn: 342
2001-08-06 18:53:26 +00:00
Vikram S. Adve
62f5a2a6bb Simplify command line options, and add option for printing
machine instructions without debugging info.

llvm-svn: 340
2001-07-31 21:53:25 +00:00
Vikram S. Adve
d5c5e27191 Added tree nodes for Phi instructions.
llvm-svn: 338
2001-07-31 21:50:29 +00:00
Vikram S. Adve
5dcec96655 Generate tree nodes for Phi instructions.
llvm-svn: 337
2001-07-31 21:49:53 +00:00
Vikram S. Adve
46dd49a011 Allow machine instructions with variable numbers of arguments.
This is used only by Phi for now.

llvm-svn: 336
2001-07-31 21:49:28 +00:00
Vikram S. Adve
a0061d1f8a Generate dummy Phi machine instruction, plus a bug fix for BrCond(boolreg).
llvm-svn: 334
2001-07-31 21:46:57 +00:00
Vikram S. Adve
93d07dc925 Record machine instructions in the vector for each basic block.
llvm-svn: 331
2001-07-30 18:48:43 +00:00
Vikram S. Adve
a91d7cb350 Added vector of machine instructions for the basic block.
llvm-svn: 330
2001-07-30 18:47:24 +00:00
Chris Lattner
75298e1fd2 Remove some gross stuff
llvm-svn: 328
2001-07-28 17:52:53 +00:00
Chris Lattner
d22d55b65a Allow vararg method types with 0 fixed types
llvm-svn: 327
2001-07-28 17:52:35 +00:00
Chris Lattner
b3d06b4ec9 Make error msg nicer
llvm-svn: 326
2001-07-28 17:52:14 +00:00
Chris Lattner
a4b4e46e90 Enable the elimination of method prototypes that are not referenced
llvm-svn: 325
2001-07-28 17:51:49 +00:00
Chris Lattner
64c7f2be62 * Make sure that the size of the type field can also control the output
instruction pattern.

llvm-svn: 324
2001-07-28 17:51:21 +00:00
Chris Lattner
29c977bd03 * Add calls to failure template so that it is actually possible to debug
why bytecode parsing is failing.  Just put a breakpoint in the failure
  templates.

llvm-svn: 323
2001-07-28 17:50:18 +00:00
Chris Lattner
92c31e1634 * Fix bugs
llvm-svn: 322
2001-07-28 17:49:02 +00:00
Chris Lattner
c6b1a790d1 * Enable the use of escaped literal strings
* Unresolved variable names now have the correct line number for their
  error messages
* Rename Def* to Value*
* Check for symbol table collisions before inserting values
* Remove the STRING keyword
* Enable the use of string literals to initialize constant arrays
* Enable the use of extended constants in more locations: eg ret [int] [4, 5]
* Allow method prototypes to appear in the constant pool of the program
* Support varargs methods better.  Enable varargs methods with 0 fixed
  arguments
* Allow the entire method prototype to optionally be specified in a call inst

llvm-svn: 321
2001-07-28 17:48:55 +00:00
Vikram S. Adve
ea2f7ed7e9 Added UltraSparcInstrInfo class to specialize class MachineInstrInfo.
Relevant changes elsewhere:
Added MachineInstrInfo class and moved instruction-related members there.
Added several fields to MachineInstrDescriptor (and renamed it from
MachineInstrInfo.  Latency fields are to support scheduling.

llvm-svn: 311
2001-07-28 04:19:10 +00:00
Vikram S. Adve
137f8efbf0 Eliminate unused function.
llvm-svn: 310
2001-07-28 04:15:45 +00:00
Vikram S. Adve
2ae79d3e16 Bug fixes:
Store bool result in register after SetCC if the bool value
is used by anything other than a branch.
Forward-substitute operand of a VM instruction for which no
machine instruction is generated (e.g., Cast).
Other changes due to changes to classes TargetMachine and MachineInstr.

llvm-svn: 309
2001-07-28 04:15:15 +00:00
Vikram S. Adve
ce164753ad Added MachineInstrInfo class and moved instruction-related members there.
Added several fields to MachineInstrDescriptor (and renamed it from
MachineInstrInfo.  Latency fields are to support scheduling.

llvm-svn: 308
2001-07-28 04:09:37 +00:00
Vikram S. Adve
a6bcc3a47e Eliminate separate enum for operand register type.
Use union for alternative data for different operand types.
Add iterator over Value* operands in a MachineInstr.

llvm-svn: 307
2001-07-28 04:06:37 +00:00
Chris Lattner
55c9388cc7 Don't write out constants that do not have a name, they will be inlined.
llvm-svn: 305
2001-07-26 16:29:38 +00:00
Chris Lattner
66dd058589 Refactor some of the constant stuff so that we can return complex constant
values directly.  This was causing test failures. :(

llvm-svn: 304
2001-07-26 16:29:15 +00:00
Chris Lattner
5a8abf8a9a Add an arg to insertVal to allow us to prevent builtin types from being ignored
when they are inserted.

Ignore constant values without names.  If they are used, they will be inlined.

llvm-svn: 303
2001-07-26 16:28:37 +00:00
Chris Lattner
fc1d7dd221 Add support for extern varargs methods & varargs method calls
llvm-svn: 297
2001-07-25 22:47:55 +00:00
Chris Lattner
8cae208dfb Add support for extern varargs methods & varargs method calls
Remove tool generated files

llvm-svn: 296
2001-07-25 22:47:46 +00:00
Chris Lattner
c4eb54d2db Fix a bug when compiling 'shl ubyte * %var, ubyte 2'
llvm-svn: 295
2001-07-25 22:47:32 +00:00
Chris Lattner
8de7c629dd Fixed a bug exposed when doing something like this: <program> -notanoption --help
llvm-svn: 293
2001-07-25 18:40:49 +00:00
Ruchira Sasanka
f75118336e Changed printValue() to print constant value if the value is a constant.
llvm-svn: 292
2001-07-24 18:21:21 +00:00
Ruchira Sasanka
12710ee1b2 *** empty log message ***
llvm-svn: 291
2001-07-24 17:14:13 +00:00
Chris Lattner
aafababdd2 Doh! Wrong Optional flag. :(
llvm-svn: 290
2001-07-23 23:14:23 +00:00
Chris Lattner
501f2d27ea Add a comment indicating that there is documentation of the library
llvm-svn: 289
2001-07-23 23:04:07 +00:00
Chris Lattner
866521c345 Minor changes to implementation of CommandLine library to let users override
options forced by different  subclasses of Option

llvm-svn: 286
2001-07-23 23:02:45 +00:00
Chris Lattner
3e365b974b CommandLine library cleanup. No longer use getValue/setValue, instead, just treat the commandline
args as the objects they represent and the "right thing" will happen

llvm-svn: 283
2001-07-23 19:27:24 +00:00
Chris Lattner
2b73dd7866 Doh! Wrong accessor. Caused 'can not read bytecode' errors. :(
llvm-svn: 282
2001-07-23 18:51:23 +00:00
Chris Lattner
a601339af2 Eliminated the Unique class in favor of NonCopyable and NonCopyableV
llvm-svn: 280
2001-07-23 18:26:21 +00:00
Chris Lattner
ff6c44f04f Moved inline/llvm/Tools/* to include/llvm/Support/*
llvm-svn: 279
2001-07-23 17:46:59 +00:00
Chris Lattner
59f8477b5c Initial checkin
llvm-svn: 278
2001-07-23 17:17:47 +00:00
Chris Lattner
e847a66947 Clean up hash table usage
Remove opaque pointer used for C compatibility which isn't an issue

llvm-svn: 275
2001-07-23 03:50:57 +00:00
Chris Lattner
d73669f4c6 Removal of the redundant CompileContext wrapper
llvm-svn: 274
2001-07-23 03:09:03 +00:00
Chris Lattner
f42a7804c8 Large scale changes to implement new command line argument facility
llvm-svn: 272
2001-07-23 02:35:57 +00:00
Chris Lattner
350f414175 Remove dependence on command line library. Silly anyway.
llvm-svn: 271
2001-07-22 18:36:00 +00:00
Chris Lattner
c5758cb574 Privatize LLCOptions. It had no business being visible to the entire
program.

llvm-svn: 267
2001-07-22 04:40:02 +00:00
Chris Lattner
9329758c8c Eliminate lots of unnecessary #includes and forward decls
there are probably more to kill

llvm-svn: 261
2001-07-21 23:24:48 +00:00
Chris Lattner
ca2a14b6a3 Eliminate many unneccesary #includes
llvm-svn: 260
2001-07-21 22:59:56 +00:00
Chris Lattner
f586a0a5cb Make code fit in 80 columns more
llvm-svn: 259
2001-07-21 22:57:05 +00:00
Chris Lattner
56bd9d029e Remove unneccesary #includes
llvm-svn: 258
2001-07-21 22:53:35 +00:00
Chris Lattner
846fdcd762 Exterminate nasty Cisms
llvm-svn: 257
2001-07-21 22:42:09 +00:00
Chris Lattner
5ad9c0fe87 Refer to include/llvm/CodeGen not Codegen
llvm-svn: 256
2001-07-21 22:32:34 +00:00
Chris Lattner
95de507872 Make sure we build all of the code!
llvm-svn: 254
2001-07-21 21:04:03 +00:00
Chris Lattner
f1a2e3b6bb Renamed include/llvm/Codegen to include/llvm/CodeGen
llvm-svn: 253
2001-07-21 20:58:30 +00:00
Chris Lattner
1104f35aaf Fix code to be in a consistent style
llvm-svn: 252
2001-07-21 20:09:07 +00:00
Chris Lattner
7482575151 Remove getTempValuesForMachineCode from the Instruction interface
to remove dependency on <vector>

llvm-svn: 250
2001-07-21 20:04:10 +00:00
Chris Lattner
5bc03696de Moved LLC subdir to the tools top level directory
llvm-svn: 248
2001-07-21 19:33:01 +00:00
Chris Lattner
bf2c12c224 Add new ctor for ConstPoolBool
llvm-svn: 246
2001-07-21 19:16:08 +00:00
Chris Lattner
76e199ffd2 Add new constructor for const pool bool
llvm-svn: 245
2001-07-21 19:15:26 +00:00
Chris Lattner
45cddb6e02 Add support for casts
llvm-svn: 244
2001-07-21 19:10:49 +00:00
Chris Lattner
9f3245e86b More functionality, renamed API
llvm-svn: 241
2001-07-21 19:07:19 +00:00
Vikram S. Adve
a72bdbe37a Utility routines for simpler access to the value of an integer constant.
llvm-svn: 236
2001-07-21 12:44:00 +00:00
Vikram S. Adve
1b172a1df5 Program options class.
llvm-svn: 235
2001-07-21 12:43:07 +00:00
Vikram S. Adve
75d94738e6 Description of the SPARC as a target architecture.
llvm-svn: 233
2001-07-21 12:42:19 +00:00
Vikram S. Adve
e9a98b1c2b Base clas for a description of a target architecture.
llvm-svn: 232
2001-07-21 12:42:08 +00:00
Vikram S. Adve
7145b98c93 Instruction selection via pattern matching on instruction trees using BURG.
llvm-svn: 231
2001-07-21 12:41:50 +00:00
Vikram S. Adve
f9db1450d8 *** empty log message ***
llvm-svn: 230
2001-07-21 12:41:01 +00:00
Vikram S. Adve
23abfdee2f Added CodeGen, LLC, and Support.
llvm-svn: 229
2001-07-21 12:40:37 +00:00
Vikram S. Adve
0025c5f58a Add isIntegral() method to SignedIntType and UnsignedIntType.
llvm-svn: 224
2001-07-21 12:32:48 +00:00
Vikram S. Adve
10973f75ab Compute and cache information about the storage size and layout
of structures.  This information is machine-dependent.

llvm-svn: 222
2001-07-20 21:09:17 +00:00
Vikram S. Adve
0d8d2f87a3 Provide uniform access to the pointer operand and to the index
operands (if any) for different types of MemAccessInst's.

llvm-svn: 221
2001-07-20 21:07:06 +00:00
Vikram S. Adve
cec502cb48 Added a representation of the machine instructions generated
for a VM instruction.

llvm-svn: 220
2001-07-20 21:05:02 +00:00
Chris Lattner
6aec8e1991 Start of expression analysis support
llvm-svn: 219
2001-07-20 19:17:55 +00:00
Chris Lattner
b6d8fb9977 Implement ensureTypeAvailable
Implement ConstPoolInt class

llvm-svn: 215
2001-07-20 19:16:02 +00:00
Chris Lattner
510fc61456 Add support for constant propogation of multiplies
llvm-svn: 214
2001-07-20 19:15:36 +00:00
Chris Lattner
a2122c28d0 Factor out WriteAsOperand.
llvm-svn: 213
2001-07-20 19:15:21 +00:00
Chris Lattner
8b78573709 Add a comment.
llvm-svn: 212
2001-07-20 19:15:08 +00:00
Chris Lattner
48f4974b39 Fix nasty typo
llvm-svn: 204
2001-07-20 04:39:07 +00:00
Chris Lattner
11f4097f50 Support external methods
llvm-svn: 200
2001-07-15 21:43:45 +00:00
Chris Lattner
5c33905f73 Implement forward/external declarations for methods.
llvm-svn: 196
2001-07-15 06:35:59 +00:00
Chris Lattner
bb3f9b179a Implement forward/external declarations for methods. Also, emit an error if a method
is defined more than once, instead of crashing.

llvm-svn: 195
2001-07-15 06:35:53 +00:00
Chris Lattner
444b28658f Add support for assembly printing fp constants
llvm-svn: 191
2001-07-15 00:18:39 +00:00
Chris Lattner
964af23ab4 Add support to the bytecode writer to recognize floating point constants
llvm-svn: 190
2001-07-15 00:17:23 +00:00
Chris Lattner
856ac86318 Add support to the bytecode reader to recognize floating point constants
llvm-svn: 189
2001-07-15 00:17:18 +00:00
Chris Lattner
c245dabe0a Add support to the parser to recognize floating point constants
llvm-svn: 188
2001-07-15 00:17:01 +00:00
Chris Lattner
d3e41d4d2f * ValueHolder now takes 3 arguments
* Added a few methods to ConstantPool
* ConstPoolVal no longer derives from Value
* Method & Module multiply inherit from SymTabValue & Value now
* Added a GetElementPtrInst::isStructSelector() method

llvm-svn: 184
2001-07-14 06:13:19 +00:00
Chris Lattner
a969eb234b Add knowledge about the struct form of the GetElementPtr instruction
llvm-svn: 183
2001-07-14 06:11:51 +00:00
Chris Lattner
10ff90d678 Remove dependency on the structure of ValueHolder.
llvm-svn: 182
2001-07-14 06:11:26 +00:00
Chris Lattner
f3410f8701 * The parent of a constant pool is a symtabvalue, not a value.
llvm-svn: 181
2001-07-14 06:10:49 +00:00
Chris Lattner
f7499bce49 The parent of a constant pool is a symtabvalue, not a value.
llvm-svn: 180
2001-07-14 06:10:33 +00:00
Chris Lattner
29a84291e0 Added some comments, preparing to add global variables and method prototypes
llvm-svn: 179
2001-07-14 06:10:16 +00:00
Chris Lattner
34244ab669 * The parent of a constant pool is a SymTabValue, not a value.
llvm-svn: 178
2001-07-14 06:08:51 +00:00
Chris Lattner
8131335c27 Made the following changes:
* ValueHolder became a 3 argument template.  This allows for BasicBlock to
  use the value holder arg as a typesafe parent pointer.
* SymTabValue no longer inherits from Value
* Method does not inherit from only SymTabValue.  Now it inherits from both
  STV & Value.
* Module does not inherit from only SymTabValue.  Now it inherits from both
  STV & Value.
* Updated the SymTabValue.h file to reference SymTabValue instead of STDef
  in several places
* Added isArraySelector & isStructSelector to GetElementPtr instruction

llvm-svn: 177
2001-07-14 06:07:58 +00:00
Chris Lattner
fcdbcb6ac1 Add DebugValue member.
llvm-svn: 175
2001-07-12 23:35:26 +00:00
Chris Lattner
80c9d7c165 Don't clean out the type plane of the constant pool... this is a hack. FIXME
llvm-svn: 172
2001-07-09 19:38:52 +00:00
Chris Lattner
b3b40bc8b9 Make sure that types go in the constant pool if they are used.
llvm-svn: 171
2001-07-09 19:38:36 +00:00
Chris Lattner
6065e61656 Implementation of Store & GetElementPtr
llvm-svn: 164
2001-07-08 23:22:50 +00:00
Chris Lattner
3b66715c67 Implement checking for new instructions
llvm-svn: 163
2001-07-08 21:18:49 +00:00
Chris Lattner
dccda26cd8 Implemented shl, shl, & load instructions
llvm-svn: 161
2001-07-08 21:10:27 +00:00
Chris Lattner
3473967aeb Moved Cast from being a Unary instruction to being an "Other" instruction
llvm-svn: 160
2001-07-08 19:03:27 +00:00
Chris Lattner
acc906f1de Use the CDG to mark branches alive on demand.
llvm-svn: 159
2001-07-08 18:38:36 +00:00
Chris Lattner
223ea549d1 Fixed post dominator frontiers! Yaay!
llvm-svn: 157
2001-07-08 05:54:09 +00:00
Chris Lattner
7a7ddef47e Neg instruction removed. Cast instruction implemented.
llvm-svn: 156
2001-07-08 04:57:15 +00:00
Chris Lattner
f4e2bb21f7 Removing unnecesary file
llvm-svn: 154
2001-07-07 20:54:19 +00:00
Chris Lattner
1619a709b4 Convert BinaryOperand and UnaryOperator to only take instruction types of
the appropriate enum

llvm-svn: 153
2001-07-07 20:17:23 +00:00
Chris Lattner
c00392210d Broad superficial changes:
* Renamed getOpcode to getOpcodeName
* Changed getOpcodeName to return a const char * instead of string
* Added a getOpcode method to replace getInstType
* Changed code to use getOpcode instead of getInstType

llvm-svn: 152
2001-07-07 19:24:15 +00:00
Chris Lattner
6f7587e4d3 Changed the fundemental architecture of Operands for Instructions. Now
Operands are maintained as a vector<Use> in the User class, and operator
iterators are provided as before.  Getting an operand no longer requires
a virtual function call.

WARNING: getOperand(x) where x >= getNumOperands() will now assert instead
of returning null!

llvm-svn: 149
2001-07-07 08:36:50 +00:00
Chris Lattner
bb2985b84d Changed memory reference instructions to store the result as the implicit
type of the instruction.

llvm-svn: 148
2001-07-07 08:36:30 +00:00
Chris Lattner
2758aa5683 Fixed some error messages to be nicer
llvm-svn: 147
2001-07-07 08:36:05 +00:00
Chris Lattner
dab02ca9e0 Add method to unify all exit nodes of a method
llvm-svn: 143
2001-07-06 16:58:36 +00:00
Chris Lattner
a8e840fc9b Implement support for postdominators, except in dom frontiers
llvm-svn: 142
2001-07-06 16:58:22 +00:00
Chris Lattner
e28135f621 Update to include right file
llvm-svn: 138
2001-07-06 16:32:07 +00:00
Chris Lattner
8939261a8b IntervalPartition was changed to inherit from vector<Interval*> instead of
contain it so that it would have full iterator access without much work.

Writer includes code to print out IntervalPartition's now.

llvm-svn: 133
2001-07-03 15:28:35 +00:00
Chris Lattner
12a9f45c48 Code got moved from the lib/Assembly/Writer/IntervalWriter.cpp file to
here.  Updates to correct description n stuff.

llvm-svn: 129
2001-07-03 05:36:34 +00:00
Chris Lattner
e9796c9244 Add printing code for dominator info
llvm-svn: 125
2001-07-02 05:46:47 +00:00
Chris Lattner
2dd269d8db Checkin of new dominator calculation routines. These will be improved in
the future to do post dominators and stuff

llvm-svn: 124
2001-07-02 05:46:38 +00:00
Chris Lattner
ec700533c1 Moved deleter to include/llvm/Tools/STLExtras.h
llvm-svn: 120
2001-07-02 01:08:08 +00:00
Chris Lattner
d4e8817fd9 Initial checkin. Should print dead instructions, except it doesn't do
control dependencies.  :(

llvm-svn: 119
2001-06-30 06:39:11 +00:00
Chris Lattner
c4e564a84c Rename DoSparseConditionalConstantProp -> DoSCCP
llvm-svn: 117
2001-06-30 06:37:43 +00:00
Chris Lattner
0815f96a2f Optimizations got their own header files
Optimizations now live in the 'opt' namespace
include/llvm/Opt was renamed include/llvm/Optimizations

llvm-svn: 113
2001-06-30 04:36:40 +00:00
Chris Lattner
a0a97d7bbd Implement reduceApply method
llvm-svn: 112
2001-06-30 04:35:40 +00:00
Chris Lattner
5ce7b422a1 Add a new pop_back() method
llvm-svn: 111
2001-06-30 04:35:21 +00:00
Chris Lattner
fd733edaa7 Export ConstantFoldTerminator, allow it to fold conditional branches to
the same label.

llvm-svn: 107
2001-06-29 23:56:58 +00:00
Chris Lattner
81bbbcfe1f Added documentation. Constant fold terminators.
llvm-svn: 106
2001-06-29 23:56:23 +00:00
Chris Lattner
806b7ff4be Add a check to avoid allowing V->replaceAllUsesWith(V)
llvm-svn: 104
2001-06-29 05:25:51 +00:00
Chris Lattner
09a1ba491b Add implementation of BasicBlock::removePredecessor code that was factored
out of DCE.cpp

llvm-svn: 103
2001-06-29 05:25:23 +00:00
Chris Lattner
e005dc792d * Factored RemovePredecessorFromBlock into BasicBlock::removePredecessor
* Avoid messing around with this case:
  br label %A
%A:  br label %A
* Enable optimizations that are correct now.

llvm-svn: 102
2001-06-29 05:24:28 +00:00
Chris Lattner
f5b28afa04 We need to make sure to remove PHI nodes in the successor that cannot be
executed when removing branch dest.

llvm-svn: 101
2001-06-29 05:23:10 +00:00
Chris Lattner
e445514d62 Added a note about a new verification the verifier should do
Removed a redundant check

llvm-svn: 100
2001-06-29 05:22:12 +00:00
Chris Lattner
d616582a7a Miscellaneous cleanups:
* Convert post to pre-increment for for loops
  * Use generic programming more
  * Use new Value::cast* instructions
  * Use new Module, Method, & BasicBlock forwarding methods
  * Use new facilities in STLExtras.h
  * Use new Instruction::isPHINode() method

llvm-svn: 96
2001-06-27 23:41:11 +00:00
Chris Lattner
0a37aa1884 Add a new Sparse Conditional Constant Propogation pass
llvm-svn: 95
2001-06-27 23:38:11 +00:00
Chris Lattner
747dcc99bc Change to use the new GenericBinaryInst class. Support lots more operators.
llvm-svn: 92
2001-06-27 23:36:49 +00:00
Chris Lattner
87259414f9 Misc cleanup
llvm-svn: 91
2001-06-27 23:36:09 +00:00
Chris Lattner
c9c6ca507f * Expose DoConstantPoolMerging
* Cleanups (post->pre increment, new cleaner API, etc)
* Moved stuff into ConstantHandling.h

llvm-svn: 90
2001-06-27 23:35:26 +00:00
Chris Lattner
07b100a643 Convert ugly postincrement to efficient preincrement
llvm-svn: 89
2001-06-27 23:34:01 +00:00
Chris Lattner
3ecce840dc Convert postincrements to more efficient preincrements
llvm-svn: 81
2001-06-27 23:28:02 +00:00
Chris Lattner
c129381d15 Moved UnaryOperator::create to InstrTypes.cpp until there is an iUnaryOps.cpp
Moved BinaryOperator::create to iBinaryOperators.cpp
Add getUniqueName to SymbolTable

llvm-svn: 76
2001-06-25 07:33:13 +00:00
Chris Lattner
725a64614c Implement induction variable injection!
llvm-svn: 75
2001-06-25 07:32:19 +00:00
Chris Lattner
287398c2a9 Renamed get.*Operator to create seeing that it would have to be qualified
with the classname anyways.

llvm-svn: 74
2001-06-25 07:31:31 +00:00
Chris Lattner
b408df97c8 * Rename get.*Operator to create seeing that it would have to be qualified
with the classname anyways.
* Add an isPHINode() method to Instruction
* Add getUniqueName() to SymbolTable class
* Add an insert method to ValueHolder

llvm-svn: 73
2001-06-25 07:31:05 +00:00
Chris Lattner
105f271c39 A silly stupid test of the loop depth calculator was added. REMOVE in the
future.

llvm-svn: 72
2001-06-25 03:55:37 +00:00
Chris Lattner
c75d18eb19 IntervalPartition: recode to use IntervalIterator to do all the work
LoopDepth.cpp: new file that calculates the depth of a loop, using
IntervalPartitions.

llvm-svn: 71
2001-06-25 03:55:04 +00:00
Chris Lattner
984c993188 New file due to the Intervals.h splitup
llvm-svn: 66
2001-06-24 04:07:44 +00:00
Chris Lattner
89a7836d09 #include a different header due to Intervals.h splitting up
llvm-svn: 63
2001-06-24 04:05:45 +00:00
Chris Lattner
0888156ce8 IntervalPartition & IntervalIterator classes have been split out into
their own .h files & .cpp file

llvm-svn: 62
2001-06-24 04:05:21 +00:00
Chris Lattner
f1342013f0 Prepare for split between Interval, IntervalIterator, and IntervalIPartition
llvm-svn: 60
2001-06-24 03:25:01 +00:00
Chris Lattner
4ebfee6ae4 Implement a lot more functionality. Now loop invariant and linear
induction variables are correctly identified.

llvm-svn: 57
2001-06-22 02:24:38 +00:00
Chris Lattner
d14456aa8a Interval::HeaderNode is now accessed thorugh an accessor function
llvm-svn: 56
2001-06-22 02:23:39 +00:00
Chris Lattner
86182934b5 Add a space to the PHI node output code to make it look nicer
llvm-svn: 53
2001-06-21 05:29:56 +00:00
Chris Lattner
b87e26435e Moved printing code to the Assembly/Writer library.
Code now detects looping intervals

llvm-svn: 52
2001-06-21 05:27:22 +00:00
Chris Lattner
8cf206d0fa Implement the new Interval::isLoop method
Implement destructor to free memory

llvm-svn: 51
2001-06-21 05:26:15 +00:00
Chris Lattner
5d07eeb20a Get rid of a silly printout that isn't needed right now
llvm-svn: 45
2001-06-20 23:09:39 +00:00
Chris Lattner
3f0d248cea Add capability to print a derived interval graph
llvm-svn: 42
2001-06-20 22:44:38 +00:00
Chris Lattner
09e6e27f2c Add capability to build a derived interval graph
llvm-svn: 41
2001-06-20 22:44:32 +00:00
Chris Lattner
223af86a45 Initial Checking of Interval handling code
llvm-svn: 39
2001-06-20 20:09:55 +00:00
Chris Lattner
30200aa462 Add a test case for interval code
llvm-svn: 36
2001-06-20 19:27:11 +00:00
Chris Lattner
469c33ad89 Updates to work with new cfg namespace
llvm-svn: 29
2001-06-13 19:55:22 +00:00
Chris Lattner
a6d2f96bdb Updates to support
* Changes in PHI node structure

llvm-svn: 25
2001-06-11 15:04:40 +00:00
Chris Lattner
88f6f66802 Updates to support
* Changes in PHI node structure
* Change to PHI syntax

llvm-svn: 24
2001-06-11 15:04:20 +00:00
Chris Lattner
11c3121788 Moved getBinaryOperator to the BinaryOperator class and the getUnaryOperator
to the UnaryOperator class (from the Instruction class).

llvm-svn: 21
2001-06-08 21:30:13 +00:00
Chris Lattner
5975876e9b Updated to work with new CFG.h file.
llvm-svn: 15
2001-06-07 21:18:45 +00:00
Chris Lattner
f6941c0602 Add extra method to PHI node class
llvm-svn: 11
2001-06-07 16:59:37 +00:00
Chris Lattner
68035d3c02 Significant rework. DCE is still not done (see #ifdef'd out parts)
but at least the stuff that is checked in, now works.

llvm-svn: 10
2001-06-07 16:59:26 +00:00
Chris Lattner
f2f80282cb Fixed to print slightly differently. Added use counts for labels
llvm-svn: 9
2001-06-07 16:58:55 +00:00
Chris Lattner
0dcec884f6 Fixes for BB iterators, additional methods added for DCE pass
llvm-svn: 8
2001-06-07 16:58:36 +00:00
Chris Lattner
e6b9b382e2 Initial revision
llvm-svn: 2
2001-06-06 20:29:01 +00:00