Commit Graph

1189 Commits

Author SHA1 Message Date
Brian Gaeke
d0534a863a Edit comment for accuracy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8562 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 15:36:50 +00:00
Vikram S. Adve
5be7434c8b Fix longjmp case so that, along with the call to abort(), we also
generate the appropriate CallArgsDescriptor and tmp. virtual regs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8554 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 05:56:22 +00:00
Vikram S. Adve
bed4effb84 Add flag to control whether or not delay slots are filled during
instruction scheduling (this is off by default).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8553 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 05:55:15 +00:00
Brian Gaeke
41de073b04 Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8523 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 05:28:42 +00:00
Misha Brukman
37f92e2568 Fixed spelling and grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8489 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 22:34:13 +00:00
Misha Brukman
2f2d06506c Fixed spelling and grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8478 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 18:14:24 +00:00
John Criswell
1a51956d11 Don't explicitly use $SourceDir to find the tblgen files. This causes make
some confusion when trying to generate files (it probably couldn't tell that
./file and $(SourceDir)/file may be the same file).
Now, just let VPATH find everything, and list the primary tblgen file first in
the list of dependencies so that we can just use $< to reference it in the make
rule.

This should hopefully fix the nightly tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8433 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 14:10:44 +00:00
John Criswell
410d1b5dea Updated to find source files using VPATH. This makes writing build rules
much cleaner and easier.
Labeled .td as a suffix for tblgen files in Makefile.rules.
Modified build rules so that source files generated during the build are placed
in the build directory and not the source directory (and not in a Debug
directory).  This makes the system cleaner and allows us to have a read-only
source tree.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8424 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 20:57:03 +00:00
John Criswell
69077e28d7 Checkin of autoconf-style object root.
Adjusted Makefile to work with new autoconf-style object root.
Specifically, use the new -I option of tblgen to find include files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8379 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-06 14:50:22 +00:00
Misha Brukman
103f0c3472 Added some optimizations:
* Generate a single BA instead of 6-instruction JUMP if possible
  (this occurs both in the creation and overwriting of the stub code)
* If possible, rewrite the ORIGINAL call to call the generated function
  directly, thus bypassing the stub entirely

Also added some statistics on how often calls are overwritten and how often the
CompilationCallback is invoked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8376 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 22:59:31 +00:00
Chris Lattner
84be5ad94a No longer provide an optinfo, noone uses it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8311 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:40:59 +00:00
Chris Lattner
a89d8f7468 Inline simple comparison which is sparc specific anyway
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8309 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:38:03 +00:00
Chris Lattner
67699ffe7f Move private interfaces into private .h file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8306 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:33:07 +00:00
Chris Lattner
e96e2630f3 Simplify code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8301 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:24:06 +00:00
Chris Lattner
84681f1184 LiveRange.h is now in lib/CodeGen/RegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8299 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:17:13 +00:00
Chris Lattner
47c97513a8 This file is hopelessly out of date
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:14:00 +00:00
Chris Lattner
893f9541dc LiveRangeInfo got moved into the lib/CodeGen/RegAlloc directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8297 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:12:17 +00:00
Chris Lattner
70b2f56e76 PhyRegAlloc.h got moved to lib/CodeGen/RegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8296 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:09:04 +00:00
Chris Lattner
c083dcccbf Move IGNode from public include directory to here. Minor cleanups like adding std:: namespace qualifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8295 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:05:47 +00:00
Chris Lattner
bcc6dec741 IGNode got moved to lib/CodeGen/RegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8294 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:00:08 +00:00
Chris Lattner
fdba393cc0 This file just needs LiveRange.h not IGNode.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8293 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 19:58:02 +00:00
Chris Lattner
87d50f0566 No longer include IGNode.h in the Sparc global header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8292 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 19:56:48 +00:00
Misha Brukman
cfd67c96dc * Use alloca() to force GCC not to eliminate frame pointer
* Break apart saving and restoring registers into separate functions
* Instead of saving single and double FP registers, just save the double
  registers -- aliasing helps preserve the single FP registers as well.
* Request just as much memory for a stub as we actually use


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8200 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-29 04:22:54 +00:00
John Criswell
c9afb499f6 Fixed two double free bugs that caused llc to segfault or run forever.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8191 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 21:43:17 +00:00
Tanya Lattner
3b6b6ba4be Removing README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8180 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 17:17:59 +00:00
Tanya Lattner
4f839ccf49 Putting my revised version of ModuloScheduling in cvs. This is not complete...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8179 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 17:12:14 +00:00
Tanya Lattner
8dc9982e2e Moved index into BB to common graph class because its needed by ModuloSchedGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8174 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 15:30:40 +00:00
Tanya Lattner
d6d863392f Added/removed header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8160 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-27 15:12:24 +00:00
Tanya Lattner
c50ee556e5 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8153 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-27 02:42:58 +00:00
Tanya Lattner
b6489f3153 First version of SchedGraph common class and refactoring of SchedGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8148 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-25 22:42:20 +00:00
Chris Lattner
bb144a892b Targets should configure themselves based on a Module, not some wierd flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8132 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:49:48 +00:00
Misha Brukman
ef6a6a69ff The word dependent' has no a'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:14:26 +00:00
Chris Lattner
e287cfdfd0 Fix spello
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:05:57 +00:00
Chris Lattner
f3526e2207 Change all #include'd files to be :: rules instead of : rules
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8019 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 20:37:17 +00:00
Chris Lattner
72af6b8e5d Add support for the sig(set|long)jmp intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7951 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 16:06:09 +00:00
Misha Brukman
5560c9d49c Spell `necessary' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 14:43:39 +00:00
Brian Gaeke
77d2f511c0 Rename -emitmaps to -enable-maps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7913 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-16 00:23:16 +00:00
Misha Brukman
d2dfc9628d Now that the JIT memory manager allocates as many bytes as necessary rather than
rounding up to a page, we need to request (num instrs * 4) bytes. However, I
think that 64 bytes is overkill for the stub function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7888 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 18:03:06 +00:00
Misha Brukman
15d1d57f61 Fix register and parameter numbers in saving double FP registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7884 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 16:15:28 +00:00
Chris Lattner
e3561c23c2 Remove uses of the NonCopyable class, to make the doxygen output look better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7880 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 05:20:06 +00:00
Misha Brukman
fad4929ee2 * Must save FP registers when calling CompilationCallback(), because FP
registers are global, are NOT windowed, and hence can be clobbered!
* Removed unused register shorthand notations
* Fixed and cleaned up comments in inline assembly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7853 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 00:26:50 +00:00
Vikram S. Adve
891bd82e79 Improvement to the previous fix: branch following a delay slot of
another delayed instr. would cause the later sanity-check (assertion)
in PhyRegAlloc.cpp to fail, even though there is really no error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7848 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 20:45:56 +00:00
Misha Brukman
640b9280d5 Since we now have TableGen editing modes for VIM and (X)Emacs, we no longer need
to mark TableGen description files with "C++ mode".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7841 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 15:16:28 +00:00
Chris Lattner
a8e40f54e5 Restore 'nice name' to pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7840 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 14:43:24 +00:00
Brian Gaeke
bf3c4cfaad Factory methods for function passes now return type FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7839 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:09:32 +00:00
Brian Gaeke
e69f72758b Unbreak SPARC backend: addPassesToJITCompile and
addPassesToEmitMachineCode now both take a FunctionPassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7837 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:04:59 +00:00
Brian Gaeke
277aad2655 Factory methods for function passes now return type FunctionPass *.
Get rid of RegisterLLC, which can't handle FunctionPasses anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7836 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:04:49 +00:00
Brian Gaeke
d7d6bbe697 Unbreak SPARC backend: addPassesToJITCompile and
addPassesToEmitMachineCode now both take a FunctionPassManager.
Factory methods for function passes now return type FunctionPass *.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7835 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:04:29 +00:00
Chris Lattner
48e6079478 Adjust files for move of mapping info stuff into the Sparc directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7802 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 02:38:16 +00:00
Vikram S. Adve
feb3298fca For instructions in a delay slot of another instruction,
we no longer need to find the live-before set of the delayed
branch since that set is now included the live-before/after
set of the instructions in each delay slot.  Just assert that instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7796 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 22:22:24 +00:00
Vikram S. Adve
88d962aa58 For an instruction with delay slots, mark all live values before
the instruction as being live before/after the delay slot
instructions as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7795 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 22:19:59 +00:00
Vikram S. Adve
20a3be3ba8 Disable emitting LLVM-to-MI maps, by default.
Add -emitmaps options to turn this back on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7774 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 15:51:02 +00:00
Vikram S. Adve
9d27514a21 Fix va_arg to generate LDDFi for floating point values, instead of LDXi.
All non-FP cases use LDXi as before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7765 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 03:04:05 +00:00
Vikram S. Adve
4ecff5df8c Register argument to va_start must be marked as defined!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7734 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 18:42:47 +00:00
Misha Brukman
b8db66eb17 Implement LLVM intrinsics llvm.setjmp' and llvm.longjmp' as follows:
* setjmp() simply returns 0
* longjmp() simply calls abort()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7676 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 15:43:46 +00:00
Vikram S. Adve
97a95bdbdd Fix sanity-checking in 'maskUnsigned' code to be more precise:
use or def-and-use operands can be substituted after one def-only
operand has been substituted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7674 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 15:01:26 +00:00
Misha Brukman
fe8a796833 Changing command-line option formats to be more consistent with LLVM style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7658 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 23:25:25 +00:00
Misha Brukman
58ba50fea7 * Renamed option from nopreselect' to nopreopt' since it disables more than
just PreSelection
* Wrapped code at 80 columns
* Added the DecomposeMultiDimRefs Pass to the JIT compilation path


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7657 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 23:06:21 +00:00
Misha Brukman
0870e970ff Use the registers g1 and g5 as temporaries for making far jumps and far calls,
because saving i1 and i2 to their ``designated'' stack slots corrupts unknown
memory in other functions, standard libraries, and worse.

In addition, this has the benefit of improving JIT performance because we
eliminate writing out 4 instructions in CompilationCallback() and 2 loads and 2
stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7653 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 22:19:18 +00:00
Vikram S. Adve
e895a740c7 1. Bug fix: was using SLL instead of SLLX for ULongTy. Chump.
2. Handle fp-to-uint conversions directly here instead of relying on
   a pre-transformation to replace them with the 2-step conversion.
3. Use size rather than explicitly checking types when deciding what
   opcodes to use, wherever possible.  This is less error prone (the
   bug fix above was not the first time!).
4. Float-to-pointer casts shd now work though this hasn't been tested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7645 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 18:48:40 +00:00
Vikram S. Adve
5ac1175ada Remove conversion of fp-to-uint cast into a multi-step cast:
this is not an optional transformation on SPARC and is now handled
directly by instruction selection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7644 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 18:42:49 +00:00
Misha Brukman
0897c60822 SparcV9CodeEmitter.cpp:
* Doxygen-ified comments
* Added capability to make far calls (i.e., beyond 30 bits in CALL instr)
  which implies that we need to delete function references that were added by
  the call to addFunctionReference() because the actual call instruction is 10
  instructions away (thanks to 64-bit address construction)
* Cleaned up code that generates far jumps by using an array+loop

SparcV9CodeEmitter.h:
* Explained more of the side-effects of emitFarCall()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7639 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 16:20:22 +00:00
Chris Lattner
3fd1f5bb6a Use a new local data structure instead of the MachineInstr::regsUsed set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7621 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 22:11:13 +00:00
Chris Lattner
c393c57afc Add a map
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7620 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 22:09:31 +00:00
Chris Lattner
6ae3117582 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7619 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 22:03:27 +00:00
Chris Lattner
3bed95b628 Physical registers no longer live in the regsUsed set for each machine instr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7618 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 21:55:58 +00:00
Chris Lattner
907b7dc9bd This method has now been changed to preserve flags for us!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7603 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 16:59:24 +00:00
Misha Brukman
f4de783582 * Removed `using' declaration, now use full namespace qualifier std::string
* Simplified code by using an inline function instead of copy-pasted code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7597 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 16:01:50 +00:00
Misha Brukman
c3cd8afe96 * Set annul bit to be 0, because the Sparc backend currently does not use it.
* Use the name of the predict field instead of just the const 1 in the
  Instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7592 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 14:34:38 +00:00
Chris Lattner
7cc7d987a4 Transition to using 'let X = y' instead of 'set X = y'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7565 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 05:03:18 +00:00
Chris Lattner
556d89de58 DEBUG got moved to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7495 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:19:03 +00:00
Chris Lattner
02f7fa482a Remove makefile complexity by always running tablegen with its final output
directory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7485 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 20:34:56 +00:00
Vikram S. Adve
72666e6c30 Add all arithmetic operators to ConstantExprToString().
Note that some generated operators (like &, | or ^) may
not be supported by the assembler -- but if they've got
this far, it's better to generate them and let the assembler decide.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7476 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 15:55:53 +00:00
Vikram S. Adve
97e02ebd86 *Both* operands of divide need sign-extension before divide (if smaller
than machine register size), not just the second operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7475 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 15:54:38 +00:00
Vikram S. Adve
248932b08a Put back the separate pass to decompose multi-dimensional references
since it is *necessary* for correct code generation.  Only optional
transformations belong in the PreOpts pass (which needs to be renamed
from PreSelection to PreOpts).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7474 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 15:53:24 +00:00
Chris Lattner
942e7230e5 We no longer need to preprocess SparcV9.td before sending it through tablegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7437 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 21:00:37 +00:00
Vikram S. Adve
db68577691 When emitting a constant, check for ConstantExpr before
ordinary (primitive) types since ConstantExprs may be of primitive type!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7418 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 12:54:47 +00:00
Chris Lattner
7a3dd8651f Conform to the new interface for describing target registers... even though
it's currently not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7416 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 05:51:34 +00:00
Chris Lattner
b4d3f46ba2 Only regenerate the .inc file if IT has changed, not just if the .td files
have changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7414 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 05:49:17 +00:00
Chris Lattner
dbc1ab88ae Do not use 'cpp' directly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7404 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 23:04:41 +00:00
Misha Brukman
92aa8ca9c5 * Cleaned up and corrected comments wrt instruction formats
* Enabled STXFSR instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7400 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 21:21:20 +00:00
Misha Brukman
a21b8e8213 Make emitFarCall() public, and add a few comments to functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7399 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 20:52:56 +00:00
Vikram S. Adve
e6124d3b7c Unify all constant evaluations that depend on register size
in ConvertConstantToIntType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7395 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:59:23 +00:00
Vikram S. Adve
deb9634f0e Rename 'dump-asm' to 'dump-input' and really print it just before code-gen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7394 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:58:00 +00:00
Vikram S. Adve
00477cf26d Bug fix: don't unnecessarily pretty-print control-characters, some of
which were wrong (particularly, '\a' for '\007').


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7393 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:57:34 +00:00
Vikram S. Adve
ada280faa9 Add ConvertConstantToIntType() to unify all constant handling
that depends on machine register size.
Moved insertCallerSavingCode() to PhyRegAlloc and
moved isRegVolatile and modifiedByCall to TargetRegInfo: they are all
machine independent.  Remove several dead functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7392 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:54:41 +00:00
Vikram S. Adve
83d30c89e5 Add code to support stack spill/temp offsets that don't fit in the
immed. field.  Moved insertCallerSavingCode() to PhyRegAlloc: it is
now machine independent.  Remove all uses of PhyRegAlloc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7391 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:53:21 +00:00
Vikram S. Adve
b5161b60c2 All constant-evaluation code now unified into
TargetInstrInfo::ConvertConstantToIntType().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7390 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:50:12 +00:00
Vikram S. Adve
814030a0c5 1. Bug fix: Don't use branch operand reg. as temp. reg. when
spilling values used by an instruction in the delay slot of the branch
   (which will eventually be moved before the branch).
2. Bug fix:  Delete the delay slot instr, not the branch instr, when
   moving delay slot instr. out!!!!
3. Move code to insert caller-saves moved here from SparcRegInfo:
   it is now machine-independent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7389 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:49:21 +00:00
Vikram S. Adve
7a81a0fd13 Don't require a BB to look-up live variables, unless they may need to
be recomputed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7388 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:42:32 +00:00
Vikram S. Adve
b403b2c019 Add const version of getLiveRangeForValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7386 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:38:22 +00:00
Vikram S. Adve
102f295114 Code to insert caller-saves moved here from SparcRegInfo: it is now
machine-independent.
Fix problem with using branch operand reg. as temp. reg. when
spilling values used by an instruction in the delay slot of the branch
(which will eventually be moved before the branch).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7385 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:37:41 +00:00
Misha Brukman
a1f1fea105 * Correctly emit a far call if the target address does not fit into 30 bits
instead of assert()ing
* Fixed a nasty bug where '07' was used instead of register 'o7'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7382 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:00:58 +00:00
Chris Lattner
38b8979da1 Specify the value type for the register, not just the size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7357 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 04:25:36 +00:00
Chris Lattner
8d3f8e226d Making this code const-correct would be a pain, so I'll hack it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7350 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:29:51 +00:00
Chris Lattner
9cdaa63f57 Be const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7348 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:23:41 +00:00
Chris Lattner
e5a61ccdc5 Hrm, another necesary one :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7347 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:22:19 +00:00
Chris Lattner
6856d11231 This code doesn't modify the LLVM structure, keep stuff const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7343 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:04:00 +00:00
Chris Lattner
1d598fa25a Remove #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7342 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:01:04 +00:00
Chris Lattner
bae47e5691 Remove extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7341 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:00:29 +00:00
Vikram S. Adve
7dc7de5391 (1) Major fix to the way unused regs. are marked and found for the FP
Single and FP double reg types (which share the same reg class).
    Now all methods marking/finding unused regs consider the regType
    within the reg class, and SparcFloatRegClass specializes this code.
(2) Remove machine-specific regalloc. methods that are no longer needed.
    In particular, arguments and return value from a call do not need
    machine-specific code for allocation.
(3) Rename TargetRegInfo::getRegType variants to avoid unintentional
    overloading when an include file is omitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7334 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:12:15 +00:00
Vikram S. Adve
e9a567cc77 1. Fix a case that was marking the invalid reg. num. (-1) as used,
causing a nasty array bound error later.
2. Fix silly typo causing logical shift of unsigned long to use
   SRL instead of SRLX.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7330 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:08:58 +00:00
Vikram S. Adve
bc001b24a1 (1) Change the way unused regs. are marked and found to consider regType
info (since multiple reg types may share the same reg class).
(2) Remove machine-specific regalloc. methods that are no longer needed.
    In particular, arguments and return value from a call do not need
    machine-specific code for allocation.
(3) Rename TargetRegInfo::getRegType variants to avoid unintentional
    overloading when an include file is omitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7329 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:06:09 +00:00
Vikram S. Adve
34a856749f Remove unused field. Change the way unused regs. are marked and
found to consider regType info (since multiple reg types may share
the same reg class, e.g., single and double on Sparc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7327 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:00:13 +00:00
Chris Lattner
949a362802 Remove redundant const qualifiers from cast<> expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7253 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:30:06 +00:00
Chris Lattner
c07736a397 Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:22:26 +00:00
Chris Lattner
c8bf87af3e Remove unnecessary casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7250 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:17:51 +00:00
Chris Lattner
9daa8a12d3 Random cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7247 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 14:59:40 +00:00
Chris Lattner
1815383276 Remove using decl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7246 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 14:55:59 +00:00
Chris Lattner
43234493de Simplify code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7217 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-21 19:56:49 +00:00
Anand Shukla
6da69e75ec Added special consideration for instrumentation strategy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7208 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-20 15:39:30 +00:00
Misha Brukman
dfbfc57d78 Fixed the number translation scheme for the integer condition code registers: it
now works in instructions which require a 2-bit or 3-bit INTcc code.

Incidentally, that means that the representation of INTcc registers is now the
same in both integer and FP instructions. Thus, code became much simpler and
cleaner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7185 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 20:30:40 +00:00
Misha Brukman
cf7ec875ba The name should really be `simm11' to follow the naming convention, but this has
no change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7184 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 20:27:44 +00:00
Misha Brukman
2c4fe5813c No need for a second immediate field if the class already inherits one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7182 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 21:27:14 +00:00
Misha Brukman
a34b619f67 Encode predict = 1 by default, because the Sparc assembler does this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7181 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 21:26:49 +00:00
Misha Brukman
07d4516f92 Correctly handle calls to functions which are further away than 2**32 bits will
allow, i.e. make a sequence of instructions to enable an indirect call using
jump-and-link and 2 temporary registers (which we save and ultimately restore).

Warning: if the delay slot of a function call is used to do meaningful work and
not just a NOP, this behavior is incorrect. However, the Sparc backend does not
yet utilize the delay slots effectively, so it is not necessary to make an
overly complicated algorithm for something that's not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7178 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 19:09:43 +00:00
Misha Brukman
173e250548 * Added support for the %ccr register
* FP double registers are now coded correctly
* Removed function which converted registers based on register types, it was
  broken (because regTypes are broken)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7175 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-14 23:26:03 +00:00
Misha Brukman
bc0e998c49 The word separate' only has one e'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7173 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-14 17:20:40 +00:00
Vikram S. Adve
951df2b1bd Several important bug fixes:
(1) Cannot use ANDN(ot), ORN, and XORN for boolean ops, only bitwise ops.

(2) Conditional move instructions must distinguish signed and unsigned
    condition codes, e.g., MOVLE vs. MOVLEU.

(3) Conditional-move-on-register was using the cond-move-on-cc opcodes,
    which produces a valid-looking instruction with bogus registers!

(4) Here's a really cute one: dividing-by-2^k for negative numbers needs to
    add 2^k-1 before shifting, not add 1 after shifting.  Sadly, these
    are the same when k=0 so our poor test case worked fine.

(5) Casting between signed and unsigned values was not correct:
    completely reimplemented.

(6) Zero-extension on unsigned values was bogus: I was only doing the
    SRL and not the SLLX before it.  Don't know WHAT I was thinking!

(7) And the most important class of changes: Sign-extensions on signed values.
    Signed values are not sign-extended after ordinary operations,
    so they must be sign-extended before the following cases:
	-- passing to an external or unknown function
	-- returning from a function
	-- using as operand 2 of DIV or REM
	-- using as either operand of condition-code setting operation
           (currently only SUBCC), with smaller than 32-bit operands


Also, a couple of improvements:

(1) Fold cast-to-bool into Not(bool).  Need to do this for And, Or, XOR also.

(2) Convert SetCC-Const into a conditional-move-on-register (case 41)
    if the constant is 0.  This was only being done for branch-on-SetCC-Const
    when the branch is folded with the SetCC-Const.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7159 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 20:07:54 +00:00
Vikram S. Adve
940a3a47b0 Bug fix in creating constants: need 1U << 31, not 1 << 31.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7158 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:48:19 +00:00
Vikram S. Adve
ad80db6d7d Fold cast-to-bool into not. Later, this should also be folded into other
boolean operations: AND, OR, XOR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7157 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:47:42 +00:00
Vikram S. Adve
4d2faf6307 Values stored in CallArgsDescriptor cannot be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7156 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:46:15 +00:00
Vikram S. Adve
24d0410db0 isMarkedForSpill() should be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7155 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:45:28 +00:00
Vikram S. Adve
51bda6fccb Print out all neighbors in interference graph, not just higher-numbered ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7153 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:43:33 +00:00
Vikram S. Adve
3bf089227b Several fixes to handling of int CC register:
(1) An int CC live range must be spilled if there are any interferences,
    even if no other "neighbour" in the interf. graph has been allocated
    that reg. yet.  This is actually true of any class with only one reg!

(2) SparcIntCCRegClass::colorIGNode sets the color even if the LR must
    be spilled so that the machine-independent spill code doesn't have to
    make the machine-dependent decision of which CC name to use based on
    operand type: %xcc or %icc.  (These are two halves of the same
register.)

(3) LR->isMarkedForSpill() is no longer the same as LR->hasColor().
    These should never have been the same, and this is necessary now for #2.

(4) All RDCCR and WRCCR instructions are directly generated with the
    phony number for %ccr so that EmitAssembly/EmitBinary doesn't have to
    deal with this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7152 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:42:55 +00:00
Vikram S. Adve
b15f8d446a Several fixes to handling of int CC register:
(1) An int CC live range must be spilled if there are any interferences,
    even if no other "neighbour" in the interf. graph has been allocated
    that reg. yet.  This is actually true of any class with only one reg!

(2) SparcIntCCRegClass::colorIGNode sets the color even if the LR must
    be spilled so that the machine-independent spill code doesn't have to
    make the machine-dependent decision of which CC name to use based on
    operand type: %xcc or %icc.  (These are two halves of the same register.)

(3) LR->isMarkedForSpill() is no longer the same as LR->hasColor().
    These should never have been the same, and this is necessary now for #2.

(4) All RDCCR and WRCCR instructions are directly generated with the
    phony number for %ccr so that EmitAssembly/EmitBinary doesn't have to
    deal with this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7151 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:42:11 +00:00
Misha Brukman
2988612f1b Elaborated assembly syntax of instructions in the comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7120 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 22:18:42 +00:00
Misha Brukman
35f19cc7b2 Removed unnecessary assignment (it was taken care by a superclass) and clarified
some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7119 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 22:18:06 +00:00
Misha Brukman
de11f2d038 Moved RegClassIDs enum to be next to the RegTypes enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7114 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 16:52:39 +00:00
Vikram S. Adve
9c570ee129 Correction to last fix: Pointer types do not return true in Type::IsIntegral().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7113 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 22:50:31 +00:00
Vikram S. Adve
97539fc4b6 Choose register instead of immediate for ConstantExpr in ChooseRegOrImmed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7112 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 20:33:21 +00:00
Vikram S. Adve
786833ad34 Major bug fix though it happened rarely (only on a compare after an
integer overflow):
We need to use %icc and not %xcc for comparisons on 32-bit or smaller
integer values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7111 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 20:13:59 +00:00
Vikram S. Adve
46d3f8e34c Make the RegClassID values public -- there is no other way to get them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7109 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 19:53:59 +00:00
Misha Brukman
9cedd433eb Apparently, the "regType" and "regClass" used in the Sparc backend are not both
correct: empirically, "regType" is wrong for a number of registers. Thus, one
can only rely on the "regClass" to figure out what kind of register one is
dealing with.

This change switches to using only "regClass" and adds a few extra DEBUG() print
statements and a few clean-ups in comments and code, mostly minor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7103 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-03 18:36:47 +00:00
Misha Brukman
ce14ec3901 * Force all "don't care" bits to 0 so that there are absolutely no unset bits in
the TableGen descriptions; all unset bits are thus errors.
* As a result, found and fixed instructions where some operands were not
  actually assigned into the right portion of the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7074 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 19:37:48 +00:00
Misha Brukman
bd272999dd The classes F4_3 and F4_4 have an `rd' operand that needs to be set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7073 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 18:27:47 +00:00
Misha Brukman
a8fcdd8d04 Properly fix instruction syntax in comments, using `imm' for instructions that
use an immediate value instead of a register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7072 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 18:15:43 +00:00
Misha Brukman
69bf93081f Fixed instruction syntax in the comments (specifies how instr is used).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 18:02:58 +00:00
Vikram S. Adve
ea28dd3392 Force fixed-size but large alloca objects to the dynamically allocated
area to avoid using up precious stack space within the 4095 offset limit
from %fp.  Such objects that would themselves live at a large offset
were being put there already so this is a simple change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7066 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 06:59:22 +00:00
Vikram S. Adve
65b2f401af Minor beautification: fold a couple of lines of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7054 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:24:00 +00:00
Vikram S. Adve
799ffeede1 (1) Major bug fix: DecomposeArrayRef() replaces its argument instr. and
deletes it, but we were merrily trying to fix the operands of that
    instruction anyway!  Instead, fix the replacement instruction.

(2) An Improvement: Check for and extract global values in all operands,
    not just in known pointer operands.  For example, they can occur in
    call arguments, and probably other unforeseeable places as well.
    This also eliminates the special-case handling of Load and Store.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7053 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:23:15 +00:00
Vikram S. Adve
74d15d36f5 A def. operand of a machine instruction may be an ordinary Value*,
not just an Instruction*, at least in one unfortunate case:
the first operand to the va_arg instruction.
Modify ValueToDefVecMap to map from Value*, not Instruction*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7052 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:16:01 +00:00
Vikram S. Adve
784a18b8ba Bug/case fixes:
(1) select: Ok to convert a pointer to a float or double.
(2) regalloc: Some MachineInstr* for caller-saving code before a call
    were being inserted before and after the call!
(3) Don't insert the caller-saving instructions in the
    MachineCodeForInstruction for the Call instruction.
    *All* instructions generated by register allocation need to be
    recorded in those maps, but it needs to be done uniformly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7051 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:13:57 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Vikram S. Adve
80544444a3 Add the padding needed for variable-size alloca's, which should work now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6859 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 02:13:57 +00:00
Chris Lattner
3889a2cb05 Remove a ton of extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:08:05 +00:00
Chris Lattner
c901e8bd9e Some preprocessors doen't support // comments and get confused
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6821 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-20 23:14:50 +00:00
Vikram S. Adve
ddafa49edc RDCCR defines arg. #1, not arg. #2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6796 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-20 11:32:11 +00:00
Brian Gaeke
2e2f2dcd6a lib/Target/Sparc/Sparc.cpp:
Move LowerAllocations, PrintFunction, and SymbolStripping passes, and
  the corresponding -disable-strip and -d options, over here to the SPARC
  target-specific bits of llc. Rename -d to -dump-asm.

tools/llc/Makefile:
 Reindent. Add x86 library so that llc compiles again.

tools/llc/llc.cpp:
 Remove support for running arbitrary optimization passes. Use opt instead.
 Remove LowerAllocations, PrintFunction, and SymbolStripping passes, as noted
  above.
 Allow user to select a backend (x86 or SPARC); default to guessing from
  the endianness/pointer size of the input bytecode file.
 Fix typos.
 Delete empty .s file and exit with error status if target does not support
  static compilation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6776 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 21:14:23 +00:00
Chris Lattner
c8621e6f28 These instructions really take three operands. This fixes some assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6765 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 15:09:02 +00:00
Chris Lattner
2eb9a257c8 Actually, change it to use explicit new/delete, which is more likely to be
optimized INTO an alloca


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6727 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 22:29:09 +00:00
Chris Lattner
0bf9476701 Remove two using decls
Remove usage of alloca


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6725 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 22:18:28 +00:00
Brian Gaeke
ad95d9ef50 Isolate machine-dependent use of <alloca.h> in "Support/Alloca.h",
so that we can easily change its use to be conditional on the result of
an autoconf test later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6723 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 21:54:01 +00:00
Chris Lattner
ff97fbc527 Rename FInfo.cpp to FunctionInfo.cpp, eliminate FInfo.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6712 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 15:31:52 +00:00
Chris Lattner
fb4d20bad8 move contents of include/llvm/Reoptimizer/Mapping/FInfo.h into here, it is sparc internal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6711 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 15:31:09 +00:00
Chris Lattner
84c9d5c3c0 Fix invalid number of arguments problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6692 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 12:03:00 +00:00
John Criswell
be583b914d Included assert.h so that the code compiles under newer versions of GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6682 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-11 14:01:36 +00:00
John Criswell
9aa2639370 Updated for the new projects Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6678 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-11 13:49:11 +00:00
Guochun Shi
0e93687cca add some comments
add a function ModuloScheduling::dumpFinalSchedule() to print out final schedule


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6677 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 20:04:30 +00:00
Guochun Shi
e95b827db2 add an brief instruction what this pass is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6676 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 20:03:39 +00:00
Guochun Shi
0b970dad72 a simple introduction to this pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6675 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 20:02:16 +00:00
Guochun Shi
f325261856 cleaned code
add some comments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6674 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 19:09:00 +00:00
Guochun Shi
8f1d4ab409 delete useless functions
add comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6673 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-08 23:16:07 +00:00
Guochun Shi
33280524f4 change DEBUG to DEBUG_PRINT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6672 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-08 20:40:47 +00:00
Misha Brukman
6fe6905df2 Do not hastily change the Opcode from 'r' to 'i' type if we're not actually
SETTING the operand to be an immediate or have verified that one of the operands
is really a SignExtended or Unextended immediate value already, which warrants
an 'i' opcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6662 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-07 02:34:43 +00:00
Misha Brukman
8631ac4b76 Print address out as hex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6657 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 09:53:28 +00:00
Misha Brukman
f75bab7756 Added 'r' and 'i' versions to WRCCR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6656 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 09:52:58 +00:00
Misha Brukman
d36e30e623 * Changed Bcc instructions to behave like BPcc instructions
* BPA and BPN do not take a %cc register as a parameter
* SLL/SRL/SRA{r,i}5 are there for a reason - they are ONLY 32-bit instructions
* Likewise, SLL/SRL/SRAX{r,i}6 are only 64-bit
* Added WRCCR{r,i} opcodes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6655 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 09:52:23 +00:00
Misha Brukman
a51245036e * Removed PreSelection pass because that is now done in the JIT
* Removed instruction scheduling as it is too slow to run in a JIT environment
* Removed other passes because they aren't necessary and can slow JIT down


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6652 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 07:11:16 +00:00
Misha Brukman
de07be3b78 Fixed a bunch of test cases in test/Regression/Jello which could not get the
address of a floating-point (allocated via ConstantPool) correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6647 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 04:41:22 +00:00
Misha Brukman
3339459e48 * If a global is not a function, just ask the MachineCodeEmitter for the addr
* Do not block a print statement with a DEBUG() guard if we're going to abort()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6645 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 03:35:37 +00:00
Misha Brukman
82c9e55913 The SUB*i instructions belong to a different class than their SUB*r brethren.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6644 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 03:34:47 +00:00
Misha Brukman
8f1222245e Put all debug print statements under the DEBUG() guard to make output clean so
that tests can automatically diff the output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6642 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 00:26:11 +00:00
Misha Brukman
6994dab12a Fixed confusion between register classes and register types.
Now %fcc registers are recognized correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6640 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 23:51:10 +00:00
Misha Brukman
432fba5572 Added missing directive to store the instruction name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6639 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 23:35:11 +00:00
Misha Brukman
ce50542179 Moved predict and annul fields to the end of each individual instruction
class, because they are currently unused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6638 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 23:33:15 +00:00
Misha Brukman
d4ad1d10bc Do not preset the cc register, the instructions actually use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6637 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 23:30:27 +00:00
Vikram S. Adve
cf819454e4 Minor tuning -- avoid a non-inlinable function call on every operand.
Also, reorder a couple of functions for inlining.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6635 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 21:12:56 +00:00
Misha Brukman
f47d9c28d9 Added lazy function resolution to the JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6633 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 20:52:06 +00:00
Misha Brukman
e77d65a8ed * The textual output of (non-)predicted FP branches is the same.
* Stop mapping FBcc instructions to deprecated opcodes, map to FBPcc instead.
* Fixed opf in FCMPxy instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6632 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 20:51:37 +00:00
Misha Brukman
406d9abc9e All store instructions really want 'rd' in the first field.
Special cases: STFSRx and STXFSRx - they operate on predefined rd=0 or rd=1, and
expect %fsr as the parameter in assembly. They are disabled (since not used)
until an encoding, both for code generation and output, is chosen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6619 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 01:06:10 +00:00
Misha Brukman
2e7e8fadf8 Added missing 'rs1' field to F3_rdrs1imm13, 'rd' to F3_rdrs1rs2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6618 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 00:39:45 +00:00
Brian Gaeke
aeab1e163f lib/CodeGen/Mapping/MappingInfo.cpp:
Update file comment to contain a bunch of the overview mapping-info
  documentation previously buried within the file.
 Remove some unnecessary include/using stmts.
 Rename pass to MappingInfoCollector.
 Rewrite a lot of it so it doesn't use global instance variables and so
  it outputs into MappingInfo objects and then dumps those out, instead of going
  straight to an assembly file.
 Change name of factory to getMappingInfoCollector.
 Fold prologue & epilogue writers into MappingInfo methods.

lib/Target/Sparc/FInfo.cpp:
 Correct file comment to reflect above change

lib/Target/Sparc/Sparc.cpp:
 Change name of factory to getMappingInfoCollector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6617 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 22:07:12 +00:00
Brian Gaeke
c86b8d5c46 Add file comment. Include <vector> and <string>. Update include guards
to reflect file's current location.  Add definition of class
MappingInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6616 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 22:02:47 +00:00
Chris Lattner
e5d4293cba Revert brians patch to get mapping info working again
sorry dude


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6615 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 21:01:12 +00:00
Tanya Lattner
758578e158 Had to comment out a line in outByte() to get it to compile because Out and tmp were
undeclared. I was not sure what Brian wanted, so I will let him fix this. But now it compiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6614 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 20:53:46 +00:00
Misha Brukman
a2196c1aae * Instead of re-inventing the MachineConstantPool emitter that's already given
in Emitter.cpp, just convert the Sparc version of the constant pool into
  what's already supported and inter-operate.
* Implemented a first pass at lazy function resolution in the JITResolver. That
  required adding a SparcV9CodeEmitter pointer to simplify generating
  bit-patterns of the instructions.
* SparcV9CodeEmitter now creates and destroys static TheJITResolver, which makes
  sense because the SparcV9CodeEmitter is the only user of TheJITResolver, and
  lives for the entire duration of the JIT (via PassManager which lives in VM).
* Changed all return values in the JITResolver to uint64_t because of the 64-bit
  Sparc architecture.
* Added a new version of getting the value of a GlobalValue in the
  SparcV9CodeEmitter, which now works for already-generated functions (JITted or
  library functions).
* Removed little-used and unused functions, cleaning up the internal view of the
  SparcV9CodeEmitter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6612 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 20:01:13 +00:00
Brian Gaeke
e961d9614a Make writeNumber() void. Get ready to decouple it from .byte directive output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6609 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 18:17:22 +00:00
Misha Brukman
d15cd2752f I have finally seen the light. The code to change the opcode must live higher in
the loop, and in both cases. In the first case, it is a VReg that is a constant
so it may be actually converted to a constant. In the second case, it is already
a constant, but then if it doesn't change its type (e.g. to become a register
and have the value loaded from memory if it is too large to live in its
instruction field), we must change the opcode BEFORE the 'continue', otherwise
we miss the opportunity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6602 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 04:54:06 +00:00
Misha Brukman
d22807a43e Added the 4.7 instruction class and all the FMOVcc instructions in them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6601 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 04:48:31 +00:00
Misha Brukman
f5b1d3dcd4 Comment out opcodes currently unused in the Sparc backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6597 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 02:57:55 +00:00
Misha Brukman
9dc3ede509 Added instruction format class 3.15 and floating-point compare instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6594 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 02:26:14 +00:00
Chris Lattner
2ab5e120d4 Avoid generating a getelementptr instruction of a function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6591 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 01:24:40 +00:00
Brian Gaeke
fc97c8b225 Make the write*map methods more self-contained. Document some more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6589 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 19:30:15 +00:00
Brian Gaeke
e14ccafe25 I documented this file, in an attempt to understand it, with a view toward
rewriting it.  I also vacuumed out all the commented-out code and
inaccurate comments, etc.

(We need to put the mapping information in a data structure so that we can
pass it out to the JIT, instead of automagically converting it to .byte
directives.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6574 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 07:56:05 +00:00
Chris Lattner
946ef12273 Use the new -o tablegen option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6572 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 05:06:33 +00:00
Misha Brukman
e8e28dd7af Constants are laid out in memory in PC-relative form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6568 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 03:24:12 +00:00
Misha Brukman
e630b7f3e9 Added opcode conversion for conditional move of integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6567 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 03:23:35 +00:00
Misha Brukman
ea481ccc8f * Convert load/store opcodes from register to immediate forms.
* Stop code from wrapping to the next line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6566 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 03:21:58 +00:00
Misha Brukman
c559e0590b Convert load/store opcodes from register to immediate forms, if necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6565 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-03 03:20:57 +00:00