oota-llvm.git
20 years agoSpecify units in padding length.
Misha Brukman [Thu, 13 May 2004 16:37:52 +0000 (16:37 +0000)]
Specify units in padding length.

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

20 years agoMake page HTML-4.01 compliant (& => & in URL).
Misha Brukman [Thu, 13 May 2004 16:37:23 +0000 (16:37 +0000)]
Make page HTML-4.01 compliant (& => & in URL).

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

20 years agoTwo more improvements for null pointer handling: storing a null pointer
Chris Lattner [Thu, 13 May 2004 15:26:48 +0000 (15:26 +0000)]
Two more improvements for null pointer handling: storing a null pointer
and passing a null pointer into a function.

For this testcase:

void %test(int** %X) {
  store int* null, int** %X
  call void %test(int** null)
  ret void
}

we now generate this:

test:
        sub %ESP, 12
        mov %EAX, DWORD PTR [%ESP + 16]
        mov DWORD PTR [%EAX], 0
        mov DWORD PTR [%ESP], 0
        call test
        add %ESP, 12
        ret

instead of this:

test:
        sub %ESP, 12
        mov %EAX, DWORD PTR [%ESP + 16]
        mov %ECX, 0
        mov DWORD PTR [%EAX], %ECX
        mov %EAX, 0
        mov DWORD PTR [%ESP], %EAX
        call test
        add %ESP, 12
        ret

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

20 years agoSecond half of my fixed-sized-alloca patch. This folds the LEA to compute
Chris Lattner [Thu, 13 May 2004 15:12:43 +0000 (15:12 +0000)]
Second half of my fixed-sized-alloca patch.  This folds the LEA to compute
the alloca address into common operations like loads/stores.

In a simple testcase like this (which is just designed to excersize the
alloca A, nothing more):

int %test(int %X, bool %C) {
        %A = alloca int
        store int %X, int* %A
        store int* %A, int** %G
        br bool %C, label %T, label %F
T:
        call int %test(int 1, bool false)
        %V = load int* %A
        ret int %V
F:
        call int %test(int 123, bool true)
        %V2 = load int* %A
        ret int %V2
}

We now generate:

test:
        sub %ESP, 12
        mov %EAX, DWORD PTR [%ESP + 16]
        mov %CL, BYTE PTR [%ESP + 20]
***     mov DWORD PTR [%ESP + 8], %EAX
        mov %EAX, OFFSET G
        lea %EDX, DWORD PTR [%ESP + 8]
        mov DWORD PTR [%EAX], %EDX
        test %CL, %CL
        je .LBB2 # PC rel: F
.LBB1:  # T
        mov DWORD PTR [%ESP], 1
        mov DWORD PTR [%ESP + 4], 0
        call test
***     mov %EAX, DWORD PTR [%ESP + 8]
        add %ESP, 12
        ret
.LBB2:  # F
        mov DWORD PTR [%ESP], 123
        mov DWORD PTR [%ESP + 4], 1
        call test
***     mov %EAX, DWORD PTR [%ESP + 8]
        add %ESP, 12
        ret

Instead of:

test:
        sub %ESP, 20
        mov %EAX, DWORD PTR [%ESP + 24]
        mov %CL, BYTE PTR [%ESP + 28]
***     lea %EDX, DWORD PTR [%ESP + 16]
***     mov DWORD PTR [%EDX], %EAX
        mov %EAX, OFFSET G
        mov DWORD PTR [%EAX], %EDX
        test %CL, %CL
***     mov DWORD PTR [%ESP + 12], %EDX
        je .LBB2 # PC rel: F
.LBB1:  # T
        mov DWORD PTR [%ESP], 1
        mov %EAX, 0
        mov DWORD PTR [%ESP + 4], %EAX
        call test
***     mov %EAX, DWORD PTR [%ESP + 12]
***     mov %EAX, DWORD PTR [%EAX]
        add %ESP, 20
        ret
.LBB2:  # F
        mov DWORD PTR [%ESP], 123
        mov %EAX, 1
        mov DWORD PTR [%ESP + 4], %EAX
        call test
***     mov %EAX, DWORD PTR [%ESP + 12]
***     mov %EAX, DWORD PTR [%EAX]
        add %ESP, 20
        ret

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

20 years agoSubstantially improve code generation for address exposed locals (aka fixed
Chris Lattner [Thu, 13 May 2004 07:40:27 +0000 (07:40 +0000)]
Substantially improve code generation for address exposed locals (aka fixed
sized allocas in the entry block).  Instead of generating code like this:

entry:
  reg1024 = ESP+1234
... (much later)
  *reg1024 = 17

Generate code that looks like this:
entry:
  (no code generated)
... (much later)
  t = ESP+1234
  *t = 17

The advantage being that we DRAMATICALLY reduce the register pressure for these
silly temporaries (they were all being spilled to the stack, resulting in very
silly code).  This is actually a manual implementation of rematerialization :)

I have a patch to fold the alloca address computation into loads & stores, which
will make this much better still, but just getting this right took way too much time
and I'm sleepy.

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

20 years agoReduce line length to about 80 chars.
Reid Spencer [Thu, 13 May 2004 03:40:27 +0000 (03:40 +0000)]
Reduce line length to about 80 chars.

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

20 years agoInsert spacing between the table and the next section.
Misha Brukman [Thu, 13 May 2004 00:37:23 +0000 (00:37 +0000)]
Insert spacing between the table and the next section.

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

20 years ago* Use stylesheets for table borders so we factor out the formatting and can
Misha Brukman [Thu, 13 May 2004 00:24:43 +0000 (00:24 +0000)]
* Use stylesheets for table borders so we factor out the formatting and can
  adjust it much easier. Also changed border to gray to fit into the current
  color scheme.
* Convert < and > to &lt; and &gt;, respectively.
* Wrap long lines at 80 cols

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

20 years agoFix a comment.
Brian Gaeke [Wed, 12 May 2004 21:57:23 +0000 (21:57 +0000)]
Fix a comment.

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

20 years agoFix a really nasty bug from my changes on Monday to PHIElim. These changes
Chris Lattner [Wed, 12 May 2004 21:47:57 +0000 (21:47 +0000)]
Fix a really nasty bug from my changes on Monday to PHIElim.  These changes
broke obsequi and a lot of other things.  It all boiled down to MBB being
overloaded in an inner scope and me confusing it with the one in the outer
scope.  Ugh!

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

20 years agoBreak lines at 80 cols; eliminate extra space caused by a single <p> tag on a
Misha Brukman [Wed, 12 May 2004 21:46:05 +0000 (21:46 +0000)]
Break lines at 80 cols; eliminate extra space caused by a single <p> tag on a
line by itself.

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

20 years agoStart NextMBBNumber out at zero.
Brian Gaeke [Wed, 12 May 2004 21:35:23 +0000 (21:35 +0000)]
Start NextMBBNumber out at zero.

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

20 years agoAdd non-const MachineBasicBlock::getParent() accessor method.
Brian Gaeke [Wed, 12 May 2004 21:35:22 +0000 (21:35 +0000)]
Add non-const MachineBasicBlock::getParent() accessor method.

MBBs start out as #-1. When a MBB is added to a MachineFunction, it
gets the next available unique MBB number. If it is removed from a
MachineFunction, it goes back to being #-1.

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

20 years agoAdd a NextMBBNumber field w/ incrementing accessor method, for
Brian Gaeke [Wed, 12 May 2004 21:35:21 +0000 (21:35 +0000)]
Add a NextMBBNumber field w/ incrementing accessor method, for
function-level unique numbering of MBBs.

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

20 years agoAdd a Number field w/ accessor method, for function-level unique numbering
Brian Gaeke [Wed, 12 May 2004 21:35:20 +0000 (21:35 +0000)]
Add a Number field w/ accessor method, for function-level unique numbering
of MBBs.

Add non-const MachineBasicBlock::getParent() accessor method.

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

20 years agoMake the subsubsections stand out a bit more
Chris Lattner [Wed, 12 May 2004 21:28:08 +0000 (21:28 +0000)]
Make the subsubsections stand out a bit more

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

20 years agoThese images have been moved to img/
Misha Brukman [Wed, 12 May 2004 21:26:39 +0000 (21:26 +0000)]
These images have been moved to img/

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

20 years agoUse the images in the img/ directory.
Misha Brukman [Wed, 12 May 2004 21:26:16 +0000 (21:26 +0000)]
Use the images in the img/ directory.

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

20 years agoFinally, switch to a stylesheet that makes the documentation easier on the eyes
Misha Brukman [Wed, 12 May 2004 21:20:56 +0000 (21:20 +0000)]
Finally, switch to a stylesheet that makes the documentation easier on the eyes
and consistent with the LLVM website.

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

20 years agoCentralize images in this dir; add lines.gif from website for consistent
Misha Brukman [Wed, 12 May 2004 21:20:13 +0000 (21:20 +0000)]
Centralize images in this dir; add lines.gif from website for consistent
formatting.

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

20 years agoMake file use stylesheets and be HTML-4.01 (Strict)-compliant.
Misha Brukman [Wed, 12 May 2004 20:57:43 +0000 (20:57 +0000)]
Make file use stylesheets and be HTML-4.01 (Strict)-compliant.

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

20 years agoMade document HTML-4.01 (Strict)-compliant.
Misha Brukman [Wed, 12 May 2004 19:52:00 +0000 (19:52 +0000)]
Made document HTML-4.01 (Strict)-compliant.

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

20 years agoMake file standard-compliant once again.
Misha Brukman [Wed, 12 May 2004 19:25:59 +0000 (19:25 +0000)]
Make file standard-compliant once again.

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

20 years agoMade file comply with HTML-4.01 (Strict)
Misha Brukman [Wed, 12 May 2004 19:21:57 +0000 (19:21 +0000)]
Made file comply with HTML-4.01 (Strict)

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

20 years agoTurn the block extractor on by default now that it basically works, eliminating the...
Chris Lattner [Wed, 12 May 2004 19:02:44 +0000 (19:02 +0000)]
Turn the block extractor on by default now that it basically works, eliminating the option.

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

20 years agoMade file HTML-4.01 (Strict)-compliant.
Misha Brukman [Wed, 12 May 2004 18:57:54 +0000 (18:57 +0000)]
Made file HTML-4.01 (Strict)-compliant.

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

20 years agoMade to be HTML-4.01 (Strict)-compliant.
Misha Brukman [Wed, 12 May 2004 18:49:47 +0000 (18:49 +0000)]
Made to be HTML-4.01 (Strict)-compliant.

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

20 years agoMade to be HTML-4.01 (Strict) -compliant.
Misha Brukman [Wed, 12 May 2004 18:42:35 +0000 (18:42 +0000)]
Made to be HTML-4.01 (Strict) -compliant.

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

20 years agoAdd proper footer since this file is HTML-4.01 compliant.
Misha Brukman [Wed, 12 May 2004 18:37:22 +0000 (18:37 +0000)]
Add proper footer since this file is HTML-4.01 compliant.

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

20 years agoMake document HTML-4.01 (Strict) compliant.
Misha Brukman [Wed, 12 May 2004 18:31:21 +0000 (18:31 +0000)]
Make document HTML-4.01 (Strict) compliant.

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

20 years agoFix grammar: remove `the' before LLVM.
Misha Brukman [Wed, 12 May 2004 18:02:00 +0000 (18:02 +0000)]
Fix grammar: remove `the' before LLVM.

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

20 years ago* Make the document format follow the stringent purple standards (like the rest
Misha Brukman [Wed, 12 May 2004 18:00:48 +0000 (18:00 +0000)]
* Make the document format follow the stringent purple standards (like the rest
  of the documentation)
* Do not make the link text be the link itself, use some keywords
* Make doc use stylesheets and HTML markup for lists instead of definitions
* Shorten page by not making multiple lines per link with description + link of
  the same name as the target

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

20 years agoPass boolean constants into function calls more efficiently, generating:
Chris Lattner [Wed, 12 May 2004 16:35:04 +0000 (16:35 +0000)]
Pass boolean constants into function calls more efficiently, generating:

        mov DWORD PTR [%ESP + 4], 1

instead of:

        mov %EAX, 1
        mov DWORD PTR [%ESP + 4], %EAX

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

20 years agoDo not pass in the same argument to the extracted function more than once, and
Chris Lattner [Wed, 12 May 2004 16:26:18 +0000 (16:26 +0000)]
Do not pass in the same argument to the extracted function more than once, and
give the extracted function a more useful name than just foo_code.

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

20 years agoCheck to see if all blocks are extractible first.
Chris Lattner [Wed, 12 May 2004 16:08:01 +0000 (16:08 +0000)]
Check to see if all blocks are extractible first.

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

20 years agoImplement support for code extracting basic blocks that have a return
Chris Lattner [Wed, 12 May 2004 16:07:41 +0000 (16:07 +0000)]
Implement support for code extracting basic blocks that have a return
instruction in them.

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

20 years agoImplement splitting of PHI nodes, allowing block extraction of BB's that have
Chris Lattner [Wed, 12 May 2004 15:29:13 +0000 (15:29 +0000)]
Implement splitting of PHI nodes, allowing block extraction of BB's that have
PHI node entries from multiple outside-the-region blocks.  This also fixes
extraction of the entry block in a function.  Yaay.

This has successfully block extracted all (but one) block from the score_move
function in obsequi (out of 33).  Hrm, I wonder which block the bug is in.  :)

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

20 years ago* Pull some code out into the definedInRegion/definedInCaller methods
Chris Lattner [Wed, 12 May 2004 06:01:40 +0000 (06:01 +0000)]
* Pull some code out into the definedInRegion/definedInCaller methods
* Add a stub for the severSplitPHINodes which will allow us to bbextract
  bb's with PHI nodes in them soon.
* Remove unused arguments from findInputsOutputs
* Dramatically simplify the code in findInputsOutputs.  In particular,
  nothing really cares whether or not a PHI node is using something.
* Move moveCodeToFunction to after emitCallAndSwitchStatement as that's the
  order they get called.
* Fix a bug where we would code extract a region that included a call to
  vastart.  Like 'alloca', calls to vastart must stay in the function that
  they are defined in.
* Add some comments.

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

20 years agoGenerate substantially better code when there are a limited number of exits
Chris Lattner [Wed, 12 May 2004 04:14:24 +0000 (04:14 +0000)]
Generate substantially better code when there are a limited number of exits
from the extracted region.  If the return has 0 or 1 exit blocks, the new
function returns void.  If it has 2 exits, it returns bool, otherwise it
returns a ushort as before.

This allows us to use a conditional branch instruction when there are two
exit blocks, as often happens during block extraction.

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

20 years agoTwo minor improvements:
Chris Lattner [Wed, 12 May 2004 03:22:33 +0000 (03:22 +0000)]
Two minor improvements:
  1. Get rid of the silly abort block.  When doing bb extraction, we get one
     abort block for every block extracted, which is kinda annoying.
  2. If the switch ends up having a single destination, turn it into an
     unconditional branch.

I would like to add support for conditional branches, but to do this we will
want to have the function return a bool instead of a ushort.

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

20 years agoDon't leave dead bytecode.output files around if the optimizer/block extractor crashes.
Chris Lattner [Wed, 12 May 2004 02:55:45 +0000 (02:55 +0000)]
Don't leave dead bytecode.output files around if the optimizer/block extractor crashes.

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

20 years agoThis file has been superseded by docs/index.html .
Misha Brukman [Wed, 12 May 2004 02:48:30 +0000 (02:48 +0000)]
This file has been superseded by docs/index.html .

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

20 years agoImplement the final missing bits for block extractor support. Now bugpoint
Chris Lattner [Wed, 12 May 2004 02:43:24 +0000 (02:43 +0000)]
Implement the final missing bits for block extractor support.  Now bugpoint
can extract basic blocks up to the limit of the block extractor implementation.

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

20 years agoAdd link to Valgrind.
Misha Brukman [Wed, 12 May 2004 00:57:24 +0000 (00:57 +0000)]
Add link to Valgrind.

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

20 years agoImplement basic block extraction for the miscompilation debugger. This still needs
Chris Lattner [Tue, 11 May 2004 21:54:13 +0000 (21:54 +0000)]
Implement basic block extraction for the miscompilation debugger.  This still needs
two things: the FIXME in ExtractBlocks needs to be implemented, and the basic block
extractor itself needs to have enough bugs fixed for this to be more or less
useful.

Until the time that this is generally useful, it is hidden behind the new bugpoint
-enable-block-extraction option.  I hope to get the FIXME done tonight.

Also of note, this patch adds a -extract-bbs option to bugpoint which can be used
to debug the block extractor.  (hint hint Misha :)

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

20 years agoA class that is meant to be a base class should have a virtual destructor
Chris Lattner [Tue, 11 May 2004 20:41:07 +0000 (20:41 +0000)]
A class that is meant to be a base class should have a virtual destructor

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

20 years agoAdd a note to make sure the program is memory correct
Chris Lattner [Tue, 11 May 2004 19:34:27 +0000 (19:34 +0000)]
Add a note to make sure the program is memory correct

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

20 years agoAdded obsequi.
John Criswell [Tue, 11 May 2004 19:29:59 +0000 (19:29 +0000)]
Added obsequi.

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

20 years agoUse inttypes.h, which exists on all of Linux, Solaris and Darwin.
Brian Gaeke [Tue, 11 May 2004 16:14:53 +0000 (16:14 +0000)]
Use inttypes.h, which exists on all of Linux, Solaris and Darwin.

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

20 years agoUnbreak the build on X86.
Chris Lattner [Tue, 11 May 2004 14:08:54 +0000 (14:08 +0000)]
Unbreak the build on X86.

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

20 years agoSquash warnings on Solaris/sparc... the test suite is not working for me so I
Brian Gaeke [Tue, 11 May 2004 07:45:28 +0000 (07:45 +0000)]
Squash warnings on Solaris/sparc... the test suite is not working for me so I
can't be sure if these are OK, but they look OK.

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

20 years agoDo not hardcode the name of gcc, because its full pathname may have been
Brian Gaeke [Tue, 11 May 2004 07:42:58 +0000 (07:42 +0000)]
Do not hardcode the name of gcc, because its full pathname may have been
specified by top-level configure

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

20 years agoDo not depend on the path to bash
Brian Gaeke [Tue, 11 May 2004 07:42:19 +0000 (07:42 +0000)]
Do not depend on the path to bash

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

20 years agoInclude <sys/types.h> to get the definition of int64_t on Solaris.
Brian Gaeke [Tue, 11 May 2004 07:18:02 +0000 (07:18 +0000)]
Include <sys/types.h> to get the definition of int64_t on Solaris.

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

20 years agoSwitch this from using an std::map to using a DenseMap. This speeds up
Chris Lattner [Mon, 10 May 2004 19:17:36 +0000 (19:17 +0000)]
Switch this from using an std::map to using a DenseMap.  This speeds up
phi-elimination from 0.6 to 0.54s on kc++.

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

20 years agoUse a new VRegPHIUseCount to compute uses of PHI values by other phi values
Chris Lattner [Mon, 10 May 2004 19:06:37 +0000 (19:06 +0000)]
Use a new VRegPHIUseCount to compute uses of PHI values by other phi values
in the basic block being processed.  This fixes PhiElimination on kimwitu++
from taking 105s to taking a much more reasonable 0.6s (in a debug build).

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

20 years agoNow that we use an ilist of machine instructions, iterators are more robust
Chris Lattner [Mon, 10 May 2004 18:47:18 +0000 (18:47 +0000)]
Now that we use an ilist of machine instructions, iterators are more robust
than before.  Because this is the case, we can compute the first non-phi
instruction once when de-phi'ing a block.  This shaves ~4s off of
phielimination of _Z7yyparsev in kimwitu++ from 109s -> 105s.  There are
still much more important gains to come.

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

20 years agoFix a fairly serious pessimizaion that was preventing us from efficiently
Chris Lattner [Mon, 10 May 2004 15:15:55 +0000 (15:15 +0000)]
Fix a fairly serious pessimizaion that was preventing us from efficiently
compiling things like 'add long %X, 1'.  The problem is that we were switching
the order of the operands for longs even though we can't fold them yet.

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

20 years agoBug fixed
Chris Lattner [Mon, 10 May 2004 14:28:09 +0000 (14:28 +0000)]
Bug fixed

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

20 years agoPatch to fix PR337. Make sure to mark all aliased physical registers as used
Chris Lattner [Mon, 10 May 2004 05:12:43 +0000 (05:12 +0000)]
Patch to fix PR337.  Make sure to mark all aliased physical registers as used
when we see a read of a register.  This is important in cases like:

AL = ...
AH = ...

   = AX

The read of AX must make both the AL and AH defs live until the use.

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

20 years agoTestcase for PR337, which was reduced by Reid Spencer.
Chris Lattner [Mon, 10 May 2004 05:11:24 +0000 (05:11 +0000)]
Testcase for PR337, which was reduced by Reid Spencer.

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

20 years agoBug 178 Fixed
Reid Spencer [Sun, 9 May 2004 23:32:39 +0000 (23:32 +0000)]
Bug 178 Fixed

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

20 years agoChanges to make the Stacker Stack use 64 bit values. This *should* get
Reid Spencer [Sun, 9 May 2004 23:20:19 +0000 (23:20 +0000)]
Changes to make the Stacker Stack use 64 bit values. This *should* get
around the problem with Stacker on Solaris because the Stack can handle
64-bit entries (pointer sized).

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

20 years agoFix some comments, avoid sign extending booleans when zero extend works fine
Chris Lattner [Sun, 9 May 2004 23:16:33 +0000 (23:16 +0000)]
Fix some comments, avoid sign extending booleans when zero extend works fine

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

20 years agoGenerate more efficient code for casting booleans to integers (no sign extension...
Chris Lattner [Sun, 9 May 2004 22:28:45 +0000 (22:28 +0000)]
Generate more efficient code for casting booleans to integers (no sign extension required)

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

20 years agosyntactically loopify natural loops so that the GCC loop optimizer can find them...
Chris Lattner [Sun, 9 May 2004 20:41:32 +0000 (20:41 +0000)]
syntactically loopify natural loops so that the GCC loop optimizer can find them.  This should *dramatically* improve the performance of CBE compiled code on targets that depend on GCC's loop optimizations (like PPC)

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

20 years agoDo not emit prototypes for setjmp/longjmp, as they are handled specially
Chris Lattner [Sun, 9 May 2004 16:03:29 +0000 (16:03 +0000)]
Do not emit prototypes for setjmp/longjmp, as they are handled specially

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

20 years agoFine grainify namespacification
Chris Lattner [Sun, 9 May 2004 06:22:29 +0000 (06:22 +0000)]
Fine grainify namespacification

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

20 years agoMake the floating point constant pools local to each function, split the
Chris Lattner [Sun, 9 May 2004 06:20:51 +0000 (06:20 +0000)]
Make the floating point constant pools local to each function, split the
FindUsedTypes manipulation stuff out to be a seperate pass, and make the
main CWriter be a function pass now!

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

20 years agoBug fixed.
Brian Gaeke [Sun, 9 May 2004 05:28:35 +0000 (05:28 +0000)]
Bug fixed.
Rewrite portability intro.

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

20 years agoGet this looking more like a function pass.
Chris Lattner [Sun, 9 May 2004 04:30:20 +0000 (04:30 +0000)]
Get this looking more like a function pass.

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

20 years agoImplement the AddPrototypes method
Chris Lattner [Sun, 9 May 2004 04:29:57 +0000 (04:29 +0000)]
Implement the AddPrototypes method

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

20 years agoAdd support for inserting all prototypes up-front
Chris Lattner [Sun, 9 May 2004 04:29:49 +0000 (04:29 +0000)]
Add support for inserting all prototypes up-front

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

20 years agoPrint all PHI copies for successor blocks before the terminator, whether it be a...
Chris Lattner [Sun, 9 May 2004 03:42:48 +0000 (03:42 +0000)]
Print all PHI copies for successor blocks before the terminator, whether it be a conditional branch or switch.

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

20 years agoFix stupid bug in my checkin yesterday
Chris Lattner [Sat, 8 May 2004 22:41:42 +0000 (22:41 +0000)]
Fix stupid bug in my checkin yesterday

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

20 years agoFixed up sched graph.
Tanya Lattner [Sat, 8 May 2004 16:14:24 +0000 (16:14 +0000)]
Fixed up sched graph.

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

20 years agoRegistering the ModuloScheduling pass.
Tanya Lattner [Sat, 8 May 2004 16:14:02 +0000 (16:14 +0000)]
Registering the ModuloScheduling pass.

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

20 years agoChanged CPUResource to allow access to max num users for a resource.
Tanya Lattner [Sat, 8 May 2004 16:13:26 +0000 (16:13 +0000)]
Changed CPUResource to allow access to max num users for a resource.
Also added ModuloScheduling as a friend.

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

20 years agoChanged CPUResource to allow access to maxnum users.
Tanya Lattner [Sat, 8 May 2004 16:12:50 +0000 (16:12 +0000)]
Changed CPUResource to allow access to maxnum users.

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

20 years agoUpdating my versions of ModuloScheduling in cvs. Still not complete.
Tanya Lattner [Sat, 8 May 2004 16:12:10 +0000 (16:12 +0000)]
Updating my versions of ModuloScheduling in cvs. Still not complete.

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

20 years agoAdd support for widening integral casts.
Brian Gaeke [Sat, 8 May 2004 06:36:14 +0000 (06:36 +0000)]
Add support for widening integral casts.

Flesh out the SetCC support... which currently ends in a little bit
of unfinished code (which is probably completely hilarious) for
generating the condition value splitting the basic block up into 4
blocks, like this (clearly a better API is needed for this!):

       BB
   cond. branch
     /         /          R1=1    R2=0
     \      /
      \    /
    R=phi(R1,R2)

Other minor edits.

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

20 years agoAdd a bunch more branches
Brian Gaeke [Sat, 8 May 2004 06:08:29 +0000 (06:08 +0000)]
Add a bunch more branches

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

20 years agoFlesh out GEP support
Brian Gaeke [Sat, 8 May 2004 05:27:20 +0000 (05:27 +0000)]
Flesh out GEP support

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

20 years agoAdd ADD with immediate
Brian Gaeke [Sat, 8 May 2004 05:26:55 +0000 (05:26 +0000)]
Add ADD with immediate

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

20 years agoAdd forms of CMP, SUBCC, and a few branches, and some comments.
Brian Gaeke [Sat, 8 May 2004 04:21:32 +0000 (04:21 +0000)]
Add forms of CMP, SUBCC, and a few branches, and some comments.

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

20 years agoAdd stub support for GEPs.
Brian Gaeke [Sat, 8 May 2004 04:21:17 +0000 (04:21 +0000)]
Add stub support for GEPs.
Add support for branches (based loosely on X86/InstSelectSimple).
Add support for not visiting phi nodes in the first pass.
Add support for loading bools.
Flesh out support for stores.

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

20 years agoAdd required header
Alkis Evlogimenos [Sat, 8 May 2004 03:50:03 +0000 (03:50 +0000)]
Add required header

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

20 years agoRemove unneeded header
Alkis Evlogimenos [Sat, 8 May 2004 03:49:35 +0000 (03:49 +0000)]
Remove unneeded header

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

20 years agoImplement folding of GEP's like:
Chris Lattner [Fri, 7 May 2004 22:09:22 +0000 (22:09 +0000)]
Implement folding of GEP's like:

        %tmp.0 = getelementptr [50 x sbyte]* %ar, uint 0, int 5         ; <sbyte*> [#uses=2]
        %tmp.7 = getelementptr sbyte* %tmp.0, int 8             ; <sbyte*> [#uses=1]

together.  This patch actually allows us to simplify and generalize the code.

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

20 years agoAllow the user to set the LLVMINTERP environment variable as a workaround, for
Brian Gaeke [Fri, 7 May 2004 21:47:36 +0000 (21:47 +0000)]
Allow the user to set the LLVMINTERP environment variable as a workaround, for
when they have to run a gccld shell script without having lli in their path.
This is intended to address Bug 289.

Also, emit the traditional syntax ${1+"$@"} for passing all of a shell script's
args to a subprocess. If you have arguments that have spaces in them, $* will
not preserve the quoting (i.e., the quoted string "foo bar" as an argument will
end up as two arguments "foo" "bar" to lli.)

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

20 years agoAdd support for copying bool constants to registers.
Brian Gaeke [Fri, 7 May 2004 21:39:30 +0000 (21:39 +0000)]
Add support for copying bool constants to registers.
Disable the code that copies long constants to registers - it looks fishy.
Implement some simple casts: integral, smaller than longs, and equal-width
 or narrowing only.

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

20 years agoCodegen floating point stores of constants into integer instructions. This
Chris Lattner [Fri, 7 May 2004 21:18:15 +0000 (21:18 +0000)]
Codegen floating point stores of constants into integer instructions.  This
allows us to compile:

store float 10.0, float* %P

into:
        mov DWORD PTR [%EAX], 1092616192

instead of:

.CPItest_0:                                     # float 0x4024000000000000
.long   1092616192      # float 10
...
        fld DWORD PTR [.CPItest_0]
        fstp DWORD PTR [%EAX]

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

20 years agoAdd more casts. You can never have enough casts.
Brian Gaeke [Fri, 7 May 2004 21:10:28 +0000 (21:10 +0000)]
Add more casts.  You can never have enough casts.

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

20 years agoMake comparisons against the null pointer as efficient as integer comparisons
Chris Lattner [Fri, 7 May 2004 19:55:55 +0000 (19:55 +0000)]
Make comparisons against the null pointer as efficient as integer comparisons
against zero.  In particular, don't emit:

        mov %ESI, 0
        cmp %ECX, %ESI

instead, emit:

       test %ECX, %ECX

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

20 years agoPR implemented
Chris Lattner [Fri, 7 May 2004 19:23:05 +0000 (19:23 +0000)]
PR implemented

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

20 years agoBug fixed
Chris Lattner [Fri, 7 May 2004 18:40:38 +0000 (18:40 +0000)]
Bug fixed

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

20 years agoNew testcase
Chris Lattner [Fri, 7 May 2004 18:38:59 +0000 (18:38 +0000)]
New testcase

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

20 years agoNew testcase for PR336
Chris Lattner [Fri, 7 May 2004 15:38:50 +0000 (15:38 +0000)]
New testcase for PR336

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

20 years agoFix PR336: The instcombine pass asserts when visiting load instruction
Chris Lattner [Fri, 7 May 2004 15:35:56 +0000 (15:35 +0000)]
Fix PR336: The instcombine pass asserts when visiting load instruction

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

20 years agoRegression test for PR#330.
John Criswell [Fri, 7 May 2004 13:57:19 +0000 (13:57 +0000)]
Regression test for PR#330.

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