Commit Graph

787 Commits

Author SHA1 Message Date
Chris Lattner
d344242f2e Make sure to escape \'s when they are output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4179 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-15 19:56:24 +00:00
Vikram S. Adve
edf3a727b7 Print "circular" warning message only in debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4170 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 16:32:49 +00:00
Vikram S. Adve
efc9433960 Removed misleading const keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4169 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 16:32:24 +00:00
Vikram S. Adve
cf911de3c6 Significant improvement: GEP used by a load or store no longer generates
a separate ADD; instead just use the indexed load/store instruction!
Also, a bug fix: folding a GEP with a leading non-zero index with
its predecessor was incorrect: now it only happens if the predecessor
is pointing to an indexable type (aka SequentialType).


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4165 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 06:14:18 +00:00
Chris Lattner
0b16ae209a - Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
reflect the fact that it's a range being defined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 19:39:16 +00:00
Vikram S. Adve
1632e882f1 Use vectors instead of hash_maps for issueGaps and conflictLists.
These hash lookups were a major sink of time because they happen so often!
Also, add option to disable scheduling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4138 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:40:37 +00:00
Vikram S. Adve
acf0f704f9 Major bug fix: was not adding CD edges for RETURNs!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4137 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:39:22 +00:00
Vikram S. Adve
fee76265ff Several major fixes, particularly in emitting constant aggregates:
(1) Padding bytes between structure fields (for alignment) were never
    being emitted into the constant pool so the layout did not match!
(2) In printing constants, structures containing structures or arrays
    were never handled.
(3) Support new model for external/uninitialized/initialized globals.
    Uninitialized globals are no longer emitted since they are external.
    Initialized globals may go either in .bss or in .data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4134 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:32:18 +00:00
Vikram S. Adve
42e90cf4be Don't use %l0 for large operands to a SAVE since it is needed *before* SAVE!
We now use %g1 instead since that is shared and volatile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4133 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:24:06 +00:00
Vikram S. Adve
e0048667dd Don't mark JMPLCALL and JMPLRET as branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4132 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:22:32 +00:00
Vikram S. Adve
d3e26482ff (1) Try to evaluate constant when multiplying 2 constants.
(2) Use intelligent multiply selection code for array allocas.
(3) Don't use cache padding for alloca'd stack slots!
(4) Bug fix in handling call arguments: was not copying sixth FP arg
    to int reg. when calling a function with no prototype.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4130 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:18:57 +00:00
Vikram S. Adve
04ef49985b Eliminate duplicate target pointer in SparcRegInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4129 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:06:04 +00:00
Vikram S. Adve
c654c784f6 Eliminate duplicate target pointer. Also add a few assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4128 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:05:30 +00:00
Vikram S. Adve
893cace8e2 Make sure to handle small negative values hiding as large unsigned longs --
this is a common case created by the front-end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4127 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:04:26 +00:00
Vikram S. Adve
d0451a9233 Major fix: extract ConstantExpr nodes and decompose them into symbolic
instructions so that (a) constant folding is done automatically before
code generation, and (b) selection does not have to deal with them.
Also, check for ConstantPointerRefs in additional to GlobalValues
when creating a GEP to load a global address.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4126 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 00:01:57 +00:00
Vikram S. Adve
cb202e3de5 Major bug fix: spill code for an instruction in a delay slot was
merrily being inserted before/after the instruction!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4116 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-11 16:12:40 +00:00
Vikram S. Adve
aebdbe6988 Bug fix in folding getElementPtr instructions: don't fold one into
a predecessor if it has a non-zero first index and the predecessor
ends with a struct index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3982 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 22:55:05 +00:00
Vikram S. Adve
1c397aae8e Added a couple of helper methods for live range construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3970 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:05:43 +00:00
Vikram S. Adve
9d67cd1468 Live ranges for Return value and return address of a Call are now
created here, simply by handling all implicit operands (which should
have been done anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3969 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:05:22 +00:00
Vikram S. Adve
f425884e27 Fixed method getReturnValue(): it should return NULL if the
callee does not return a value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3968 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:03:54 +00:00
Vikram S. Adve
ad9c978874 Fixed incorrect assertion: spill code for function ptr should be
handled like normal operands, not like other call arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3967 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:02:40 +00:00
Vikram S. Adve
ac67006bed Return address register should be marked as "result" for the JMPL instruction
since it is defined by the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3966 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:00:15 +00:00
Vikram S. Adve
87817653fe Live ranges for Return value and return address of a Call are no longer
created here.  Instead they are created in LiveRangeInfo.cpp.  This
simplifies the code here quite a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3965 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 16:59:05 +00:00
Vikram S. Adve
106604ea6d Simplified code that handles call args and rets, so it no longer
needs the RegClass list to be passed in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3964 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 16:56:59 +00:00
Vikram S. Adve
4a8bb2bf23 Simplify Call translation slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3963 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 16:55:41 +00:00
Vikram S. Adve
94c408104a Overhaul integer conversions to match C++ ISO standard.
Don't allow direct FP-to-uint conversion (must be eliminated by preselection).
Address arithmetic for arrays is now entirely 64-bit so no sign-ext needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3961 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:33:08 +00:00
Vikram S. Adve
5cededee92 Modify operand order for Create{Sign,Zero}ExtensionInstructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3960 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:29:45 +00:00
Vikram S. Adve
7e5167a3e2 Bug fix: some redundant copies were not being deleted after detection :-|.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3959 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:27:37 +00:00
Vikram S. Adve
1c10f17552 Sign-extend integer constants from original type size to 64 bits!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3958 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:26:20 +00:00
Vikram S. Adve
e9cb735131 Decompose FP-to-UInt casts into FP-to-ULong-toUInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3957 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:24:45 +00:00
Vikram S. Adve
1b5710a8fc Put intermediate source files in a subdirectory here instead of with
object files.  Also,


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3884 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 13:12:28 +00:00
Anand Shukla
33db9bae15 Initial version: it adds 2 empty slots at the top of stack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3872 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-21 04:58:26 +00:00
Vikram S. Adve
0efb50761d Add method IGNode::getCombinedDegree to count the sum of the degrees
of two nodes, excluding duplicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3848 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:55:04 +00:00
Vikram S. Adve
d55697cf13 Added class MachineOptInfo as interface to target-specific
routines supporting machine code optimization.
Also added method MachineInstrInfo::getNOPOpCode().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3845 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:52:09 +00:00
Vikram S. Adve
32f81a3469 Allow copy coalescing in more cases: if sum of node degrees is more than
than #available regs, compute the sum excluding duplicates and if that
is less than #regs, go ahead and coalesce.
Add method IGNode::getCombinedDegree to count excluding duplicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3842 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:45:47 +00:00
Vikram S. Adve
25d80cdcc6 Peephole optimization pass on final machine code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3840 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:42:11 +00:00
Vikram S. Adve
abf055c698 Moving these files from Code/PreSelection to here.
Original logs for PreSelection.cpp:

  revision 1.2
  date: 2002/09/17 23:50:32;  author: lattner;  state: Exp;  lines: +1 -3
  Don't put default parameter values into .cpp files, it breaks 3.x compilers

  revision 1.1
  date: 2002/09/16 15:31:13;  author: vadve;  state: Exp;
  New preselection pass that specializes LLVM code for a target machine,
  while remaining in legal portable LLVM form and preserving type
  information and type safety.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3838 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:29:28 +00:00
Anand Shukla
b379470b90 Removed debug info printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3778 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 20:24:46 +00:00
Chris Lattner
82f05d8610 Add support for GCC 2.96
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3777 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 17:23:09 +00:00
Vikram S. Adve
e102a64beb Use ulong instead of uint for size expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3744 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:56:45 +00:00
Vikram S. Adve
4900116ab0 Add methods to query about the representation of LLVM quantities (e.g.,
constants).  Useful for target-dependent LLVM transformations like
Preselection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3743 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:56:01 +00:00
Vikram S. Adve
13f1d71c80 Don't print out global names unnecesssarily. Also, expose pass
constructors so passes can be inserted by TargetMachine.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3742 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:54:02 +00:00
Vikram S. Adve
e1f7280bf8 Move all the code that creates code generation passes from Sparc.cpp to
TargetMachine.cpp, since it is entirely machine-independent.
Also, add options to disable optional back-end passes (preselection and
instr. scheduling).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3740 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:39:26 +00:00
Vikram S. Adve
fd0ec80197 Add a version of ChooseRegOrImmed to handle numerical constants
introduced by InstrSelection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3735 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:15:57 +00:00
Vikram S. Adve
993243e599 Fix typos in previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3726 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-15 15:33:48 +00:00
Chris Lattner
4bc2348008 RegAllocCommon no longer includes CommandLine.h so we have to include it
here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3725 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-15 07:07:55 +00:00
Vikram S. Adve
39c94e105f Break RA_DEBUG option into several levels to get better control over
debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3724 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 23:05:33 +00:00
Vikram S. Adve
521758fb79 Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3723 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 23:04:52 +00:00
Vikram S. Adve
7e914a967d Break RA_DEBUG option into several levels to get better output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3722 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 22:18:37 +00:00
Vikram S. Adve
7c26898401 Moving to lib/CodeGen/RegAlloc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3718 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 11:57:17 +00:00
Misha Brukman
3f93eeedbd Again, including Module makes Function unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3714 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 02:07:43 +00:00
Chris Lattner
597f81fea2 Fix a bug I introduced into the code generator. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3694 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-12 20:27:10 +00:00
Chris Lattner
0374b8de2b - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3683 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-11 01:21:35 +00:00
Chris Lattner
106ff4551c - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3681 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-11 01:21:29 +00:00
Vikram S. Adve
ec7f482d90 Silly bug fix: Machine code vector could be empty for a no-op cast instruction,
e.g., cast double to double.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3633 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-09 14:54:21 +00:00
Chris Lattner
823c4abb58 Make sure the leakdetector is told about temporary Phi nodes also, so it doesn't
erroneously report them as leaks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3624 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 21:19:29 +00:00
Chris Lattner
a175ed4194 Inform the memory leak detector that TmpInstruction objects should not be
subject to memory leak checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3623 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 21:08:43 +00:00
Vikram S. Adve
f36f06bb60 Add new function UltraSparcInstrInfo::CreateZeroExtensionInstructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3581 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-05 18:34:31 +00:00
Vikram S. Adve
84c0fcbde4 Bug fixes in casting between floats and ints smaller than 64 bits.
Add UltraSparcInstrInfo::CreateZeroExtensionInstructions to help with that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3580 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-05 18:33:59 +00:00
Vikram S. Adve
babc0fab19 -- Use size of pointer element type instead of pointer type in array offsets!
-- A few bug fixes in casting between floats and ints.
-- Use SRL reg, 0 instead of AND reg, 0xffffffff to clear high 32 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3579 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-05 18:32:13 +00:00
Vikram S. Adve
537a877998 -- Bug fix: use byte offsets not typed offsets in output assembly!
-- Add support for ConstantExpr constants (only cast and add operators so far)
-- Avoid generating label Bbss.bss, which sometimes came out twice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3578 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-05 18:28:10 +00:00
Chris Lattner
0c4e886dbf - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3574 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-03 01:08:28 +00:00
Anand Shukla
b85d265b16 moved this file from lib/Reoptimizer/Mapping
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3519 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-27 22:47:33 +00:00
Anand Shukla
5993829fbd Added getFunctionInfo and MappingInfoForFunction pass, and fixed the earlier error in compiling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3513 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-27 16:45:17 +00:00
Vikram S. Adve
74c83e44fa Use newly-added type inspection support in InstTreeNode subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3501 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-24 21:02:09 +00:00
Vikram S. Adve
685133382d Moved code here to extract memory instruction indices and to check
whether FoldGetElemNodes should be called.  This is machine-independent
but was in the Sparc directory.  This is in a new function: GetMemInstArgs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3500 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-24 21:00:08 +00:00
Vikram S. Adve
f28d9d643e LoadIdx non-terminal no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3499 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-24 20:58:04 +00:00
Vikram S. Adve
8cfffd3a3e Sign-extend values used to index arrays (and Simplify
SetOperandsForMemInstr significantly).  Load and Store
no longer have any indices.  Eliminate spurious sign-extension
on a cast to float/double.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3498 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-24 20:56:53 +00:00
Anand Shukla
6656c43ac7 Added #include <alloca.h>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3491 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-23 10:54:26 +00:00
Chris Lattner
3bb8ad27a8 Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3488 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 23:37:24 +00:00
Chris Lattner
cc63f1c674 Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3487 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 23:37:20 +00:00
Chris Lattner
abfb0b5e70 Change code to not use the copyOperands method added to User. It's now
more efficient to boot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3453 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 15:57:58 +00:00
Vikram S. Adve
da920aa55b dumpNode() does not need to print MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3444 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 02:59:46 +00:00
Vikram S. Adve
10472cec5e Fix two resource names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3443 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 02:58:57 +00:00
Vikram S. Adve
e99941a931 Add AsmPrinter::ConstantExprToString, which writes out a ConstantExpr
as an expression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3442 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 02:58:36 +00:00
Vikram S. Adve
30a6f49f09 Eliminate bool, boolreg and boolconst nonterminals, and just use
reg and Constant instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3441 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 02:56:10 +00:00
Vikram S. Adve
ccc13a49bd Change rules for Not, since it is now implemented as Xor(reg,11..1).
Eliminate bool, boolreg and boolconst nonterminals, and just use
reg and Constant instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3440 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 02:55:21 +00:00
Chris Lattner
044f908791 - Do not expose ::ID from any of the analyses anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3416 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 17:09:45 +00:00
Chris Lattner
5a905e20b7 This case JUST handles constantpointer nulls, not all pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3402 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-20 17:02:48 +00:00
Vikram S. Adve
85af131d9e Unary Not (boolean and bitwise) is no longer a separate LLVM instruction
but is instead implemented with XOR.  Note that the InstrForest opLabels
for Not and BNot remain the same, i.e., the XOR is recognized and
represented as a (boolean or bitwise) Not when building the instruction
trees.  But these tree nodes are now binary, not unary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3343 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 14:19:22 +00:00
Vikram S. Adve
ce08e1dd3e Revise code generation for unary Not (boolean and bitwise), which is
no longer a separate instruction but is instead implemented with XOR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3342 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 14:17:37 +00:00
Vikram S. Adve
6c0c3010da Several bug fixes in casting to signed int values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3301 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-13 18:04:08 +00:00
Vikram S. Adve
65a2deef8c Handle small unsigned results correctly by clearing high bits.
Bug fixes in casting to signed int values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3297 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-13 17:40:54 +00:00
Brian Ensink
7b0925f4d3 Build correctly in the face of /shared.
-Chris


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3296 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-12 22:09:44 +00:00
Chris Lattner
9568568b75 - Clean up interface to Sparc register handling a bit:
- Eliminate Sparc*Order classes, moving contents to Sparc*Class classes
   - get register name methods now return const char * const pointers instead
     of std::string's.
   - Added file header comments to SparcRegClassInfo.(cpp|h)
   - Moved BIG constant arrays out of SparcRegClassInfo.h, into
     SparcRegInfo.cpp.  This should allow a LOT of std::string constructors to
     not have to be called.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3295 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-12 21:25:05 +00:00
Chris Lattner
035dfbe7f2 * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3278 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 20:08:06 +00:00
Chris Lattner
179cdfb5c8 * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3277 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 20:08:03 +00:00
Chris Lattner
b91b31c12d We are using std::vector, so remove extraneous namespace prefixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3275 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 20:05:34 +00:00
Chris Lattner
919c4f8a44 Change machinecode for instruction to not inherit from vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3274 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 20:04:28 +00:00
Chris Lattner
b0cfa6dfec Very minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3271 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 18:55:18 +00:00
Chris Lattner
5f0eb8da62 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3265 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-08 19:01:30 +00:00
Chris Lattner
dd5b495129 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3264 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-08 19:01:28 +00:00
Chris Lattner
637ed869e6 Merge three loops into one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3259 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-07 21:39:48 +00:00
Chris Lattner
075f028b77 Fix breakage in the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3258 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-07 21:39:39 +00:00
Mehwish Nagda
5acd166ff5 added Mapping and Function Pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3251 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-05 23:23:19 +00:00
Vikram S. Adve
a40cbb3b7e Bug fix in CreateCodeToLoadConst(): use sign of dest, not operand,
in choosing how to create int-set instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3248 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-04 20:55:37 +00:00
Vikram S. Adve
99d4a38c77 Bug fix in SetOperandsForMemInstr: handle leading zeros correctly
when folding or not folding GEPs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3245 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-04 20:51:05 +00:00
Vikram S. Adve
1b51b1b4f9 Add function GetConstantValueAsUnsignedInt.
Fix 2 bugs in FoldGetElemChain so index vector is not modified
when no GEPs are folded in, and so a hasLeadingZero is computed
only for the last folded GEP, not the one after that if any.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3244 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-04 20:49:49 +00:00
Chris Lattner
75ac4e511a Fix compilation problem. IsIndexZero doesn't exist, use IsZero instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3243 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-03 20:57:38 +00:00
Vikram S. Adve
ed3fefb34c Simplified handling of array indexes in SetMemOperands_Internal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3236 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-03 13:48:21 +00:00
Vikram S. Adve
a4704045e8 Bug fix: incorrect SAVE instruction when using register for stack size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3198 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-01 14:26:11 +00:00
Vikram S. Adve
c190c01a9f Just improved comments and assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3191 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 21:13:31 +00:00
Vikram S. Adve
1e60669d3b Add a missing case: converting float/double to unsigned integer types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3188 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 21:01:34 +00:00
Chris Lattner
2e1749bbf8 * Move InstructionSelection Pass here instead of living in Sparc.cpp. It
is platform independant afterall.
* Object orientize the functions, cleanup code a bit.  Instead of static
  global functions, the helpers for instruction selection are now part of
  the InstructionSelection Pass class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 03:57:36 +00:00
Chris Lattner
057430d207 * Move InstructionSelection pass to lib/CodeGen/InstrSelection so it is
shared by backends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3146 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 03:56:16 +00:00
Chris Lattner
67fcce2b19 Remove unused vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3143 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 02:52:40 +00:00
Chris Lattner
97f51a3024 * Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3115 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-27 01:12:15 +00:00
Chris Lattner
1e43516dcf * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3112 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 21:12:44 +00:00
Chris Lattner
d8bbc06c87 Refix stuff for GCC 2.95, 3.0.4 & 3.1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3094 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 18:04:48 +00:00
Mehwish Nagda
e95ce74b80 now removes deleted nops from MachineCodeForInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3090 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 17:31:05 +00:00
Mehwish Nagda
0009c2e8b3 changed implementation of LLVM BYTECODE Length
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3089 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 17:22:48 +00:00
Chris Lattner
c6a4bf1251 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3077 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 15:00:45 +00:00
Chris Lattner
0c0edf8afc *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3075 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 06:17:51 +00:00
Chris Lattner
b82d97ebc3 GCC 3.1 changes, finally the burm file builds the FIRST time a clean directory is built.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3073 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 06:08:32 +00:00
Chris Lattner
cb6289a73d *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3058 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 21:21:33 +00:00
Chris Lattner
1089790546 Non-standard hash classes are not in the std:: namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3057 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 21:21:33 +00:00
Chris Lattner
09ff1126da *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3056 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 21:21:32 +00:00
Chris Lattner
56d27019e6 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 17:52:38 +00:00
Mehwish Nagda
6cf7849c1a moving to the Reoptimizer/Mapping dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2993 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 22:10:55 +00:00
Mehwish Nagda
5fb72ae7c3 moved from CodeGen to this dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2992 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 22:09:35 +00:00
Chris Lattner
5ff62e90d0 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2985 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:10:13 +00:00
Anand Shukla
3ee2ea8625 Adding code for outputing length in .s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2979 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-21 09:35:01 +00:00
Mehwish Nagda
cafc0d20bb changed size computation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2974 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-19 22:54:08 +00:00
Mehwish Nagda
e01166591f added check for Function with 0 BB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2942 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-17 23:40:33 +00:00
Chris Lattner
8b1b4e20a9 * Make global variables with external linkage get emitted correctly
* Do NOT add a prefix to global variables that are external
* Add newline after emitting a constpointerref


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2925 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 18:35:16 +00:00
Mehwish Nagda
3115540870 Now will profile all Basic Blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2922 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 17:48:27 +00:00
Mehwish Nagda
634cd1c4b4 Added the Mapping Pass to out put Mapping Info to .s file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2913 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 23:58:21 +00:00
Mehwish Nagda
b43086b4b7 Initial checking : Writes LLVM - MI mappiing to the .s file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2911 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 23:08:49 +00:00
Anand Shukla
24787fa2ed added std:: to vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2874 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-11 00:16:28 +00:00
Vikram S. Adve
975f6d4f44 Bug fix: cast (bool) has higher precedence than %... who knew!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2864 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:51:46 +00:00
Vikram S. Adve
6a49a1e321 Changed interface to insertCallerSavingCode().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2859 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:42:42 +00:00
Vikram S. Adve
06019fc8ad Stop using pseudo-instructions (SETX, SETUW, SETSW)
and generate actual machine instruction sequences directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2858 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:42:13 +00:00
Vikram S. Adve
195a5d5093 Add support to print %hh, %hm, %lm, or %lo in an operand field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2857 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:41:21 +00:00
Vikram S. Adve
53fd400cdf Major overhaul to stop using pseudo-instructions (SETX, SETUW, SETSW)
and generate actual machine instruction sequences directly.

Also a couple of bug fixes in code for putting constants into registers:
-- Do *not* sign-extend unsigned constant that is shorter than int reg size
-- Fix handling of address constant (a GlobalValue) vs. constant that
   must be loaded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2856 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:39:50 +00:00
Vikram S. Adve
dcde95fbbc More important fixes:
-- FP argument to a function with no prototype going on stack
   was not being copied to the stack in colorCallArgs().
-- Put caller-saving code *before* argument copying code so that
   we don't trash a register before saving it!
-- Two other minor fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2855 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 21:36:00 +00:00
Anand Shukla
d58290ed3b changed mem_fun to std::mem_fun
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2847 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-09 19:18:56 +00:00
Anand Shukla
b0ad8b002d Added std:: to mem_fun for 64-bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2845 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-09 19:16:59 +00:00
Vikram S. Adve
ec0de5cb4b Added support for printing constant global references to
assembly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2842 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-09 12:30:29 +00:00
Vikram S. Adve
fe09fb22aa Numerous changes in interface to class SparcRegInfo corresponding to
changes in class MachineRegInfo (see MachineRegInfo.h for details).

Added {LD,ST}[X]FSR instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2839 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:34:10 +00:00
Vikram S. Adve
0b04064054 class MachineCodeForBasicBlock is now an annotation on BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2838 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:31:24 +00:00
Vikram S. Adve
b2debdc5a9 BA no longer has the unused CC operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2837 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:30:59 +00:00
Vikram S. Adve
6418eac2f1 Have to save a boolean (setCC) value whenever use is outside the current
basic block.

Mark setCCInstr used as dest. of conditional-move as both a def and a use.

BA instruction no longer has the unused CC argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2836 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:30:14 +00:00
Vikram S. Adve
97da3649dd BA has only one argument.
Added LDFSR, LDXFSR, STFSR and STXFSR.
Fixed operands info for RDCCR, WRCCR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2835 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:25:17 +00:00
Vikram S. Adve
76ee6f70ea Significant changes to correctly spill CC registers and to correctly
handle conditional move instructions:
-- cpMem<->Reg functions now support CC registers (int and FP) correctly.
   Also, cpMem<->Reg functions now return a vector of machine instructions.
-- Scratch registers must be explicitly provided to cpMem<->Reg when
   needed, since CC regs need one to be copied to/from memory.
-- CC regs are saved to a scratch register instead of stack.
-- All regs used by a instruction are now recorded in MachineInstr::regsUsed,
   since regs used to save values *across* an instruction are not obvious
   either from the operands or from the LiveVar sets.
-- An (explicit or implicit) operand may now be both a def and a use.
   This is needed for conditional move operations.
   So an operand may need spill code both before and after the instruction.

Other changes:
-- Added several get{Class,Type} functions.
-- Added unified-to-local register number conversion.
-- class MachineCodeForBasicBlock is now an annotation on BasicBlock.
-- Suggest/Color methods may modify the MachineInstr (and always did),
   so don't make that argument const!
-- Caller-saving code doesn't need its special purpose code for
   handling CC registers since cpMem<->Reg handle those correctly now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2834 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:23:12 +00:00
Vikram S. Adve
f5af636dbe Significant changes to correctly spill CC registers and to correctly
handle conditional move instructions:
-- cpMem<->Reg functions now support CC registers (int and FP) correctly.
-- Scratch registers must be explicitly provided to cpMem<->Reg when
   needed, since CC regs need one to be copied to/from memory.
-- CC regs are saved to a scratch register instead of stack.
-- All regs used by a instruction are now recorded in MachineInstr::regsUsed,
   since regs used to save values *across* an instruction are not obvious
   either from the operands or from the LiveVar sets.
-- An (explicit or implicit) operand may now be both a def and a use.
   This is needed for conditional move operations.
   So an operand may need spill code both before and after the instruction.
-- class MachineCodeForBasicBlock is now an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2833 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:15:32 +00:00
Vikram S. Adve
c9a0ca5171 MachineInstr* in vector are not const (and never really were)
because operands may be modified directly to set register.
Also, class MachineCodeForBasicBlock is now an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2832 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:07:26 +00:00
Vikram S. Adve
1dcfd3c1a6 Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.h.
This class is now an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2829 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:03:10 +00:00
Vikram S. Adve
bf82a42d1c MachineInstr::dump() now takes no arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2828 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 23:01:46 +00:00
Vikram S. Adve
0baf1c0911 A single MachineInstr operand may now be both a def and a use,
so additional dep. edges have to be added.
This was needed to correctly handle conditional move instructions!
MachineCodeForBasicBlock is now an annotation on BasicBlock.
Renamed "earliestForNode" to "earliestReadyTimeForNode".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2826 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:59:23 +00:00
Vikram S. Adve
9afa88c3a7 A single MachineInstr operand may now be both a def and a use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2825 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:56:34 +00:00
Vikram S. Adve
c2580ddb08 getUsableUniRegAtMI interface simplified slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2822 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:39:36 +00:00
Vikram S. Adve
1871b2f1c2 MachineInstr* in vector are not const (and never really were)
because operands may be modified directly to set register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2820 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:34:40 +00:00
Chris Lattner
f59391ab9e Remove diff-cluttering tags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2808 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:12:03 +00:00
Chris Lattner
000f60d1b1 Remove tag that just clutters diffs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2807 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:08:25 +00:00
Anand Shukla
cfb22d3c14 changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2791 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:55:50 +00:00
Anand Shukla
a928403ca4 changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2789 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:35:19 +00:00
Anand Shukla
add9643e92 minor change in removing endl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2788 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:34:54 +00:00
Anand Shukla
4a9f933751 changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2786 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:22:25 +00:00
Chris Lattner
7e70829632 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:24 +00:00
Chris Lattner
0b12b5f50e MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2778 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:21 +00:00
Chris Lattner
18961504fc *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:12:52 +00:00
Chris Lattner
db241dcf51 Fix constness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2762 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-05 18:11:37 +00:00
Chris Lattner
122787bcff Fix Constness problems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2761 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-05 18:08:26 +00:00
Chris Lattner
44014418f5 Disable debugging output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2756 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-04 03:09:57 +00:00
Chris Lattner
85c5465e07 Convert RegClass::IsColorUsedArr from a dynamically allocated array to
a vector.  This makes asserting on array bounds easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2731 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-23 15:50:03 +00:00
Chris Lattner
70e60cbd4d Move debug options out of header files so that the header does not have
to #include CommandLine.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2712 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:08:27 +00:00
Chris Lattner
59dcbf9c03 Move the DEBUG_LV option out of the public header file into a private header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2711 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:07:26 +00:00
Chris Lattner
e87adaac31 Avoid #including CommandLine.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2710 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:06:56 +00:00
Mehwish Nagda
8532fb0d13 Fixed the makefile to not die when compiling a new, empty, source directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2688 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 15:58:24 +00:00
Chris Lattner
ad86b74baf Hide debugging options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2676 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:39:10 +00:00
Chris Lattner
5245f853c5 Don't lose namespace qualifications on previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2664 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 17:38:26 +00:00
Chris Lattner
36346c7a1e Rename IsPowerOf2 to isPowerOf2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2663 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 21:20:19 +00:00
Vikram S. Adve
0243ff9e62 InstrnsBefore and InstrnsAfter are now vectors instead of deques.
May be slightly less efficient but significantly reduces special
cases interfaces in code generation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2649 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:41:33 +00:00
Vikram S. Adve
36f0a9e5a6 Better folding getelementptr operations with mixed
array and struct indexes.
Update operand values in CallArgsDescriptor (a new class)
when replacing constant values with immediates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2645 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:34:29 +00:00
Vikram S. Adve
629b70f274 cpValue2Value now needs a vector of MachineInstr to store return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2644 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:31:08 +00:00
Vikram S. Adve
7e684a956a Annotation class for MachineInstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2643 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:30:21 +00:00
Vikram S. Adve
dabb41d93d Numerous bug fixes:
-- passing FP arguments to functions with more than 6 arguments
-- passing FP arguments to varargs functions
-- passing FP arguments to functions with no prototypes
-- incorrect coloring for CC registers (both int and FP): interferences
   were being completely ignored for int CC and were considered but no
   spills were marked for fp CC!

Also some code improvements:
-- better interface to generating machine instr for common cases
   (many places still need to be updated to use this interface)
-- annotations on MachineInstr to communicate information from
   one codegen phase to another (now used to pass information about
   CALL/JMPLCALL operands from selection to register allocation)
-- all sizes and offests in class TargetData are uint64_t instead of uint


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2642 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:29:31 +00:00
Vikram S. Adve
242a8086aa Numerous bug fixes:
-- correct sign extensions for integer casts and for shift-by-constant
   instructions generated for integer multiply
-- passing FP arguments to functions with more than 6 arguments
-- passing FP arguments to varargs functions
-- passing FP arguments to functions with no prototypes
-- incorrect stack frame size when padding a section
-- folding getelementptr operations with mixed array and struct indexes
-- use uint64_t instead of uint for constant offsets in mem operands
-- incorrect coloring for CC registers (both int and FP): interferences
   were being completely ignored for int CC and were considered but no
   spills were marked for fp CC!

Also some code improvements:
-- better interface to generating machine instr for common cases
   (many places still need to be updated to use this interface)
-- annotations on MachineInstr to communicate information from
   one codegen phase to another (now used to pass information about
   CALL/JMPLCALL operands from selection to register allocation)
-- all sizes and offests in class TargetData are uint64_t instead of uint


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2640 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:25:51 +00:00
Chris Lattner
9b625030c8 Replace all usages of Type::isPointerType with isa<PointerType>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2486 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:15:30 +00:00
Chris Lattner
86e9187dcc Add neccesary #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2406 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 18:48:55 +00:00
Chris Lattner
c6f3ae5c66 Eliminate duplicate or unneccesary #include's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 17:42:12 +00:00
Chris Lattner
96c466b06a Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2395 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 14:57:45 +00:00
Chris Lattner
97e52e4336 Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2386 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 21:27:06 +00:00
Chris Lattner
d50b671280 Add #include that was removed from TargetMachine.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2381 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 20:40:59 +00:00
Chris Lattner
97453d60c6 Include appropriate file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2379 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 20:40:16 +00:00
Chris Lattner
31bcdb822f Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:55:58 +00:00
Chris Lattner
bfeec103e1 Simplify and update code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2376 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:20:10 +00:00
Chris Lattner
1b7f7dc4b4 Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
to the global namespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2370 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:21:30 +00:00
Chris Lattner
8fc2f2072d Remove all contents of the cfg namespace to the global namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2369 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:19:42 +00:00
Chris Lattner
fd63f25fbd Simplify code
Remove unneccesary getID variant for module's


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2353 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 04:50:54 +00:00
Chris Lattner
483e14ee04 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2336 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 07:27:19 +00:00
Chris Lattner
f57b845547 * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 06:56:12 +00:00
Chris Lattner
35504209a0 Use the cast<> operator in favor of C style casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2331 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 03:14:39 +00:00
Chris Lattner
1a18b7cf80 Change Constant::getNullConstant to Constant::getNullValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2323 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:25:14 +00:00
Chris Lattner
87e873bd3d Simplify code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2322 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:24:17 +00:00
Vikram S. Adve
d23a229c4c Don't record instructions for copying method arguments in the
AddedInstrns sets for the first machine instruction.  It is hard
to ensure that the right order is preserved, and sure enough, the
order was broken.  Instead, use a separate set for the function entry.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2318 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:46:28 +00:00
Vikram S. Adve
0bc0516078 Don't pad spills and temp. stack areas for alignment.
Freeze auto vars and spill areas when their sizes are used
for computing other offsets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2317 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:43:45 +00:00
Vikram S. Adve
31f78c4f6b Major changes to how int and FP arguments are handled. Varargs
function calls were simply wrong; other functions were just not
using all available registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2316 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:42:21 +00:00
Vikram S. Adve
6d78311fd2 Added functions to compute which register, if any, to use
for a particular argument in a list of arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2315 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-25 04:40:24 +00:00