Commit Graph

687 Commits

Author SHA1 Message Date
Chris Lattner
591bda986e Propogate name to the malloc itself instead of to the cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1071 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-01 02:40:36 +00:00
Chris Lattner
7ef6559718 Use the correct prototype for malloc and free
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1066 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-31 06:36:23 +00:00
Chris Lattner
bfe11108ad Implement code to convert %malloc and %free FUNCTION CALLS into the instruction equivalent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1065 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-31 06:35:59 +00:00
Chris Lattner
37aabf28b3 Implemented constant propogation of cast instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1064 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-31 05:07:57 +00:00
Chris Lattner
e51e03b3c6 Initial version of GCC cleanup pass: just removes extraneous global symbol table entries for types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1062 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-31 04:33:19 +00:00
Chris Lattner
4f68528de4 Fix bug when inlining a method that refers to a global variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1056 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-31 02:27:26 +00:00
Chris Lattner
4d0e1f96f4 Implement xor operator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1050 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-30 20:54:36 +00:00
Chris Lattner
5deea3c5c5 callExternalMethod now returns the return value of the function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1048 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-30 20:28:23 +00:00
Chris Lattner
4721f1304f Implement a gross function name map that must be used when linking statically
This is for use with purify


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1047 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-30 20:28:00 +00:00
Chris Lattner
bb76f02756 * Add some assertions for checking internal error conditions
* Implement the 'rem' instruction
* Fix getelementptr to work right
* Copy the return result of an external function call into the receiving value
* Convert stuff to new style casts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1046 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-30 20:27:31 +00:00
Chris Lattner
a5637fc466 Don't fail to load runtime if running LLI from the current directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1044 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-30 16:40:37 +00:00
Chris Lattner
55fd998ce7 Initialize isRecursive. Found by Purify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1043 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-30 16:39:16 +00:00
Chris Lattner
f5b2ec19ce Print out a label if we step into the first instruction of a basic block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1038 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 20:44:34 +00:00
Chris Lattner
08845a242c * Fix pow wrapper to actually work
* Implement rudimentary printf support for lli


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1037 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 20:27:45 +00:00
Chris Lattner
95c3af584f Implement getelementptr instruction as well as the load and store forms
that incorporate gep


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1036 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 19:32:19 +00:00
Chris Lattner
111bd01c11 Fix broken assertion. Didn't allow for pointer case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1034 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 17:27:38 +00:00
Chris Lattner
43a6f2e332 Pull method symbols over when linking. Otherwise the result of the link will appear stripped
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1033 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 16:55:41 +00:00
Chris Lattner
7b8660d72f Fix blatent bugs in checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1032 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 16:40:32 +00:00
Chris Lattner
207b5bc6a1 Expose the WriteTypeSymbolic function from the library. Refactor code to make
this function explicit.  Cause WriteAsOperand to use symbolic types as available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1031 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 16:37:48 +00:00
Chris Lattner
c182499645 Be careful to output symbolic type name if possible for a type. This makes
debugging the Olden/health benchmark actually possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1029 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 16:05:51 +00:00
Chris Lattner
069aa256af Remember to print out the next instruction if stepping over an external method call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1028 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 16:05:19 +00:00
Chris Lattner
a74a6b5fdf Fix problem next'ing over an external method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1027 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 14:08:33 +00:00
Chris Lattner
24d3a8b58d Check in to use moved stringizing code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1024 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 13:39:38 +00:00
Chris Lattner
b97d98ec7c Remove C string capability from VMCore library. Move to Support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1021 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-29 13:27:09 +00:00
Vikram S. Adve
c426c63b39 Make newlines be newlines! This should now work in both lli and native code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1016 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 22:44:02 +00:00
Chris Lattner
2301a070f6 Remove non linking related stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1015 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 22:43:06 +00:00
Chris Lattner
316a65bda9 Fix some illegal uses of the ## operator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1013 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 22:38:22 +00:00
Vikram S. Adve
53b44e1c32 Minor fix I omitted to check in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1012 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 22:19:06 +00:00
Vikram S. Adve
c750c29f28 Support printing control characters in standard C/assembly style,
if you specify useCSyntax = true.  The old style is still the default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1011 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:48:05 +00:00
Vikram S. Adve
94e40ef064 Record constants that need to be emitted in the assembly code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1010 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:46:23 +00:00
Vikram S. Adve
d0d79c01b4 Allow combinations of True/Anti/Output flags for each edge to
support, e.g., dependences on Call instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1009 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:45:02 +00:00
Vikram S. Adve
a93bbac606 Add edges between call instructions and (a) load/store instructions, and
(b) any instructions that use or set CC registers.  Whether or not the
latter are needed really should be machine-dependent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1008 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:43:33 +00:00
Vikram S. Adve
a2a7094662 Generate SETX for 64-bit integers!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1007 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:41:46 +00:00
Vikram S. Adve
c7b2e5c81e Add SETX instruction for 64-bit constants.
Add M_CC_FLAG for many instructions that use int or fp CC registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1006 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:41:01 +00:00
Vikram S. Adve
0589b2c63f Need to subtract, not add, stack size in SAVE instruction!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1005 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:39:47 +00:00
Vikram S. Adve
953c83e1ee Major overhaul to print globals and constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1004 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:38:52 +00:00
Vikram S. Adve
9466f5113b Added name-mangling routines for future use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1003 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:38:02 +00:00
Vikram S. Adve
d889330869 Use separate functions for printing values of each type.
Put trace code before condition-generating instruction in basic blocks
that end in a conditional branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1002 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 21:37:25 +00:00
Vikram S. Adve
3eb60f8775 Add methods print<TYPE> for String, Pointer, and each primitive type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@994 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 20:52:27 +00:00
Ruchira Sasanka
20c82b12c9 Added support for spilling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@992 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 18:15:12 +00:00
Ruchira Sasanka
174bded6ce Added spill code support; moved insertCallerSaving to SparRegInfo since
we need to handle %ccr reg in a special way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@990 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-28 18:12:02 +00:00
Chris Lattner
43e3f7c962 Implement a -trace command line option and a trace option in the interpreter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@989 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-27 08:43:52 +00:00
Chris Lattner
c259316730 * Make pointer values work better by treating them uniformly as 64 bit values.
This causes code that is generated by gcc to work better.
* Implement mul & div
* Export malloc, free, and pow
* add strtol, atoi, and atol to the runtime library


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@988 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-27 08:28:11 +00:00
Chris Lattner
204eec3f57 Provide argv for commands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@987 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-27 05:54:31 +00:00
Chris Lattner
caccd761a6 Provide option to enable eating of all arguments following a specific one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@986 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-27 05:54:17 +00:00
Chris Lattner
e43db88b2d * Implement exit() builtin function
* Implement linked in runtime library with puts(char*) in it
* implement builtin putchar(int) function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@985 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-27 04:15:57 +00:00
Ruchira Sasanka
7dcd61209a Fixed load syntax in EmitAssembly
Fixed cpReg2Mem (store) operand oreder in SparcRegInfo.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@984 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-24 22:05:34 +00:00
Chris Lattner
4a82271451 Add support for building a runtime library for LLI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@983 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-24 19:52:41 +00:00
Ruchira Sasanka
c74a720204 Fixed logic for checking whether a LR received the correct color.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@976 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-24 15:56:58 +00:00
Chris Lattner
f038acbee2 Clean up error handling a bit. Add / as a seperator for command line arguments. This is just a big old ugly hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@974 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-24 06:21:56 +00:00
Chris Lattner
7eadfa1db8 Frivolous cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@973 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-24 06:21:22 +00:00
Chris Lattner
f608608878 Dang it, do NOT check in code that enables debugging. Bad chris
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@972 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-24 05:14:35 +00:00
Chris Lattner
008f906afd Two things:
1. Forward propogate a loaded constant to make debugging slightly less annoying
2. Fix an extremely nasty hard to find bug that really irritated me for the better
   part of 6 hours and was causing linking to die and bizarre and mysterious ways.
   Things should be much more stable now that this one liner has been fixed. GRR


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@971 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-24 05:12:04 +00:00
Chris Lattner
d6b65255fe Changes to get some meaningful feedback from the bytecode reader. At some point this stuff should all be exception driven, but for now it is not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@970 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-24 01:15:12 +00:00
Ruchira Sasanka
88dedc1544 Corrected a bug in SparcRegInfo.cpp - to add inserted instructions before a return
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@969 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 21:40:39 +00:00
Ruchira Sasanka
f7434f0e1d added support to move "added instructions" after the delay slot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@968 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 21:38:42 +00:00
Ruchira Sasanka
251d8db133 Added support to move "added instructions" after the delay slot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@967 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 21:38:00 +00:00
Chris Lattner
c2d774b6c1 Fix problem linking in a method prototype when a method body exists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@965 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 20:43:42 +00:00
Chris Lattner
2172ca1bab Remove unnamed prototypes that are created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@964 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 15:30:18 +00:00
Chris Lattner
90ebc114c6 Negative FP constants... whodathunkit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@963 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 04:13:01 +00:00
Chris Lattner
b0f20d72b1 Oops, didn't mean to check in enabled debugging support. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@962 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 03:21:42 +00:00
Chris Lattner
2b9f6004df Fixed a LONG standing, SCARY problem with bytecode encoding. It turns out to be an endian problem that only shows up with type 0 instructions in LARGE programs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@961 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 03:21:10 +00:00
Chris Lattner
e638c10cb0 More symbol table bugfixes that are impossible to track down. Goody
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@960 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 02:32:45 +00:00
Chris Lattner
5855f0db2a Allow unresolved/opaque types to be read and written to bytecode files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@959 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 01:53:22 +00:00
Chris Lattner
d48d6c74ad Fix another annoying bug that took forever to track down. This one involves abstract type resolution at a bad time that broke symbol tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@958 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 01:53:01 +00:00
Vikram S. Adve
7db933d513 Delete MachineCodeInfoForMethod object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@956 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 22:32:11 +00:00
Chris Lattner
c895294762 Fix a problem occuring with type unification of symbol table entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@955 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 21:59:46 +00:00
Vikram S. Adve
a7edb1888c Added function IsLeafMethod to identify leaf methods.
This will use the CallGraph only if one is provided.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@950 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:55:46 +00:00
Vikram S. Adve
ac0ec47957 Added MachineCodeForMethod object in class Method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@949 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:52:47 +00:00
Vikram S. Adve
c023be29a4 Use class MachineCodeForMethod to print machine code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@948 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:52:03 +00:00
Vikram S. Adve
1d6158f98f Added class MachineCodeForMethod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@947 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:51:33 +00:00
Vikram S. Adve
7ad1046065 Cosmetic changes only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@946 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:51:09 +00:00
Vikram S. Adve
fb8c0533b4 Modify code that processes delay slots so that it preserves any
useful instructions already inserted into delay slots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@945 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:49:27 +00:00
Vikram S. Adve
c5d0322d98 UNUSED.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@944 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:46:38 +00:00
Vikram S. Adve
578f99c74d Split JMPL into JMPLCALL and JMPLRET.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@943 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:44:53 +00:00
Vikram S. Adve
9db43184ca Added a frame layout class, and code to insert prolog/epilog code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@942 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:44:23 +00:00
Vikram S. Adve
a1ca7b9d79 Reordered registers slightly to simplify a new check.
Added a function to map between the caller's and callee's register windows.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@941 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:43:08 +00:00
Vikram S. Adve
53fec86ffd Split JMPL into JMPLCALL and JMPLRET so that IsCall and IsReturn can
be used to distinguish those uses of the `jmpl' instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@940 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:41:12 +00:00
Vikram S. Adve
fb36112c8d Added functions to generate prolog and epilog code.
Use JMPLRET instead of RETURN for method returns so that


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@939 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:36:31 +00:00
Vikram S. Adve
1d86cc06dc Added SAVE and RESTORE. Duplicated JMPL into JMPLCALL and JMPLRET,
which have the same opcode and operands but different flags.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@938 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:32:55 +00:00
Vikram S. Adve
c152163eb4 Reordered a couple of registers to simplify some new checks.
Added code to map between caller's and callee's register windows.
Added frame layout class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@937 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 13:31:53 +00:00
Chris Lattner
822695901f Remove ugly subclass of Opaque type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@936 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 06:01:08 +00:00
Chris Lattner
4a42e909cd Fix bug with
%list = type {%list *}
%list = type {%list *}

not being accepted (broken testmisc.ll)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@935 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 05:56:09 +00:00
Chris Lattner
9245fc75a4 Fix bug exposed by this testcase:
declare int "call_operand"      (%rtx_def*, int)        ;; Prototype for: call_operand
declare int "restore_operand"   (%rtx_def*, int)        ;; Prototype for: restore_operand

%rtx_def = type opaque
%rtx_def = type int
implementation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@934 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 04:55:44 +00:00
Chris Lattner
c9a21b51a1 Two changes:
1. Delete type handle regardless of whether a collision occured
2. Remove a MAJOR pessimization of runtime performance (thought be be an optimization at the time).

This second one was causing a 105k llvm file (from gcc) to parse in 58 seconds... without the
'optimization' it now parses in 3.64 seconds.  I suck.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@933 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-21 23:02:41 +00:00
Chris Lattner
bfabd8877d Fix erroneous assertion failure on the following code:
declare int "malloc"(...)

...

%reg112 = call int (...) * %malloc( uint %cast1007 )


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@932 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-21 21:54:51 +00:00
Chris Lattner
23192ebe95 Fix bug caused by:
%list = type opaque
%list = type %list


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@931 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-21 21:43:25 +00:00
Ruchira Sasanka
b3b6f5338c Added support for both call/jmpl instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@930 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-21 16:43:41 +00:00
Chris Lattner
5ab1f87786 Fix problem with a cast instruction that must be expanded to type 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@929 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-21 00:14:44 +00:00
Vikram S. Adve
2827d52868 Fixed printing of offset operand for RETURN instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@928 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-20 21:33:50 +00:00
Vikram S. Adve
ea21a6c82a Use CALL for direct function calls; JMPL for indirect ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@927 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-20 20:57:06 +00:00
Vikram S. Adve
43534443ff Minor bug fix in printing operands of JMPL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@926 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-20 20:56:40 +00:00
Chris Lattner
f434cd1b30 Fix shift printing when using a ubyte LHS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@925 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-20 09:33:10 +00:00
Chris Lattner
42c9e77ffb Add support for And, XOR, and Or
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@924 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-20 09:32:59 +00:00
Chris Lattner
2b3c925d02 It is valid to have unsigned arrays as constants... the linker may initialize them later
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@923 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-20 06:43:05 +00:00
Ruchira Sasanka
44d2b947cb Added code to support unusable Suggested Colors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@922 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-19 21:42:06 +00:00
Ruchira Sasanka
b49865fa02 Added code so that colorIGNode does not unnecessarily reserve unusable
Suggested colors for neighbors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@921 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-19 21:41:16 +00:00
Ruchira Sasanka
0e62aa6d14 Added code to PhyRegAlloc to mark unusable suggested regs
Added initialization to AdjList to IGNode constructor - major bug fix


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@920 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-19 21:39:31 +00:00
Ruchira Sasanka
0f5e98854b Corrected call interference bug - suggested color not allocated if
volatile and there are call interferences


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@918 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-19 17:23:43 +00:00
Ruchira Sasanka
36f7707d2a Changed Call interference info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@917 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-19 17:21:59 +00:00
Ruchira Sasanka
958faf3f5a Corrected call interference bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@916 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-19 17:21:03 +00:00
Ruchira Sasanka
0fd8dc8099 no major change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@914 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 23:58:08 +00:00
Ruchira Sasanka
69917e27af Added implict operand printing for operator( ostream, MachineInstr&)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@912 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 22:40:02 +00:00
Ruchira Sasanka
735d6e3ee2 Added support for condition code loading/stroing in methods cpReg2Reg etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@911 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 22:38:52 +00:00
Ruchira Sasanka
97b8b4410a removed some debug messages
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@910 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 22:36:26 +00:00
Chris Lattner
f8f2afb8cc Enhancements to pass argc & argv to main if required
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@909 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 21:55:32 +00:00
Chris Lattner
b81a0bff04 Refix bugs, stop using deprecated strstream header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@898 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 20:06:03 +00:00
Chris Lattner
475becb7bc Initial checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@897 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 20:05:37 +00:00
Vikram S. Adve
631b9a3523 Only print values live at BB or method exit, and insert loads at each
BB exit to read and print values stored in that BB.   Note that only
these stored values are live at method exit!.  Also, print messages at
method entry and exit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@892 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 18:16:11 +00:00
Vikram S. Adve
bedb00d6dc Handle multiple exit blocks correctly.
Restore string variable cache.
Resurrect code to use formatted printing instead of PrintVal
but leave it turned off for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@888 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 13:49:22 +00:00
Chris Lattner
b2c823d2be Dang, we were losing the Constant bit on globals. Fix this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@885 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 06:11:23 +00:00
Chris Lattner
4457163bc4 Convert to be compatible with lli.
Need to eliminate duplicate \n entries


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@883 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 06:03:05 +00:00
Chris Lattner
8d9e3776d8 Massive hacks to try to fix subtle logic bugs. I think it's all working now,
at least what used to.  I should disable method exit code completely because
it's broken (doesn't insert just post dominating values)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@881 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 05:28:08 +00:00
Chris Lattner
42c9c2cce4 Convert to new simpler pass itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@880 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 05:27:33 +00:00
Chris Lattner
e001059e0a Change Sources specifier to ExtraSources
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@874 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 01:48:09 +00:00
Chris Lattner
5680ee6b28 Convert optimizations to the pass infrastructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@873 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 01:32:34 +00:00
Vikram S. Adve
7fe27874be 1. Move most of the constant-fixup code into machine-independent file
InstrSelectionSupport.cpp.  It now happens in a bottom-up pass on
   each BURG tree after the original top-down selection pass on the tree.
2. Handle global values as constants (viz., constant addresses).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@868 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 00:26:20 +00:00
Vikram S. Adve
fee93865d6 Sparc-specific code shared between local files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@864 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 00:03:20 +00:00
Vikram S. Adve
4df35a2ce3 Moved implementation of class UltraSparcInstrInfo to SparcInstrInfo.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@863 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 00:02:32 +00:00
Vikram S. Adve
5684c4e2b4 Added virtual function to generate an instruction sequence to
load a constant into a register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@862 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 00:02:06 +00:00
Vikram S. Adve
30764b8366 Moved implementation of class UltraSparcInstrInfo here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@861 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-18 00:01:48 +00:00
Vikram S. Adve
6d35326cd5 1. Add a bottom-up pass on BURG trees that is used to fix constant operands.
Needs to be bottom up because constant values may be forward-substituted
   to their uses (i.e., into the parent in the BURG tree).
2. Move most of the constant-fixup code into machine-indepedent file
   InstrSelectionSupport.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@859 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-17 23:57:50 +00:00
Vikram S. Adve
f43e3366ef Separate VM instruction that generates the instructions that compute a value
from the value itself (the one causing an edge) because the latter may be
a temporary used within the instruction sequence for the VM instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@858 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-17 23:55:16 +00:00
Vikram S. Adve
85b46d6c6d *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@857 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-17 23:53:16 +00:00
Vikram S. Adve
c811c2ec0b Only list automatically generated .cpp files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@854 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-17 12:34:26 +00:00
Chris Lattner
386a3b7b95 Simplify some code
Remove Method special case
Fix bug exposed by this testcase:

implementation

void "PtrFunc2"()
begin
bb1:
        %reg = add int(int)* null, null
        add int (int)* %reg, null
        ret void
end


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@852 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-16 19:54:17 +00:00
Ruchira Sasanka
1b732fd0d6 changed debugg message printing - no change to useful code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@850 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-16 16:34:44 +00:00
Ruchira Sasanka
47c1372e09 No major change - commented some debug code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@849 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-16 01:33:55 +00:00
Ruchira Sasanka
92e251cc29 No major change - added some comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@848 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-16 01:25:05 +00:00
Ruchira Sasanka
c4d4b76efb Added support for caller saving
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@847 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-16 01:23:19 +00:00
Chris Lattner
f927bb482e Emit the proper .type declarations to tell the debugger what a function is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@845 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 19:34:17 +00:00
Chris Lattner
c28f6d6258 Handle abnormal jmpl syntax correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@844 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 19:21:31 +00:00
Chris Lattner
7b851abd85 Implement ulong & long support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@843 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 19:18:26 +00:00
Chris Lattner
634b352fa6 Print Debug Code to stderr instead of stdout so that it doesn't mess up the assembly output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@841 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 18:30:06 +00:00
Chris Lattner
1e23ed7c65 Output to cerr rather than cout so that debug info doesn't mess up assembly generation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@840 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 18:15:27 +00:00
Chris Lattner
1bffea0341 Add new Pass infrastructure and some examples
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@836 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 17:31:51 +00:00
Ruchira Sasanka
b8354a8e4f --added support for implicit operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@832 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 16:58:50 +00:00
Ruchira Sasanka
a90e77061d updated suggesting/coloring of call & return args & implicit operands.
Changed added instr to a deque (from a vector)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@831 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 16:26:38 +00:00
Ruchira Sasanka
cc3ccac238 updated suggesting/coloring of call & return args & implicit operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@830 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 16:25:28 +00:00
Ruchira Sasanka
21721b63c3 fixed a coalscing bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@828 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 16:22:44 +00:00
Chris Lattner
ec0a95f4e4 Be const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@826 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 15:54:43 +00:00
Chris Lattner
39bb5b4ee9 Implement initializers for structs and pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@823 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 13:25:40 +00:00
Chris Lattner
c18545dc9e Rename ConstPoolPointerReference to ConstPoolPointerRef - My fingers get tired typing that much
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@822 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 13:21:42 +00:00
Chris Lattner
f84b9bc33b * getExitNode() doesn't exist in method anymore
* Make local functions static


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@820 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 13:07:21 +00:00
Vikram S. Adve
54287145e7 Added Instrumentation subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@819 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 12:01:05 +00:00
Chris Lattner
2e42d3a306 Implement global variables. Struct and Pointer initializers are not implemented yet though
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@818 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 05:51:48 +00:00
Chris Lattner
8d2de8a82c Implement linking of global variable constant references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@817 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 03:12:52 +00:00
Chris Lattner
6bb46cdf27 Oops, didn't handle hex values correctly. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@815 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 00:05:03 +00:00
Chris Lattner
c5bdb247e4 * Fix the constpoolarray -> c"" printing routines to escape things properly
* Fix slightly broken sharing problems
* Do not escape the literal string passed in


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@814 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-14 23:54:12 +00:00
Chris Lattner
5fdc4c91ae Minor cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@812 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-14 23:29:30 +00:00