oota-llvm.git
21 years agoAdd SRoA pass to gccas
Chris Lattner [Fri, 30 May 2003 19:24:06 +0000 (19:24 +0000)]
Add SRoA pass to gccas

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6442 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoMove indvars pass after mem2reg pass where it is more likely to be useful
Chris Lattner [Fri, 30 May 2003 19:23:10 +0000 (19:23 +0000)]
Move indvars pass after mem2reg pass where it is more likely to be useful

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6441 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoOkay totally give up on trying to optimize aggregates that cannot be completely
Chris Lattner [Fri, 30 May 2003 19:22:14 +0000 (19:22 +0000)]
Okay totally give up on trying to optimize aggregates that cannot be completely
broken up into their elements.  Too many programs break because of this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6440 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoMade the register and immediate versions of instructions consecutive.
Misha Brukman [Fri, 30 May 2003 19:14:01 +0000 (19:14 +0000)]
Made the register and immediate versions of instructions consecutive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6439 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoadd a check that allows the SRoA pass to avoid breaking programs, even if their
Chris Lattner [Fri, 30 May 2003 18:09:57 +0000 (18:09 +0000)]
add a check that allows the SRoA pass to avoid breaking programs, even if their
behavior is technically undefined

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6438 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoBecause the format of the shift instructions is `shift r, shcnt, r', the
Misha Brukman [Fri, 30 May 2003 18:06:10 +0000 (18:06 +0000)]
Because the format of the shift instructions is `shift r, shcnt, r', the
instructions of format 3.12 and 3.13 cannot inherit from F3rdrs1, because that
implies that the two registers are the first two parameters to the instruction.

Thus I made the instructions inherit from F3rd again, and manually added an rs1
field AFTER the shcnt field in the instruction, which maps to the appropriate
place in the instruction.

The other changes are just elimination of unnecessary spaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6437 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoSorry, correcting small typo.
Tanya Lattner [Fri, 30 May 2003 15:53:50 +0000 (15:53 +0000)]
Sorry, correcting small typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6433 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded configurable options for the Linker and Archiver.
John Criswell [Fri, 30 May 2003 15:50:31 +0000 (15:50 +0000)]
Added configurable options for the Linker and Archiver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6432 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded the CloneTrace function which clones traces. It takes a vector of basic blocks...
Tanya Lattner [Fri, 30 May 2003 15:50:18 +0000 (15:50 +0000)]
Added the CloneTrace function which clones traces. It takes a vector of basic blocks, removes
internal phi nodes, and returns a new vector of basic blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6431 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded support for cloning a trace.
Tanya Lattner [Fri, 30 May 2003 15:48:23 +0000 (15:48 +0000)]
Added support for cloning a trace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6430 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoMakefile: Make SparcV9CodeEmitter.inc depend on SparcV9_F*.td as well.
Brian Gaeke [Fri, 30 May 2003 08:02:14 +0000 (08:02 +0000)]
Makefile: Make SparcV9CodeEmitter.inc depend on SparcV9_F*.td as well.
SparcV9_F3.td: F3_12 and F3_13 instructions have rd and rs1 fields. Also,
 their fields were totally screwed up. This seems to fix the problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6429 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFix bug: ScalarRepl/2003-05-30-MultiLevel.ll
Chris Lattner [Fri, 30 May 2003 05:26:30 +0000 (05:26 +0000)]
Fix bug: ScalarRepl/2003-05-30-MultiLevel.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6428 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoNew testcase
Chris Lattner [Fri, 30 May 2003 05:26:08 +0000 (05:26 +0000)]
New testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6427 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFix bug: ScalarRepl/2003-05-29-ArrayFail.ll
Chris Lattner [Fri, 30 May 2003 04:15:41 +0000 (04:15 +0000)]
Fix bug: ScalarRepl/2003-05-29-ArrayFail.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6425 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFix call to mmap, so that it can be used on sparc.
Brian Gaeke [Fri, 30 May 2003 03:37:13 +0000 (03:37 +0000)]
Fix call to mmap, so that it can be used on sparc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6424 91177308-0d34-0410-b5e6-96231b3b80d8

21 years ago so far everything compiles
Guochun Shi [Fri, 30 May 2003 00:17:09 +0000 (00:17 +0000)]
 so far everything compiles

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6423 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoImplementation of Equivalence Classes
Sumant Kowshik [Thu, 29 May 2003 22:44:25 +0000 (22:44 +0000)]
Implementation of Equivalence Classes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6422 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoChanges to support function pointers
Sumant Kowshik [Thu, 29 May 2003 22:43:46 +0000 (22:43 +0000)]
Changes to support function pointers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6421 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded support for function pointers
Sumant Kowshik [Thu, 29 May 2003 22:42:44 +0000 (22:42 +0000)]
Added support for function pointers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6420 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoPrevent lines from wrapping.
Misha Brukman [Thu, 29 May 2003 22:12:35 +0000 (22:12 +0000)]
Prevent lines from wrapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6419 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded documentation for the project options
Dinakar Dhurjati [Thu, 29 May 2003 21:49:00 +0000 (21:49 +0000)]
Added documentation for the project options

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6418 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoNew testcase
Chris Lattner [Thu, 29 May 2003 21:07:34 +0000 (21:07 +0000)]
New testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6417 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoGet rid of extraneous ""s
Chris Lattner [Thu, 29 May 2003 20:40:32 +0000 (20:40 +0000)]
Get rid of extraneous ""s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6416 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdd comment
Chris Lattner [Thu, 29 May 2003 20:26:30 +0000 (20:26 +0000)]
Add comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6415 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoInitial checkin
Chris Lattner [Thu, 29 May 2003 20:24:54 +0000 (20:24 +0000)]
Initial checkin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6414 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoNew testcases
Chris Lattner [Thu, 29 May 2003 20:15:35 +0000 (20:15 +0000)]
New testcases

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6412 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoSince there is now another derived .inc file, ignore them all.
Misha Brukman [Thu, 29 May 2003 20:15:27 +0000 (20:15 +0000)]
Since there is now another derived .inc file, ignore them all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6411 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoUse an absolute path to TableGen because not everyone (e.g. automatic tester)
Misha Brukman [Thu, 29 May 2003 20:09:56 +0000 (20:09 +0000)]
Use an absolute path to TableGen because not everyone (e.g. automatic tester)
has their path set up by this point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6410 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded a path to the current version of the built TableGen.
Misha Brukman [Thu, 29 May 2003 20:09:23 +0000 (20:09 +0000)]
Added a path to the current version of the built TableGen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6409 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoCheck in old tests
Chris Lattner [Thu, 29 May 2003 19:17:51 +0000 (19:17 +0000)]
Check in old tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6408 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoMinor reordering of options
Chris Lattner [Thu, 29 May 2003 19:16:55 +0000 (19:16 +0000)]
Minor reordering of options

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6407 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoRemoved configuration options that are better served in Makefile.config.
John Criswell [Thu, 29 May 2003 18:52:10 +0000 (18:52 +0000)]
Removed configuration options that are better served in Makefile.config.
Fixed the LibInstDir macro.
Added the use of the FLEX variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6405 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoMoved the FLEX and BISON macros from Makefile.common since they are
John Criswell [Thu, 29 May 2003 18:51:11 +0000 (18:51 +0000)]
Moved the FLEX and BISON macros from Makefile.common since they are
configuration options like CC and CXX.
Updated LLVMGCCDIR so that it refers to the valid LLVM gcc code.
Added pathnames and flags to be used by some of the tests.
Moved configuration options from Makefile.common to here since they
should all be in one place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6404 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded the target-independent part of TableGen data.
Misha Brukman [Thu, 29 May 2003 18:48:17 +0000 (18:48 +0000)]
Added the target-independent part of TableGen data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6403 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded project options to the Makefile.common
Dinakar Dhurjati [Thu, 29 May 2003 16:18:20 +0000 (16:18 +0000)]
Added project options to the Makefile.common

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6402 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoRun more post-link xforms
Chris Lattner [Thu, 29 May 2003 15:16:45 +0000 (15:16 +0000)]
Run more post-link xforms

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6400 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoChange tests to use testrunner
Chris Lattner [Thu, 29 May 2003 15:16:10 +0000 (15:16 +0000)]
Change tests to use testrunner
new test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6399 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFix formatting in file
Chris Lattner [Thu, 29 May 2003 15:13:15 +0000 (15:13 +0000)]
Fix formatting in file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6398 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoEliminate unnecessary ->get calls that are now automatically handled.
Chris Lattner [Thu, 29 May 2003 15:12:27 +0000 (15:12 +0000)]
Eliminate unnecessary ->get calls that are now automatically handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6397 91177308-0d34-0410-b5e6-96231b3b80d8

21 years ago* Separate all of the grunt work of inlining out into the Utils library.
Chris Lattner [Thu, 29 May 2003 15:11:31 +0000 (15:11 +0000)]
* Separate all of the grunt work of inlining out into the Utils library.
* Make the function inliner _significantly_ smarter.  :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6396 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoDon't require the user to do something like isa<foo>(II->get()). The ->get
Chris Lattner [Thu, 29 May 2003 15:08:33 +0000 (15:08 +0000)]
Don't require the user to do something like isa<foo>(II->get()).  The ->get
should be implicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6395 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agodyn_cast_or_null should work just the same as dyn_cast does
Chris Lattner [Thu, 29 May 2003 15:07:48 +0000 (15:07 +0000)]
dyn_cast_or_null should work just the same as dyn_cast does

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6394 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoDoxygenify comments
Chris Lattner [Thu, 29 May 2003 15:06:40 +0000 (15:06 +0000)]
Doxygenify comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6393 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoWhen TableGen finds an error in the SparcV9.td file, it exits with a non-zero
Misha Brukman [Thu, 29 May 2003 05:29:22 +0000 (05:29 +0000)]
When TableGen finds an error in the SparcV9.td file, it exits with a non-zero
exit code. This, in turn, makes an empty file SparcV9CodeEmitter.inc, and only
much later, produces a link error because the key function that TableGen creates
isn't found.

Using a temporary file in the middle forces a good .INC file to be generated by
TableGen, and it will keep trying until you fix the input file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6392 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFixed misspelling and broke a line that was wrapping.
Misha Brukman [Thu, 29 May 2003 05:00:14 +0000 (05:00 +0000)]
Fixed misspelling and broke a line that was wrapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6391 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFixed to use the correct format of the instruction.
Misha Brukman [Thu, 29 May 2003 04:53:56 +0000 (04:53 +0000)]
Fixed to use the correct format of the instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6390 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoThis should work better with re-generating the SparcV9CodeEmitter.inc file.
Misha Brukman [Thu, 29 May 2003 03:32:49 +0000 (03:32 +0000)]
This should work better with re-generating the SparcV9CodeEmitter.inc file.
Also, added a rule to delete the generated .inc file on `make clean'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6389 91177308-0d34-0410-b5e6-96231b3b80d8

21 years ago* Broke up SparcV9.td into separate files as it was getting unmanageable
Misha Brukman [Thu, 29 May 2003 03:31:43 +0000 (03:31 +0000)]
* Broke up SparcV9.td into separate files as it was getting unmanageable
* Added some Format 4 classes, but not instructions
* Added notes on missing sections with FIXMEs
* Added RDCCR instr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6388 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agommap() seems to be failing on Sparc, so just use malloc()/free() .
Misha Brukman [Wed, 28 May 2003 18:44:38 +0000 (18:44 +0000)]
mmap() seems to be failing on Sparc, so just use malloc()/free() .

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6387 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoOutput the opcode name of the instruction being emitted to cerr.
Misha Brukman [Wed, 28 May 2003 18:29:10 +0000 (18:29 +0000)]
Output the opcode name of the instruction being emitted to cerr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6386 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoCorrectly write out binary data as chars, before they're cast to ints.
Misha Brukman [Wed, 28 May 2003 18:27:19 +0000 (18:27 +0000)]
Correctly write out binary data as chars, before they're cast to ints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6385 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFixed ordering of elements in instructions: although the binary instructions
Misha Brukman [Wed, 28 May 2003 17:49:29 +0000 (17:49 +0000)]
Fixed ordering of elements in instructions: although the binary instructions
list (rd, rs1, imm), in that order (bit-wise), the actual assembly syntax is
instr rd, imm, rs1, and that is how they are constructed in the instruction
selector. This fixes the discrepancy.

Also fixed some comments along the same lines and fixed page numbers referring
to where instructions are described in the Sparc manual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6384 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdd dependency to make TableGen rule fire.
Brian Gaeke [Wed, 28 May 2003 17:41:09 +0000 (17:41 +0000)]
Add dependency to make TableGen rule fire.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6383 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoThree kinds of boolean values handled incorrectly:
Vikram S. Adve [Wed, 28 May 2003 13:54:41 +0000 (13:54 +0000)]
Three kinds of boolean values handled incorrectly:
-- setCC of FP type used by a Phi: have to save in reg.
-- setNE of FP type used by a branch: cannot use result directly in branch!
-- setCC used outside the same basic block: have to save in reg. for now

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6382 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFixed an error preventing compilation.
Misha Brukman [Tue, 27 May 2003 22:48:28 +0000 (22:48 +0000)]
Fixed an error preventing compilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6381 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded the 'r' and 'i' annotations to instructions as their opcode names have
Misha Brukman [Tue, 27 May 2003 22:44:44 +0000 (22:44 +0000)]
Added the 'r' and 'i' annotations to instructions as their opcode names have
changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6380 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded a debugging code emitter that prints code to a file, debug to std::cerr,
Misha Brukman [Tue, 27 May 2003 22:43:19 +0000 (22:43 +0000)]
Added a debugging code emitter that prints code to a file, debug to std::cerr,
and passes the real code to a memory-outputting code emitter. This may be
removed at a later point in development.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6379 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoKeep track of the current BasicBlock being processed so that a referencing
Misha Brukman [Tue, 27 May 2003 22:41:44 +0000 (22:41 +0000)]
Keep track of the current BasicBlock being processed so that a referencing
MachineInstr can later be patched up correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6378 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded 'r' and 'i' annotations to instructions as SparcInstr.def has changed.
Misha Brukman [Tue, 27 May 2003 22:40:34 +0000 (22:40 +0000)]
Added 'r' and 'i' annotations to instructions as SparcInstr.def has changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6377 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
Misha Brukman [Tue, 27 May 2003 22:39:01 +0000 (22:39 +0000)]
Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.

Non-obvious change: since I have changed ST and STD to be STF and STDF to
(a) closer resemble their name (NOT assembly text) in the Sparc manual, and
(b) clearly specify that they they are floating-point opcodes,
I made the same changes in this file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6376 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
Misha Brukman [Tue, 27 May 2003 22:37:00 +0000 (22:37 +0000)]
Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
Here I had to make one non-trivial change: add a function to get a version of
the opcode that takes an immediate, given an opcode that takes all registers.

This is required because sometimes it is not known at construction time which
opcode is used because opcodes are passed around between functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6375 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.
Misha Brukman [Tue, 27 May 2003 22:35:43 +0000 (22:35 +0000)]
Added 'r' or 'i' annotations to instructions, as SparcInstr.def has changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6373 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded entries for each of the instructions with annotations ('r' or 'i').
Misha Brukman [Tue, 27 May 2003 22:33:39 +0000 (22:33 +0000)]
Added entries for each of the instructions with annotations ('r' or 'i').

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6372 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoOne of the first major changes to make the work of JITting easier: adding
Misha Brukman [Tue, 27 May 2003 22:32:38 +0000 (22:32 +0000)]
One of the first major changes to make the work of JITting easier: adding
annotations on instructions to specify which format they are (i.e., do they take
2 registers and 1 immediate or just 3 registers) as that changes their binary
representation and hence, code emission.

This makes instructions more like how X86 defines them to be. Now, writers of
instruction selection must choose the correct opcode based on what instruction
type they are building, which they already know. Thus, the JIT doesn't have to
do the same work by `discovering' which operands an instruction really has.

As this involves lots of small changes to a lot of files in lib/target/Sparc,
I'll commit them individually because otherwise the diffs will be unreadable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6371 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoCannot output `static' in generated cpp code: results in error. It's already
Misha Brukman [Tue, 27 May 2003 22:29:02 +0000 (22:29 +0000)]
Cannot output `static' in generated cpp code: results in error. It's already
specified as a static member in class definition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6370 91177308-0d34-0410-b5e6-96231b3b80d8

21 years ago* Allow passing in an unsigned configuration to allocateSparcTargetMachine()
Misha Brukman [Tue, 27 May 2003 22:24:48 +0000 (22:24 +0000)]
* Allow passing in an unsigned configuration to allocateSparcTargetMachine()
  a default value is set in the header file.
* Fixed some code layout to make it more consistent with the rest of codebase
* Added addPassesToJITCompile() with relevant passes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6369 91177308-0d34-0410-b5e6-96231b3b80d8

21 years ago* Now outputting a static function getBinaryCodeForInstr() (JIT-accessible)
Misha Brukman [Tue, 27 May 2003 22:19:58 +0000 (22:19 +0000)]
* Now outputting a static function getBinaryCodeForInstr() (JIT-accessible)
* For debugging purposes:
  + output the predefined bit pattern of the instruction
* Fixed inefficiency: only load an operand from MachineInstr once
* Bug fix: did not advance bit index when seeing named bit-fields "annul", "cc"
  and "predict"
* Added a catch-all for non-supported instructions at the end of switch stmt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6368 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoMoved generation of the SparcV9CodeEmitter.inc file higher in the Makefile so
Misha Brukman [Tue, 27 May 2003 22:04:38 +0000 (22:04 +0000)]
Moved generation of the SparcV9CodeEmitter.inc file higher in the Makefile so
that Makefile.common would see it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6367 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdd prototypes to add passes to JIT compilation and code emission.
Misha Brukman [Tue, 27 May 2003 22:01:10 +0000 (22:01 +0000)]
Add prototypes to add passes to JIT compilation and code emission.
Also, added annotations to how instructions are modified (reg/imm operands).
Added prototype for adding register numbers to values pass for interfacing with
the target-independent register allocators in the JIT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6366 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoDefines a pass-through debugging emitter -- it writes to a file for inspection
Misha Brukman [Tue, 27 May 2003 21:46:56 +0000 (21:46 +0000)]
Defines a pass-through debugging emitter -- it writes to a file for inspection
and to memory to test execution (using a passed-in code emitter).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6365 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAllow allocation of a Sparc TargetMachine.
Misha Brukman [Tue, 27 May 2003 21:46:07 +0000 (21:46 +0000)]
Allow allocation of a Sparc TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6364 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoBroke out class definition from SparcV9CodeEmitter, and added ability to take a
Misha Brukman [Tue, 27 May 2003 21:45:05 +0000 (21:45 +0000)]
Broke out class definition from SparcV9CodeEmitter, and added ability to take a
MachineCodeEmitter to make a pass-through debugger -- output to memory and to
std::cerr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6363 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoUpdate to match the reality that is now.
Chris Lattner [Tue, 27 May 2003 21:43:14 +0000 (21:43 +0000)]
Update to match the reality that is now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6362 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoLink in Sparc libs for the JIT, even on X86 to be able to support debugging
Misha Brukman [Tue, 27 May 2003 21:42:05 +0000 (21:42 +0000)]
Link in Sparc libs for the JIT, even on X86 to be able to support debugging
of Sparc JIT (printing out instrs) on X86. Con: this increases linking time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6361 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAllow for specification of which JIT to run on the commandline.
Misha Brukman [Tue, 27 May 2003 21:40:39 +0000 (21:40 +0000)]
Allow for specification of which JIT to run on the commandline.
`lli -march=x86' or `lli -march=sparc' will forcefully select the JIT even on a
different platform. Running lli without the -march option will select the JIT
for the platform that it's currently running on.

Pro: can test Sparc JIT (debug printing mode) on X86 -- faster to compile/link
LLVM source base to test changes.
Con: Linking lli on x86 now pulls in all the Sparc libs -> longer link time
(but X86 can bear it, right?)

In the future, perhaps this should be a ./configure option to enable/disable
target JITting...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6360 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoRemove ugly hack (that I put in originally) for building in trace stuff
Chris Lattner [Tue, 27 May 2003 21:23:02 +0000 (21:23 +0000)]
Remove ugly hack (that I put in originally) for building in trace stuff
automatically in LLC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6358 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoSparcV9CodeEmitter.cpp is a part of the Sparc code emitter. The main function
Misha Brukman [Tue, 27 May 2003 20:07:58 +0000 (20:07 +0000)]
SparcV9CodeEmitter.cpp is a part of the Sparc code emitter. The main function
that assembles instructions is generated via TableGen (and hence must be built
before building this directory, but that's already the case in the top-level
Makefile).

Also added is .cvsignore to ignore the generated file `SparcV9CodeEmitter.inc',
which is included by SparcV9CodeEmitter.cpp .

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6357 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded definitions for a bunch of floating-point instructions.
Misha Brukman [Tue, 27 May 2003 20:03:29 +0000 (20:03 +0000)]
Added definitions for a bunch of floating-point instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6356 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFix constant folding to ALWAYS work.
Chris Lattner [Tue, 27 May 2003 19:16:07 +0000 (19:16 +0000)]
Fix constant folding to ALWAYS work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6355 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdd compatibility option
Chris Lattner [Tue, 27 May 2003 19:15:11 +0000 (19:15 +0000)]
Add compatibility option

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6354 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoNew testcase
Chris Lattner [Tue, 27 May 2003 16:45:09 +0000 (16:45 +0000)]
New testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6353 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFix bug: Instcombine/2003-05-27-ConstExprCrash.ll
Chris Lattner [Tue, 27 May 2003 16:40:51 +0000 (16:40 +0000)]
Fix bug: Instcombine/2003-05-27-ConstExprCrash.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6352 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoMake _sure_ we don't go into an infinite loop if a signal happens!
Chris Lattner [Tue, 27 May 2003 16:25:04 +0000 (16:25 +0000)]
Make _sure_ we don't go into an infinite loop if a signal happens!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6351 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoStart testing SRoA
Chris Lattner [Tue, 27 May 2003 16:10:03 +0000 (16:10 +0000)]
Start testing SRoA

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6350 91177308-0d34-0410-b5e6-96231b3b80d8

21 years ago* Actually USE the statistic that we made
Chris Lattner [Tue, 27 May 2003 16:09:27 +0000 (16:09 +0000)]
* Actually USE the statistic that we made
* Implement SRoA for arrays

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6349 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoExpose proto for SRoA pass.
Chris Lattner [Tue, 27 May 2003 15:52:45 +0000 (15:52 +0000)]
Expose proto for SRoA pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6348 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoInitial testcases for scalar replacement of aggregates pass
Chris Lattner [Tue, 27 May 2003 15:51:17 +0000 (15:51 +0000)]
Initial testcases for scalar replacement of aggregates pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6347 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoImplementation of the simple "scalar replacement of aggregates" transformation
Chris Lattner [Tue, 27 May 2003 15:45:27 +0000 (15:45 +0000)]
Implementation of the simple "scalar replacement of aggregates" transformation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6346 91177308-0d34-0410-b5e6-96231b3b80d8

21 years ago(1) Added special register class containing (for now) %fsr.
Vikram S. Adve [Tue, 27 May 2003 00:07:13 +0000 (00:07 +0000)]
(1) Added special register class containing (for now) %fsr.
    Fixed spilling of %fcc[0-3] which are part of %fsr.

(2) Moved some machine-independent reg-class code to class TargetRegInfo
    from SparcReg{Class,}Info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6343 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoRenamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
Vikram S. Adve [Tue, 27 May 2003 00:06:48 +0000 (00:06 +0000)]
Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
and related functions and flags.  Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6342 91177308-0d34-0410-b5e6-96231b3b80d8

21 years ago(1) Added special register class containing (for now) %fsr.
Vikram S. Adve [Tue, 27 May 2003 00:05:23 +0000 (00:05 +0000)]
(1) Added special register class containing (for now) %fsr.
    Fixed spilling of %fcc[0-3] which are part of %fsr.

(2) Moved some machine-independent reg-class code to class TargetRegInfo
    from SparcReg{Class,}Info.

(3) Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
    and related functions and flags.  Fixed several bugs where only
    "isDef" was being checked, not "isDefAndUse".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6341 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoRenamed opIsDef to opIsDefOnly.
Vikram S. Adve [Tue, 27 May 2003 00:03:17 +0000 (00:03 +0000)]
Renamed opIsDef to opIsDefOnly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6340 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoAdded special register class containing (for now) %fsr.
Vikram S. Adve [Tue, 27 May 2003 00:02:22 +0000 (00:02 +0000)]
Added special register class containing (for now) %fsr.
Fixed spilling of %fcc[0-3] which are part of %fsr.
Moved some machine-independent reg-class code to class TargetRegInfo
from SparcReg{Class,}Info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6339 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoFix bug: InstCombine/2003-05-26-CastMiscompile.ll
Chris Lattner [Mon, 26 May 2003 23:41:32 +0000 (23:41 +0000)]
Fix bug: InstCombine/2003-05-26-CastMiscompile.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6338 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoNew testcase
Chris Lattner [Mon, 26 May 2003 23:41:13 +0000 (23:41 +0000)]
New testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6337 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoChanged http://tank... => http://llvm, and removed an extraneous mailto:.
Misha Brukman [Mon, 26 May 2003 00:17:49 +0000 (00:17 +0000)]
Changed tank... => http://llvm, and removed an extraneous mailto:.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6335 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoBug fix: right shift for int divide-by-power-of-2 was incorrect for
Vikram S. Adve [Sun, 25 May 2003 21:59:47 +0000 (21:59 +0000)]
Bug fix: right shift for int divide-by-power-of-2 was incorrect for
negative values.  Need to add one to a negative value before right shift!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6334 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoBug fix: padding bytes within a structure should go after each field!
Vikram S. Adve [Sun, 25 May 2003 21:59:09 +0000 (21:59 +0000)]
Bug fix: padding bytes within a structure should go after each field!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6333 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoBug fix: sign-extension was not happening for C = -MININT since C == -C!
Vikram S. Adve [Sun, 25 May 2003 21:58:11 +0000 (21:58 +0000)]
Bug fix: sign-extension was not happening for C = -MININT since C == -C!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6332 91177308-0d34-0410-b5e6-96231b3b80d8

21 years agoPredicate things better
Chris Lattner [Sun, 25 May 2003 16:52:41 +0000 (16:52 +0000)]
Predicate things better

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6331 91177308-0d34-0410-b5e6-96231b3b80d8