Commit Graph

706 Commits

Author SHA1 Message Date
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
2a408f06b5 Bug fix: In preventing static global variables from being printed twice,
I also prevented external globals from being printed twice, but they
should (extern declaration and definition).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4043 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-05 23:43:10 +00:00
Nick Hildenbrandt
d2eb386c16 Add parens around constant calls to getelemptr to properly associate the reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4032 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-03 20:47:24 +00:00
Nick Hildenbrandt
ca626922bc I was wrong on the removing of those references on the last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4023 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 21:14:33 +00:00
Nick Hildenbrandt
51c84d14ab Removed unneeded reference and dereferences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4016 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:34:51 +00:00
Nick Hildenbrandt
275801b2dd Cleaned up my last check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4014 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:32:35 +00:00
Nick Hildenbrandt
113ad893b9 No longer include malloc.h. If protoypes are needed for memory functions they will be present in the byte code and the generated c as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4013 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:20:18 +00:00
Nick Hildenbrandt
c3dd2af428 Fixed to properly escape quotes in strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3991 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-30 21:11:55 +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
Chris Lattner
aa31ad016a Convert TargetData to be an ImmutablePass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3927 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 23:46:55 +00:00
Nick Hildenbrandt
e548f009f7 Strings now handled correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3920 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 20:29:26 +00:00
Nick Hildenbrandt
c14ded4858 Parenthesis are now added to casts of type array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3892 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 21:02:50 +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
Vikram S. Adve
c308aefe92 Disable reassociation pass in LLC until it is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3883 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 12:55:50 +00:00
Anand Shukla
c078930ee3 Changed codegen to add 2 empty slots at the top of stack using StackSlots pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3873 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-21 05:01:21 +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
Chris Lattner
d1cf1b458a Fix cwriter to not output FP constants in ascii, output them in hex instead.
This fixes a number of FP precision problems, making the output of the
power benchmark closer to the right answer.

Unfortunately, this only addresses FP constants used directly in functions.
Constants referred to by global constants (such as an array of FP values)
aren't helped by this.  Until this happens power won't work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3871 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 23:26:33 +00:00
Chris Lattner
1f8c4a17c1 Fix bug: 2002-09-20-VarArgPrototypes.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3870 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 22:32:30 +00:00
Chris Lattner
270d78a8d6 Fix output of typedefs to avoid syntax errors.
* We now can correctly Cify the Olden-power benchmark


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3860 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:20:24 +00:00
Chris Lattner
58d04d4e35 * Add a couple of comments to the output c code
* _FIX_ infinite recursion problem, due to typedefs of a structure being
  printed before the structure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3859 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:18:30 +00:00
Chris Lattner
2db41cd5de Another change that doesn't affect functionality. Since we are only looking
at types in the symbol table, only traverse the type plane, saving a loop nest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3858 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:12:13 +00:00
Chris Lattner
2c601a7be1 Make the StructPrinted set only take memory when it's being used.
rename parseStruct to printContainedStructs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3857 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:05:40 +00:00
Chris Lattner
a4c047ec27 No functionality changes, primarily just changing tab indentation to space
indentation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3856 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 14:56:54 +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
e5b2565a02 Add peephole optimization pass at the end of code generation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3846 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:52:43 +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
913bfbc2e4 Don't print global variable definitions twice! Sun's pathetic compiler
never complained about this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3774 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 11:50:38 +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