Commit Graph

967 Commits

Author SHA1 Message Date
Chris Lattner 654b5bc77a Ooops, forgot to implement void PassManager::add(BasicBlockPass *BBP)
llvm-svn: 1523
2002-01-22 00:17:48 +00:00
Chris Lattner 4f0f09757d Pull RaiseAllocations stuff out of the CleanGCC pass into it's own pass in
the ChangeAllocations.h header file.

llvm-svn: 1522
2002-01-22 00:13:51 +00:00
Chris Lattner d07471d6c3 LowerAllocations is really a BasicBlock pass. Make it so.
llvm-svn: 1521
2002-01-21 23:34:02 +00:00
Chris Lattner ee965abc36 Move stuff out of the Optimizations directories into the appropriate Transforms
directories.  Eliminate the opt namespace.

llvm-svn: 1520
2002-01-21 23:17:48 +00:00
Chris Lattner 4f32cf118a Chuck fixed the GCC problems so this hack is now unneccesary
llvm-svn: 1519
2002-01-21 23:17:07 +00:00
Chris Lattner 8cc83611e6 Elminate an unused variable
llvm-svn: 1518
2002-01-21 23:16:30 +00:00
Chris Lattner 4a75c2b248 Eliminate opt library
llvm-svn: 1516
2002-01-21 23:13:46 +00:00
Chris Lattner b07bf170c6 Remove dead variable
llvm-svn: 1515
2002-01-21 22:50:38 +00:00
Chris Lattner 61c6aeb6fe Remove dead variable.
llvm-svn: 1514
2002-01-21 22:44:57 +00:00
Chris Lattner d9f1ab2077 Pull stuff out of opt namespace
llvm-svn: 1511
2002-01-21 21:44:38 +00:00
Chris Lattner c940c536ab Rename SwapStructureContents -> IPO/SimpleStructMutation
Move MutateStructTypes.(cpp|h) -> IPO/MutateStructTypes.(cpp|h)

llvm-svn: 1510
2002-01-21 07:52:35 +00:00
Chris Lattner 26e4f89419 Implementation of the new spiffy pass system
llvm-svn: 1508
2002-01-21 07:37:31 +00:00
Chris Lattner 0686e435d1 Implement a more powerful, simpler, pass system. This pass system can figure
out how to run a collection of passes optimially given their behaviors and
charactaristics.

Convert code to use it.

llvm-svn: 1507
2002-01-21 07:31:50 +00:00
Chris Lattner 73da1cea60 Oops lost a parenthesis somehow :(
llvm-svn: 1504
2002-01-21 01:33:12 +00:00
Chris Lattner 7f74a56e24 Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Ruchira Sasanka bc28455806 Fixed a bug in spill cost estimation
llvm-svn: 1500
2002-01-08 16:29:23 +00:00
Ruchira Sasanka a42a7e78b6 PhyRegAlloc.cpp: Added temp area resetting before every call
llvm-svn: 1499
2002-01-07 21:09:06 +00:00
Ruchira Sasanka f4c2dddcda Added more comments
llvm-svn: 1498
2002-01-07 21:03:42 +00:00
Ruchira Sasanka c07341f999 removed SizeOfStackOperand constant from the SparcRegInfo class - no longer used
by code.

llvm-svn: 1497
2002-01-07 20:33:44 +00:00
Ruchira Sasanka 57386b570f Added more comments
llvm-svn: 1496
2002-01-07 20:28:49 +00:00
Ruchira Sasanka 4cfbfd599a Added comments and correct logic for finding register sizes.
llvm-svn: 1494
2002-01-07 19:20:28 +00:00
Ruchira Sasanka 8c2d8256a9 Added destructors and comments.
Added correct spill candidate selection logic.

llvm-svn: 1493
2002-01-07 19:19:18 +00:00
Ruchira Sasanka f20079dfed Added comments, destructors where necessary.
llvm-svn: 1491
2002-01-07 19:16:26 +00:00
Vikram S. Adve ecce65a4ba Eliminate function getIndicesBROKEN().
llvm-svn: 1486
2001-12-15 00:37:12 +00:00
Vikram S. Adve cb2335f13f Eliminate all uses of memInst->getIndicesBROKEN().
llvm-svn: 1485
2001-12-15 00:36:32 +00:00
Vikram S. Adve 721fee255c getIndexedOffset() shd take vector of Values, not of Constants!
llvm-svn: 1484
2001-12-15 00:35:48 +00:00
Vikram S. Adve 8234b04143 Remove int hack to allow unsigned numbers greater than 2^63 - 1...
llvm-svn: 1483
2001-12-15 00:33:36 +00:00
Chris Lattner ca081257e5 initial checkin
llvm-svn: 1480
2001-12-14 16:52:21 +00:00
Chris Lattner 24404f8223 * Support the new -q flag for automated tests
* Remove unsized array support
* Add pointer indexing support

llvm-svn: 1477
2001-12-14 16:49:29 +00:00
Chris Lattner 195b8779dc * Assert that indices are valid for an indexing instruction.
* Add support for indexing into pointers
* Remove support for unsized arrays

llvm-svn: 1472
2001-12-14 16:43:26 +00:00
Chris Lattner 6d6f01a488 Rename ConstPoolVals.cpp to Constants.cpp
llvm-svn: 1471
2001-12-14 16:42:30 +00:00
Chris Lattner 44d49e2bb8 Remove unsized array support
Add new SequentialType class

llvm-svn: 1470
2001-12-14 16:41:56 +00:00
Chris Lattner bec9b0b9ef Make strings SByte* arrays instead of UByte * arrays
llvm-svn: 1469
2001-12-14 16:41:18 +00:00
Chris Lattner 3655cfb4e2 * isFirstClassType is now provided by the Type class
* Add ReplaceInstWithInst

llvm-svn: 1468
2001-12-14 16:39:22 +00:00
Chris Lattner 9dedd32ff4 * add ReplaceInstWithInst
* Add support for pointer indexing
* Fix minor bugs that are majorly annoying

llvm-svn: 1467
2001-12-14 16:38:59 +00:00
Chris Lattner b3364fc169 Remove unsized array support
llvm-svn: 1466
2001-12-14 16:38:04 +00:00
Chris Lattner b457653c6f * Support pointer indexing
* Unsized arrays are a thing of the past, remove DoInsertArrayCast family
* Remove cases were we would get into infinite loops because we would insert a cast
  which would then be removed, inserting a different cast, ad infinitum...
* Remove some code that should be redundant with ExprTypeConvert code

llvm-svn: 1465
2001-12-14 16:37:52 +00:00
Chris Lattner 3e88b44afc Many many changes and bugfixes:
* Remove support for unsized arrays
* Add pointer indexing support
* Allow more arbitrary malloc type changes (which are too generous currently
  and should be fixed in the future)
* Allow more and better conversions

llvm-svn: 1464
2001-12-14 16:35:53 +00:00
Chris Lattner 11439b2360 The proper prototype for malloc returns a pointer, not an unsized array
llvm-svn: 1463
2001-12-14 16:32:20 +00:00
Chris Lattner 7dc20864b6 Allow pointer indexing
llvm-svn: 1462
2001-12-14 16:31:26 +00:00
Chris Lattner b2b1b3d036 Remove unsized array support
llvm-svn: 1461
2001-12-14 16:30:51 +00:00
Chris Lattner f4ba330416 Add pointer indexing support
llvm-svn: 1460
2001-12-14 16:30:09 +00:00
Chris Lattner 3cb3a1f06c Don't waste as much horizontal space on #uses flag when printing
llvm-svn: 1459
2001-12-14 16:29:12 +00:00
Chris Lattner ef99d3c144 * Fix cases where we were calling Type->getName() instead of Type->getDescription()
* Remove unsized array support
* Malloc/alloca do not require that the first element be an unsized array to be an
  array allocation

llvm-svn: 1458
2001-12-14 16:28:42 +00:00
Chris Lattner f1197b0d43 * Refactor trace values to work as a proper pass. Before it used to add
methods while the pass was running which was a no no.  Now it adds the
  printf method at pass initialization
* Revamp code to use printf calls instead of the old style print_<type>
  calls.
* Simplify code

llvm-svn: 1457
2001-12-14 16:26:05 +00:00
Ruchira Sasanka 1a98b28bde added a section on how to modify live variable code to use LLVM instructions
instead of machine instructions.

llvm-svn: 1451
2001-12-13 21:25:46 +00:00
Chris Lattner 6650d18892 Not just arrays are unsized
llvm-svn: 1450
2001-12-13 00:46:11 +00:00
Chris Lattner f5c6f65e7f Assertion could never fail because another one would in it's place. :)
llvm-svn: 1449
2001-12-13 00:45:40 +00:00
Chris Lattner cdbcb1fd17 Some programs are using BB's as values, until we resolve this. Disable the assert
llvm-svn: 1448
2001-12-13 00:45:06 +00:00
Chris Lattner 403ff802a3 Build runtime library with local GCCAS
llvm-svn: 1447
2001-12-13 00:44:23 +00:00
Chris Lattner 60a9a23aba Implement sprintf
llvm-svn: 1445
2001-12-13 00:43:47 +00:00
Chris Lattner 156344c890 Swap operands now preserves the semantics of the binary operator by changing
the opcode of the instruction if possible.

llvm-svn: 1444
2001-12-13 00:43:03 +00:00
Chris Lattner 25450e32c0 Add debugging to make a more useful message if a value gets constructed with a null type
llvm-svn: 1443
2001-12-13 00:41:27 +00:00
Ruchira Sasanka 4552ee447a Added more comments. Added code to destructor in MethodLiveVarInfo to delete
LiveVarSet caches.

llvm-svn: 1435
2001-12-08 21:05:27 +00:00
Ruchira Sasanka 565a5c423d Added comments are more documentation info
llvm-svn: 1434
2001-12-08 21:04:22 +00:00
Chris Lattner e51379766b Implement more general conversions for getelementptr instructions
llvm-svn: 1432
2001-12-07 04:40:30 +00:00
Chris Lattner dae4d63ddf Remove code that is superceeded by code in ExprTypeConvert.cpp
llvm-svn: 1431
2001-12-07 04:39:01 +00:00
Chris Lattner 72da4460b3 Don't insert scales of 1 :)
llvm-svn: 1430
2001-12-07 04:26:02 +00:00
Chris Lattner 7af2be143d Do not pessimize users of this function. Fix logic.
llvm-svn: 1428
2001-12-06 18:06:37 +00:00
Chris Lattner 71ffba7b70 We can do cast-add elimination even on casts that reinterpret
llvm-svn: 1427
2001-12-06 18:06:13 +00:00
Chris Lattner b1995e1e69 Fix bug that caused invalid transformations to be applied
llvm-svn: 1426
2001-12-06 18:05:55 +00:00
Chris Lattner 674394077f Actually return true when a change has been made
llvm-svn: 1425
2001-12-05 19:41:33 +00:00
Chris Lattner 8d16760c21 Handle more complex array indexing expressions
llvm-svn: 1424
2001-12-05 19:41:16 +00:00
Chris Lattner 1d244625c0 Fix pessimizations on sized arrays
llvm-svn: 1423
2001-12-05 19:40:32 +00:00
Chris Lattner ad08d2fd8e Fix a few bugs. Fix pessimization handling sized arrays
llvm-svn: 1422
2001-12-05 19:39:15 +00:00
Chris Lattner be68833765 "fix" problems processing floating point expressions
llvm-svn: 1421
2001-12-05 19:38:29 +00:00
Chris Lattner cd7fb504a5 Hrm, don't do debugging output when debugging is off. :(
llvm-svn: 1420
2001-12-05 06:40:17 +00:00
Chris Lattner 617aaaad86 Fixes to type conversion stuff to match induction variables more frequently
llvm-svn: 1417
2001-12-05 06:34:00 +00:00
Chris Lattner 1bedac9af0 Fix a bug that clobbered the step value on some inputs
llvm-svn: 1416
2001-12-05 06:32:30 +00:00
Chris Lattner 25b151dfdf Fix a bug introduced by "internal linkage" work.
llvm-svn: 1415
2001-12-04 18:01:49 +00:00
Chris Lattner d23d752dc5 Fix bugs, don't do external methods which causes segv.
llvm-svn: 1414
2001-12-04 08:13:06 +00:00
Chris Lattner 4c160c39b4 Remove printouts
llvm-svn: 1413
2001-12-04 08:12:53 +00:00
Chris Lattner 54794fe11f Fix a pessimization due to sucky LI testing
llvm-svn: 1412
2001-12-04 08:12:47 +00:00
Chris Lattner 91daaabb56 Implement induction variable simplification
llvm-svn: 1411
2001-12-04 04:32:29 +00:00
Chris Lattner 1366b3019e Allow hyphens in identifier names
llvm-svn: 1409
2001-12-04 04:31:30 +00:00
Chris Lattner 2413b160ec Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()

llvm-svn: 1408
2001-12-04 00:03:30 +00:00
Chris Lattner 3462ae3ad7 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h

llvm-svn: 1407
2001-12-03 22:26:30 +00:00
Chris Lattner fb5ae02e1a Split the PHINode class out from the iOther.h file into the iPHINode.h file
llvm-svn: 1405
2001-12-03 18:02:31 +00:00
Chris Lattner 476e6df794 Initial checkin of indvar stuff
llvm-svn: 1404
2001-12-03 17:28:42 +00:00
Chris Lattner f55d8013d9 Compile the scalar directory
llvm-svn: 1403
2001-12-03 17:28:15 +00:00
Chris Lattner 66d9ceaaba Induction variables must be phi nodes
llvm-svn: 1402
2001-12-03 17:27:42 +00:00
Chris Lattner b4c677745e Move support directory
llvm-svn: 1401
2001-11-29 16:32:16 +00:00
Chris Lattner 5de2204fe8 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes

llvm-svn: 1400
2001-11-27 00:03:19 +00:00
Chris Lattner f679703feb Move DataTypes.h from llvm/Support to just Support
llvm-svn: 1399
2001-11-26 23:04:08 +00:00
Chris Lattner 54d5928569 Turn off debug info
llvm-svn: 1396
2001-11-26 19:36:58 +00:00
Chris Lattner 56f1f594fd Use pointertype where appropriate
llvm-svn: 1392
2001-11-26 19:20:16 +00:00
Chris Lattner e977e5d973 Remove invalid,unneccesary ## token
llvm-svn: 1391
2001-11-26 19:19:27 +00:00
Chris Lattner 7a787227d8 Implement internal
llvm-svn: 1385
2001-11-26 19:14:56 +00:00
Chris Lattner 302014f2e7 Make strings be internal
llvm-svn: 1384
2001-11-26 19:14:33 +00:00
Chris Lattner 1416a2992e Remove debugging output
llvm-svn: 1383
2001-11-26 19:14:16 +00:00
Chris Lattner 4219baafb5 Support internal linkage
llvm-svn: 1382
2001-11-26 19:14:03 +00:00
Chris Lattner 660c2f0e6f Build IPO directory
llvm-svn: 1381
2001-11-26 18:59:30 +00:00
Chris Lattner 22fd21ed16 Implement support for internal methods
llvm-svn: 1380
2001-11-26 18:59:18 +00:00
Chris Lattner ee568eb459 Include const prop as part of -raise
llvm-svn: 1379
2001-11-26 18:58:55 +00:00
Chris Lattner f0f9105d4f * Implement support for folding multiple single letter arguments together like
with ls: ls -la  === ls -l -a
* Implement support for trimming arguments that start with a single letter
  argument so that -lfoo is recognized as -l foo for the linker

llvm-svn: 1378
2001-11-26 18:58:34 +00:00
Chris Lattner c4ad64cb9c Misc cleanups
llvm-svn: 1377
2001-11-26 18:57:38 +00:00
Chris Lattner 1f86880af4 Expose constant propogation of an instruction in a clean way
llvm-svn: 1376
2001-11-26 18:57:12 +00:00
Chris Lattner 0c8eea1b6f Stuff after a #endif is not valid CPP input and breaks some compilers
llvm-svn: 1375
2001-11-26 18:56:52 +00:00
Chris Lattner 2263733dcf Implement internal method support
llvm-svn: 1374
2001-11-26 18:56:10 +00:00
Chris Lattner 841d8b9e50 Implement support for internal methods
llvm-svn: 1373
2001-11-26 18:54:16 +00:00
Chris Lattner 34dfe56c1a Implement writer support for Loops, Induction Variables, and CallGraphs
llvm-svn: 1372
2001-11-26 18:53:29 +00:00
Chris Lattner b4a7eb10fa Make Mul work right
Make sub work right

llvm-svn: 1371
2001-11-26 18:53:07 +00:00
Chris Lattner a88403bf31 Fix a bad assertion to be correct . The root basic block can be used by PHI nodes.
llvm-svn: 1370
2001-11-26 18:52:02 +00:00
Chris Lattner 03946cd9b6 Implement a new entry node that has edges to all external methods in the module
llvm-svn: 1369
2001-11-26 18:51:25 +00:00
Chris Lattner bd422e6686 Implement DCE of global values
llvm-svn: 1360
2001-11-26 18:42:17 +00:00
Chris Lattner 6de9942b92 * Implement dominator based loop identification
* Implement cleaner induction variable identification

llvm-svn: 1359
2001-11-26 18:41:20 +00:00
Chris Lattner 5ba757369c * Implement array indexing in lli
* Add external atoi method as well as floor, and srand

llvm-svn: 1355
2001-11-26 18:18:18 +00:00
Chris Lattner 3b30570f9a Support Array Indexing
llvm-svn: 1348
2001-11-26 17:02:05 +00:00
Chris Lattner 1c5e8f5d58 Implement: isLosslesslyConvertableTo and new CompositeType base class
llvm-svn: 1347
2001-11-26 17:01:47 +00:00
Chris Lattner f87b579b9d If a name conflict occurs when inserting a value, rename it.
llvm-svn: 1346
2001-11-26 17:01:18 +00:00
Chris Lattner 330dc57305 Support array indexing
llvm-svn: 1345
2001-11-26 17:00:43 +00:00
Chris Lattner c43c461ca6 Support Composite's, not just structs
llvm-svn: 1344
2001-11-26 17:00:13 +00:00
Chris Lattner 03386ec88b losslessCastableTypes is moved to Type class
getStructOffsetType supports array indexing

llvm-svn: 1343
2001-11-26 16:59:47 +00:00
Chris Lattner 2cc6d418fa Support selectable structure transformations
llvm-svn: 1342
2001-11-26 16:59:10 +00:00
Chris Lattner f80013a917 Support mutation of array indexing
llvm-svn: 1341
2001-11-26 16:58:33 +00:00
Chris Lattner f9378e7d2d Clean up code, implement array indexing stuff
llvm-svn: 1340
2001-11-26 16:58:14 +00:00
Chris Lattner 1df615c834 Implement array indexing reverse engineering
llvm-svn: 1339
2001-11-26 16:57:31 +00:00
Chris Lattner 63b52693c8 The old getIndices has been deprecated, because it no longer works. It now
is named getIndicesBROKEN() and shall be removed when the codebase is updated
to not call it

llvm-svn: 1338
2001-11-26 16:56:19 +00:00
Chris Lattner 20faede952 Implement array indexing
llvm-svn: 1337
2001-11-26 16:54:55 +00:00
Chris Lattner 476148f95a Implement array indexing with uints
llvm-svn: 1336
2001-11-26 16:54:11 +00:00
Chris Lattner 0ae45bd3f4 * Implement more powerful expr analysis of cast instructions
llvm-svn: 1335
2001-11-26 16:53:50 +00:00
Ruchira Sasanka edbf52c7f9 commented out popAllTempValues since it leads to a bug - see code
llvm-svn: 1327
2001-11-15 22:03:04 +00:00
Ruchira Sasanka 7dfa1650a2 Commented some popTempArg.. since it leads to a bug
llvm-svn: 1326
2001-11-15 22:02:06 +00:00
Ruchira Sasanka ec62f24009 Added naming to inserted phi copy values - for easy debugging
llvm-svn: 1325
2001-11-15 20:46:40 +00:00
Ruchira Sasanka c97ccc5cb5 changed since names of some methods in PhyRegAlloc changed
llvm-svn: 1324
2001-11-15 20:25:07 +00:00
Ruchira Sasanka 9066899a78 Fixed a bug in setReLRegsUsedByMI
llvm-svn: 1323
2001-11-15 20:23:19 +00:00
Ruchira Sasanka dec9bfd554 Changed some names of methods, added const etc.
llvm-svn: 1322
2001-11-15 20:22:37 +00:00
Vikram S. Adve 5c8f573bbf Fix use of AllocateLocalVar for alloca instruction!
llvm-svn: 1319
2001-11-15 15:22:39 +00:00
Vikram S. Adve fbb8a64749 Modify AllocateLocalVar method to take a size argument.
llvm-svn: 1318
2001-11-15 15:22:26 +00:00
Ruchira Sasanka a514745a96 fixed setUsedRegAtMI
llvm-svn: 1317
2001-11-15 15:00:53 +00:00
Vikram S. Adve b601fda7ce Print incoming arguments and return values.
llvm-svn: 1315
2001-11-15 15:00:16 +00:00
Vikram S. Adve 821b129755 Fix int->float conversion.
llvm-svn: 1314
2001-11-15 14:59:56 +00:00
Chris Lattner 02c43c8609 -cleangcc pass now remove type names that are never referenced and type names for pointers to primitive types.
llvm-svn: 1312
2001-11-15 04:34:46 +00:00
Ruchira Sasanka c5989f645b Changed phi elimination code
llvm-svn: 1311
2001-11-15 00:27:14 +00:00
Vikram S. Adve 3fb79e61c2 Fix cute little bug that was causing the last
structure offset to be ignored in computing an offset!

llvm-svn: 1310
2001-11-14 21:24:44 +00:00
Ruchira Sasanka 64f7567391 Small changed to printing a machine operand - It the operand is a def, it prints
a star after it - only for debugging

llvm-svn: 1309
2001-11-14 20:05:23 +00:00
Vikram S. Adve cba86d060b Don't assume constant operand can only be in position 1!
llvm-svn: 1308
2001-11-14 18:49:45 +00:00
Vikram S. Adve 7e833073e3 Add function returning which operand holds immediate constant
for a given opcode.

llvm-svn: 1307
2001-11-14 18:48:36 +00:00
Vikram S. Adve 65d54eb06e Idiotic error in last fix.
llvm-svn: 1306
2001-11-14 17:55:02 +00:00
Vikram S. Adve c1b534043f Don't need to load a NULL pointer constant from memory!
llvm-svn: 1305
2001-11-14 17:24:49 +00:00
Vikram S. Adve ea1a93b95d Change latency of SETX to improve schedule -- just a hack.
llvm-svn: 1304
2001-11-14 15:54:44 +00:00
Ruchira Sasanka 7765ca8b25 Added support method for setting interference for pseudo instructions
llvm-svn: 1303
2001-11-14 15:37:13 +00:00
Ruchira Sasanka b8be6f6856 Added M_PSEUDO_FLAG for SETX .. instr
llvm-svn: 1301
2001-11-14 15:35:13 +00:00
Ruchira Sasanka f1acecccb6 Added interference for args in pseudo instructions
llvm-svn: 1300
2001-11-14 15:33:58 +00:00
Chris Lattner af84e627fd Rename cruft
llvm-svn: 1299
2001-11-14 11:28:18 +00:00
Chris Lattner 1237e86597 Remove much cruft from the MemAccessInst instruction
llvm-svn: 1298
2001-11-14 11:27:58 +00:00
Chris Lattner abf40ba6e8 Better heuristics for handling arrays
llvm-svn: 1296
2001-11-14 11:02:49 +00:00
Ruchira Sasanka 33c400f6a7 commented out lines printing code after scheduling
llvm-svn: 1295
2001-11-13 23:12:53 +00:00
Ruchira Sasanka 36f13d1c2f Fixed a bug concering LR spilling. Earlier, added spilled code was not inserted
into the instruction stream correctly.

llvm-svn: 1294
2001-11-13 23:09:30 +00:00
Ruchira Sasanka 1a9a7f2ef1 Changed checking for invalid register number - earlier it was uisng a contant
llvm-svn: 1293
2001-11-13 23:08:19 +00:00