oota-llvm.git
20 years agoNew testcase for list slicing
Chris Lattner [Tue, 27 Jul 2004 01:00:56 +0000 (01:00 +0000)]
New testcase for list slicing

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

20 years agoAdd initial support for list slices. This currently allows you to do stuff
Chris Lattner [Mon, 26 Jul 2004 23:21:34 +0000 (23:21 +0000)]
Add initial support for list slices.  This currently allows you to do stuff
like this:

def B {
  list<int> X = [10, 20, 30, 4, 1, 1231, 20] [2-4,2,2,0-6];
}

... which isn't particularly useful, but more is to come.

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

20 years agoA utility to run an arbitrary program on each of the LLVM source files.
Reid Spencer [Mon, 26 Jul 2004 22:52:44 +0000 (22:52 +0000)]
A utility to run an arbitrary program on each of the LLVM source files.
This is like llvmgrep but instead of running grep, it runs the command
given by the first argument. For example, to find the top ten files with
the most lines in llvm, you could:

utils/llvmdo wc -l | sort -nb | tail

Or, to find any source files with the wrong permissions, you could:

utils/llvmdo ls -l | grep -v rw-r--r--

Hopefully, you get the idea.

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

20 years agoDo not store the stack pointer if the stack size is 0.
Misha Brukman [Mon, 26 Jul 2004 22:00:26 +0000 (22:00 +0000)]
Do not store the stack pointer if the stack size is 0.
Also, convert C-style comments to C++ and make sure code wraps at 80 cols.

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

20 years agoADDI can take several forms, including:
Misha Brukman [Mon, 26 Jul 2004 21:50:38 +0000 (21:50 +0000)]
ADDI can take several forms, including:

  addi r1, r2, 0
  addi r1, <frame index #n>, 0

so we must check for the second parameter being a register for this instruction
to be considered a reg-to-reg copy.

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

20 years agoassert() on MachineInstr properties instead of checking them dynamically
Misha Brukman [Mon, 26 Jul 2004 21:35:58 +0000 (21:35 +0000)]
assert() on MachineInstr properties instead of checking them dynamically

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

20 years ago* Recognize `addi r1, r2, 0' a move instruction
Misha Brukman [Mon, 26 Jul 2004 21:29:00 +0000 (21:29 +0000)]
* Recognize `addi r1, r2, 0' a move instruction
* List formats of instructions currently recognized as moves

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

20 years agoRemove dead section
Chris Lattner [Mon, 26 Jul 2004 21:16:55 +0000 (21:16 +0000)]
Remove dead section

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

20 years agoFix indentation: should be 2 spaces.
Misha Brukman [Mon, 26 Jul 2004 18:48:58 +0000 (18:48 +0000)]
Fix indentation: should be 2 spaces.

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

20 years agoFix file header as it has been renamed.
Misha Brukman [Mon, 26 Jul 2004 18:45:48 +0000 (18:45 +0000)]
Fix file header as it has been renamed.

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

20 years agoRenamed files to have the `X86' prefix for uniqueness purposes.
Misha Brukman [Mon, 26 Jul 2004 18:43:11 +0000 (18:43 +0000)]
Renamed files to have the `X86' prefix for uniqueness purposes.
All CVS history was renamed, the *,v were copied over.  No worries.

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

20 years ago* Rewrote casts
Misha Brukman [Mon, 26 Jul 2004 18:13:24 +0000 (18:13 +0000)]
* Rewrote casts
* Implemented GEP folding
* Dynamically output global address stuff once per function
* Fix casting fp<->short/byte

Patch contributed by Nate Begeman.

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

20 years agoIncrement the label number in runOnFunction() rather than while printing out
Misha Brukman [Mon, 26 Jul 2004 16:28:33 +0000 (16:28 +0000)]
Increment the label number in runOnFunction() rather than while printing out
some instruction.  Patch by Nate Begeman.

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

20 years agoMore notes on bugs, unimplemented features, and suggested code improvements.
Misha Brukman [Mon, 26 Jul 2004 16:23:55 +0000 (16:23 +0000)]
More notes on bugs, unimplemented features, and suggested code improvements.
Written by Nate Begeman.

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

20 years agoFix subtracting values > 2^15 in the prologue/epilogue, by Nate Begeman.
Misha Brukman [Mon, 26 Jul 2004 16:22:52 +0000 (16:22 +0000)]
Fix subtracting values > 2^15 in the prologue/epilogue, by Nate Begeman.

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

20 years agoAdded another test case for double FP constants as well.
Reid Spencer [Mon, 26 Jul 2004 15:04:13 +0000 (15:04 +0000)]
Added another test case for double FP constants as well.

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

20 years agoImplement DeadStoreElim/alloca.llx by observing that allocas are dead at the
Chris Lattner [Mon, 26 Jul 2004 06:14:11 +0000 (06:14 +0000)]
Implement DeadStoreElim/alloca.llx by observing that allocas are dead at the
end of the function (either return or unwind)

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

20 years agoNew testcase
Chris Lattner [Mon, 26 Jul 2004 06:11:42 +0000 (06:11 +0000)]
New testcase

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

20 years agoAdd some new methods
Chris Lattner [Mon, 26 Jul 2004 05:50:23 +0000 (05:50 +0000)]
Add some new methods

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

20 years agoNew methods
Chris Lattner [Mon, 26 Jul 2004 05:50:09 +0000 (05:50 +0000)]
New methods

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

20 years agoUpdate test
Chris Lattner [Mon, 26 Jul 2004 05:04:25 +0000 (05:04 +0000)]
Update test

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

20 years agoThrottle back indvar substitution from creating multiplies in loops. This is bad...
Chris Lattner [Mon, 26 Jul 2004 02:47:12 +0000 (02:47 +0000)]
Throttle back indvar substitution from creating multiplies in loops.  This is bad bad bad.

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

20 years agoFix bug in previous patch :(
Chris Lattner [Mon, 26 Jul 2004 01:40:20 +0000 (01:40 +0000)]
Fix bug in previous patch :(

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

20 years agoFix an extremely serious regression that was causing LLVM basic blocks to be
Chris Lattner [Mon, 26 Jul 2004 01:22:59 +0000 (01:22 +0000)]
Fix an extremely serious regression that was causing LLVM basic blocks to be
scrambled around almost at random, having really bad effects on icache locality.

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

20 years agoFix a serious bug in the double constant reader. In particular, because
Chris Lattner [Sun, 25 Jul 2004 23:15:44 +0000 (23:15 +0000)]
Fix a serious bug in the double constant reader.  In particular, because
(At[3] << 24) is an int type and it is being coerced to uint64_t, it was
getting sign extended, causing us to get FFFFFFFFxxxxxxxx constants all of
the time.

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

20 years agoTemporarily disable this code, as it is emitting LLVM_NAN("nan") which results in...
Chris Lattner [Sun, 25 Jul 2004 22:36:35 +0000 (22:36 +0000)]
Temporarily disable this code, as it is emitting LLVM_NAN("nan") which results in a call to the
glibc 'nan' function because the initializer is not a string.  This breaks when used in a global
initializer.  Try compiling this testcase for example:

%X = global float <some nan value>

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

20 years agoBugs fixed.
Reid Spencer [Sun, 25 Jul 2004 22:15:33 +0000 (22:15 +0000)]
Bugs fixed.

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

20 years agoAvoid use of size(), which counts, in favor of other mechanisms.
Reid Spencer [Sun, 25 Jul 2004 21:44:54 +0000 (21:44 +0000)]
Avoid use of size(), which counts, in favor of other mechanisms.

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

20 years agoAlways write FP values correctly.
Reid Spencer [Sun, 25 Jul 2004 21:36:26 +0000 (21:36 +0000)]
Always write FP values correctly.
Adjust for new Module.h interface for dependent libraries.
Excise unused backwards compatibility flag.

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

20 years agoDon't create a backwards compatibility flag for something that was a
Reid Spencer [Sun, 25 Jul 2004 21:32:51 +0000 (21:32 +0000)]
Don't create a backwards compatibility flag for something that was a
regression bug introduced in release 1.2

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

20 years agoAdjust to new Module.h interface for dependent libraries.
Reid Spencer [Sun, 25 Jul 2004 21:32:02 +0000 (21:32 +0000)]
Adjust to new Module.h interface for dependent libraries.

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

20 years agoAdjust to new Module.h interface for dependent libraries
Reid Spencer [Sun, 25 Jul 2004 21:30:51 +0000 (21:30 +0000)]
Adjust to new Module.h interface for dependent libraries
Remove mem leaks resulting from not freeing parse strings.

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

20 years agoAdjust to new Module.h interface for dependent libraries
Reid Spencer [Sun, 25 Jul 2004 21:29:43 +0000 (21:29 +0000)]
Adjust to new Module.h interface for dependent libraries
Only write the target triple and deplibs if they are non-empty.

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

20 years agoReduce the footprint of the dependent library interface
Reid Spencer [Sun, 25 Jul 2004 21:28:19 +0000 (21:28 +0000)]
Reduce the footprint of the dependent library interface
Document the dependent library interface
Constify the std::string& parameters in the dep lib interface.

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

20 years agoFix a latent bug in the AliasSetTracker that was exposed by the FreeInst additions...
Chris Lattner [Sun, 25 Jul 2004 18:32:01 +0000 (18:32 +0000)]
Fix a latent bug in the AliasSetTracker that was exposed by the FreeInst additions and broke a bunch of programs last night.

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

20 years agobug 263:
Reid Spencer [Sun, 25 Jul 2004 18:09:47 +0000 (18:09 +0000)]
bug 263:
Add target triple and dependent libraries support to this test.

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

20 years agobug 263:
Reid Spencer [Sun, 25 Jul 2004 18:08:57 +0000 (18:08 +0000)]
bug 263:
Ensure the list of libraries is cleared.

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

20 years agobug 263:
Reid Spencer [Sun, 25 Jul 2004 18:08:18 +0000 (18:08 +0000)]
bug 263:
Add ability to write target triple and dependent libraries information.

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

20 years agobug 263:
Reid Spencer [Sun, 25 Jul 2004 18:07:36 +0000 (18:07 +0000)]
bug 263:
- encode/decode target triple and dependent libraries
bug 401:
- fix encoding/decoding of FP values to be little-endian only
bug 402:
- initial (compatible) cut at 24-bit types instead of 32-bit
- reduce size of block headers by 50%
Other:
- cleanup Writer by consolidating to one compilation unit, rem. other files
- use a std::vector instead of std::deque so the buffer can be allocated
  in multiples of 64KByte chunks rather than in multiples of some smaller
  (default) number.

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

20 years agobug 263:
Reid Spencer [Sun, 25 Jul 2004 17:58:28 +0000 (17:58 +0000)]
bug 263:
Provide parsing for the target triple and dependent libraries.

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

20 years agobug 263:
Reid Spencer [Sun, 25 Jul 2004 17:56:00 +0000 (17:56 +0000)]
bug 263:
Provide new tokens for target triples and dependent libraries.

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

20 years agobug 263:
Reid Spencer [Sun, 25 Jul 2004 17:52:27 +0000 (17:52 +0000)]
bug 263:
The necessary changes to module in order to support both target triples and
a list of dependent libraries.

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

20 years agobug 402:
Reid Spencer [Sun, 25 Jul 2004 17:50:00 +0000 (17:50 +0000)]
bug 402:
A new set of block identifiers has been added for version 1.3 so that the
range of values can fit within 5 bits. This aids in halving the size of
block headers.

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

20 years agoCodify my thoughts on where we want to end up with the target-independent
Chris Lattner [Sun, 25 Jul 2004 12:13:35 +0000 (12:13 +0000)]
Codify my thoughts on where we want to end up with the target-independent
code generator.  Comments welcome.

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

20 years ago* Substantially simplify how free instructions are handled (potentially fixing
Chris Lattner [Sun, 25 Jul 2004 11:09:56 +0000 (11:09 +0000)]
* Substantially simplify how free instructions are handled (potentially fixing
  a bug in DSE).
* Delete dead operand uses iteratively instead of recursively, using a
  SetVector.
* Defer deletion of dead operand uses until the end of processing, which means
  we don't have to bother with updating the AliasSetTracker.  This speeds up
  DSE substantially.

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

20 years agoAdd back() and pop_back() methods to SetVector
Chris Lattner [Sun, 25 Jul 2004 11:07:02 +0000 (11:07 +0000)]
Add back() and pop_back() methods to SetVector
Move clear to the end of the class
Add assertions

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

20 years agoAdd some comments to the backtracking code.
Alkis Evlogimenos [Sun, 25 Jul 2004 08:10:33 +0000 (08:10 +0000)]
Add some comments to the backtracking code.

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

20 years agoFree instructions kill values too. This implements DeadStoreElim/free.llx
Chris Lattner [Sun, 25 Jul 2004 07:58:38 +0000 (07:58 +0000)]
Free instructions kill values too.  This implements DeadStoreElim/free.llx

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

20 years agoNew testcase for DSE
Chris Lattner [Sun, 25 Jul 2004 07:57:50 +0000 (07:57 +0000)]
New testcase for DSE

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

20 years agoAdd support for free instructions
Chris Lattner [Sun, 25 Jul 2004 07:57:37 +0000 (07:57 +0000)]
Add support for free instructions

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

20 years agoFix the sense of joinable
Chris Lattner [Sun, 25 Jul 2004 07:47:25 +0000 (07:47 +0000)]
Fix the sense of joinable

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

20 years agoRemove linux/solaris specific stuff.
Chris Lattner [Sun, 25 Jul 2004 07:34:00 +0000 (07:34 +0000)]
Remove linux/solaris specific stuff.

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

20 years agoThis patch makes use of the infrastructure implemented before to safely and
Chris Lattner [Sun, 25 Jul 2004 07:11:19 +0000 (07:11 +0000)]
This patch makes use of the infrastructure implemented before to safely and
aggressively coallesce live ranges even if they overlap.  Consider this LLVM
code for example:

int %test(int %X) {
        %Y = mul int %X, 1      ;; Codegens to Y = X
        %Z = add int %X, %Y
        ret int %Z
}

The mul is just there to get a copy into the code stream.  This produces
this machine code:

 (0x869e5a8, LLVM BB @0x869b9a0):
        %reg1024 = mov <fi#-2>, 1, %NOREG, 0    ;; "X"
        %reg1025 = mov %reg1024                 ;; "Y"  (subsumed by X)
        %reg1026 = add %reg1024, %reg1025
        %EAX = mov %reg1026
        ret

Note that the life times of reg1024 and reg1025 overlap, even though they
contain the same value.  This results in this machine code:

test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        add %EAX, %ECX
        ret

Another, worse case involves loops and PHI nodes.  Consider this trivial loop:
testcase:

int %test2(int %X) {
entry:
        br label %Loop
Loop:
        %Y = phi int [%X, %entry], [%Z, %Loop]
        %Z = add int %Y, 1
        %cond = seteq int %Z, 100
        br bool %cond, label %Out, label %Loop
Out:
        ret int %Z
}

Because of interactions between the PHI elimination pass and the register
allocator, this got compiled to this code:

test2:
        mov %ECX, DWORD PTR [%ESP + 4]
.LBBtest2_1:
***     mov %EAX, %ECX
        inc %EAX
        cmp %EAX, 100
***     mov %ECX, %EAX
        jne .LBBtest2_1

        ret

Or on powerpc, this code:

_test2:
        mflr r0
        stw r0, 8(r1)
        stwu r1, -60(r1)
.LBB_test2_1:
        addi r2, r3, 1
        cmpwi cr0, r2, 100
***     or r3, r2, r2
        bne cr0, .LBB_test2_1

***     or r3, r2, r2
        lwz r0, 68(r1)
        mtlr r0
        addi r1, r1, 60
        blr 0

With this improvement in place, we now generate this code for these two
testcases, which is what we want:

test:
        mov %EAX, DWORD PTR [%ESP + 4]
        add %EAX, %EAX
        ret

test2:
        mov %EAX, DWORD PTR [%ESP + 4]
.LBBtest2_1:
        inc %EAX
        cmp %EAX, 100
        jne .LBBtest2_1 # Loop
        ret

Or on PPC:

_test2:
        mflr r0
        stw r0, 8(r1)
        stwu r1, -60(r1)
.LBB_test2_1:
        addi r3, r3, 1
        cmpwi cr0, r3, 100
        bne cr0, .LBB_test2_1

        lwz r0, 68(r1)
        mtlr r0
        addi r1, r1, 60
        blr 0

Static numbers for spill code loads/stores/reg-reg copies (smaller is better):

em3d:       before: 47/25/26         after: 44/22/24
164.gzip:   before: 433/245/310      after: 403/231/278
175.vpr:    before: 3721/2189/1581   after: 4144/2081/1423
176.gcc:    before: 26195/8866/9235  after: 25942/8082/8275
186.crafty: before: 4295/2587/3079   after: 4119/2519/2916
252.eon:    before: 12754/7585/5803  after: 12508/7425/5643
256.bzip2:  before: 463/226/315      after: 482:241/309

Runtime perf number samples on X86:

gzip: before: 41.09 after: 39.86
bzip2: runtime: before: 56.71s after: 57.07s
gcc: before: 6.16 after: 6.12
eon: before: 2.03s after: 2.00s

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

20 years agoMake a method const, no functionality changes
Chris Lattner [Sun, 25 Jul 2004 06:23:01 +0000 (06:23 +0000)]
Make a method const, no functionality changes

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

20 years agoI think that V8 should coallesce registers, don't you?
Chris Lattner [Sun, 25 Jul 2004 06:19:04 +0000 (06:19 +0000)]
I think that V8 should coallesce registers, don't you?

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

20 years agoUse name.empty() instead of testing against equality with the empty
Alkis Evlogimenos [Sun, 25 Jul 2004 06:16:52 +0000 (06:16 +0000)]
Use name.empty() instead of testing against equality with the empty
string.

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

20 years agoDisallow creation of named values of type void.
Alkis Evlogimenos [Sun, 25 Jul 2004 06:07:15 +0000 (06:07 +0000)]
Disallow creation of named values of type void.

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

20 years agoFix a bug where we incorrectly value numbered the first PHI definition the
Chris Lattner [Sun, 25 Jul 2004 05:45:18 +0000 (05:45 +0000)]
Fix a bug where we incorrectly value numbered the first PHI definition the
same as the PHI use.  This is not correct as the PHI use value is different
depending on which branch is taken.  This fixes espresso with aggressive
coallescing, and perhaps others.

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

20 years agoFix a bug in the range remover
Chris Lattner [Sun, 25 Jul 2004 05:43:53 +0000 (05:43 +0000)]
Fix a bug in the range remover

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

20 years agoAdd debugging output for joining assignments
Chris Lattner [Sun, 25 Jul 2004 03:24:11 +0000 (03:24 +0000)]
Add debugging output for joining assignments

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

20 years agoRemove implementation of operator= and make it private so that it is
Alkis Evlogimenos [Sat, 24 Jul 2004 18:55:15 +0000 (18:55 +0000)]
Remove implementation of operator= and make it private so that it is
not used accidentally.

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

20 years agoChange std::map<unsigned, LiveInterval*> into a std::map<unsigned,
Alkis Evlogimenos [Sat, 24 Jul 2004 11:44:15 +0000 (11:44 +0000)]
Change std::map<unsigned, LiveInterval*> into a std::map<unsigned,
LiveInterval>. This saves some space and removes the pointer
indirection caused by following the pointer.

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

20 years agoFinally give bugpoint -timeout support!
Chris Lattner [Sat, 24 Jul 2004 07:53:26 +0000 (07:53 +0000)]
Finally give bugpoint -timeout support!

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

20 years agoobvious fix
Chris Lattner [Sat, 24 Jul 2004 07:51:27 +0000 (07:51 +0000)]
obvious fix

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

20 years agoGet rid of the printout from the low-level system interface
Chris Lattner [Sat, 24 Jul 2004 07:50:48 +0000 (07:50 +0000)]
Get rid of the printout from the low-level system interface

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

20 years agoPass timeouts into the low level "execute program with timeout" function
Chris Lattner [Sat, 24 Jul 2004 07:49:11 +0000 (07:49 +0000)]
Pass timeouts into the low level "execute program with timeout" function

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

20 years agoProvide timeout values to all abstract interpreters
Chris Lattner [Sat, 24 Jul 2004 07:48:50 +0000 (07:48 +0000)]
Provide timeout values to all abstract interpreters

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

20 years agoAdd support for killing the program if it executes for too long.
Chris Lattner [Sat, 24 Jul 2004 07:41:31 +0000 (07:41 +0000)]
Add support for killing the program if it executes for too long.

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

20 years agowhoops, didn't mean to remove this
Chris Lattner [Sat, 24 Jul 2004 04:32:22 +0000 (04:32 +0000)]
whoops, didn't mean to remove this

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

20 years agoIn the joiner, merge the small interval into the large interval. This restores
Chris Lattner [Sat, 24 Jul 2004 03:41:50 +0000 (03:41 +0000)]
In the joiner, merge the small interval into the large interval.  This restores
us back to taking about 10.5s on gcc, instead of taking 15.6s!  The net result
is that my big patches have hand no significant effect on compile time or code
quality.  heh.

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

20 years agoCompletely eliminate the intervals_ list. instead, the r2iMap_ maintains
Chris Lattner [Sat, 24 Jul 2004 03:32:06 +0000 (03:32 +0000)]
Completely eliminate the intervals_ list.  instead, the r2iMap_ maintains
ownership of the intervals.

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

20 years agoBig change to compute logical value numbers for each LiveRange added to an
Chris Lattner [Sat, 24 Jul 2004 02:59:07 +0000 (02:59 +0000)]
Big change to compute logical value numbers for each LiveRange added to an
Interval.  This generalizes the isDefinedOnce mechanism that we used before
to help us coallesce ranges that overlap.  As part of this, every logical
range with a different value is assigned a different number in the interval.
For example, for code that looks like this:

0  X = ...
4  X += ...
  ...
N    = X

We now generate a live interval that contains two ranges: [2,6:0),[6,?:1)
reflecting the fact that there are two different values in the range at
different positions in the code.

Currently we are not using this information at all, so this just slows down
liveintervals.  In the future, this will change.

Note that this change also substantially refactors the joinIntervalsInMachineBB
method to merge the cases for virt-virt and phys-virt joining into a single
case, adds comments, and makes the code a bit easier to follow.

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

20 years agoAdd a new differingRegisterClasses method
Chris Lattner [Sat, 24 Jul 2004 02:53:43 +0000 (02:53 +0000)]
Add a new differingRegisterClasses method
make overlapsAliases take pointers instead of references
fix indentation

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

20 years agoLittle stuff:
Chris Lattner [Sat, 24 Jul 2004 02:52:23 +0000 (02:52 +0000)]
Little stuff:

* Fix comment typeo
* add dump() methods
* add a few new methods like getLiveRangeContaining, removeRange & joinable
  (which is currently the same as overlaps)
* Remove the unused operator==

Bigger change:

* In LiveInterval, instead of using a boolean isDefinedOnce to keep track of
  if there are > 1 definitions in a particular interval, keep a counter,
  NumValues to keep track of exactly how many there are.
* In LiveRange, add a new ValId element to indicate which of the numbered
  values each LiveRange belongs to.   We now no longer merge LiveRanges if
  they are of differing value ID's even if they are neighbors.

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

20 years agoRunning list of bugs, unimplemented features, currently broken tests, until we
Misha Brukman [Fri, 23 Jul 2004 22:37:22 +0000 (22:37 +0000)]
Running list of bugs, unimplemented features, currently broken tests, until we
have a nightly tester set up for PowerPC.

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

20 years agoEliminate spurious empty space; make code easier to page through.
Misha Brukman [Fri, 23 Jul 2004 22:35:49 +0000 (22:35 +0000)]
Eliminate spurious empty space; make code easier to page through.

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

20 years agoSimplify boolean test.
Misha Brukman [Fri, 23 Jul 2004 21:43:26 +0000 (21:43 +0000)]
Simplify boolean test.

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

20 years agoMore minor changes:
Chris Lattner [Fri, 23 Jul 2004 21:24:19 +0000 (21:24 +0000)]
More minor changes:
 * Inline some functions
 * Eliminate some comparisons from the release build

This is good for another .3 on gcc.

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

20 years agoImplement casting a floating point to 32-bit unsigned value
Misha Brukman [Fri, 23 Jul 2004 20:32:59 +0000 (20:32 +0000)]
Implement casting a floating point to 32-bit unsigned value

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

20 years agobug fixed
Brian Gaeke [Fri, 23 Jul 2004 19:41:13 +0000 (19:41 +0000)]
bug fixed

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

20 years agoChange addRange and join to be a little bit smarter. In particular, we don't
Chris Lattner [Fri, 23 Jul 2004 19:38:44 +0000 (19:38 +0000)]
Change addRange and join to be a little bit smarter.  In particular, we don't
want to insert a new range into the middle of the vector, then delete ranges
one at a time next to the inserted one as they are merged.

Instead, if the inserted interval overlaps, just start merging.  The only time
we insert into the middle of the vector is when we don't overlap at all.  Also
delete blocks of live ranges if we overlap with many of them.

This patch speeds up joining by .7 seconds on a large testcase, but more
importantly gets all of the range adding code into addRangeFrom.

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

20 years agoFix problem with inserting FunctionPasses that depend on ImmutablePasses
Brian Gaeke [Fri, 23 Jul 2004 19:35:50 +0000 (19:35 +0000)]
Fix problem with inserting FunctionPasses that depend on ImmutablePasses
(e.g., LICM) into FunctionPassManagers. The problem is that we were
using a C-style cast to cast required analysis passes to PassClass*, but
if it's a FunctionPassManager, and the required analysis pass is an
ImmutablePass, the types aren't really compatible, so the C-style cast
causes a crash.

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

20 years agoSearch by the start point, not by the whole interval. This saves some
Chris Lattner [Fri, 23 Jul 2004 18:40:00 +0000 (18:40 +0000)]
Search by the start point, not by the whole interval.  This saves some
comparisons, reducing linscan by another .1 seconds :)

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

20 years agoNew helper method
Chris Lattner [Fri, 23 Jul 2004 18:39:12 +0000 (18:39 +0000)]
New helper method

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

20 years agoSpeedup debug builds a bit
Chris Lattner [Fri, 23 Jul 2004 18:38:52 +0000 (18:38 +0000)]
Speedup debug builds a bit

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

20 years agoInstead of searching for a live interval pair, search for a location. This gives
Chris Lattner [Fri, 23 Jul 2004 18:13:24 +0000 (18:13 +0000)]
Instead of searching for a live interval pair, search for a location.  This gives
a very modest speedup of .3 seconds compiling 176.gcc (out of 20s).

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

20 years agoRename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)
Chris Lattner [Fri, 23 Jul 2004 17:56:30 +0000 (17:56 +0000)]
Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)

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

20 years agoPull the LiveRange and LiveInterval classes out of LiveIntervals.h (which
Chris Lattner [Fri, 23 Jul 2004 17:49:16 +0000 (17:49 +0000)]
Pull the LiveRange and LiveInterval classes out of LiveIntervals.h (which
will soon be renamed) into their own file.  The new file should not emit
DEBUG output or have other side effects.  The LiveInterval class also now
doesn't know whether its working on registers or some other thing.

In the future we will want to use the LiveInterval class and friends to do
stack packing.  In addition to a code simplification, this will allow us to
do it more easily.

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

20 years ago* Codegen of GEPs dramatically improved by folding multiplies and adds
Misha Brukman [Fri, 23 Jul 2004 16:08:20 +0000 (16:08 +0000)]
* Codegen of GEPs dramatically improved by folding multiplies and adds
* Function pointers implemented correctly using appropriate stubs

Contributed by Nate Begeman.

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

20 years agoRevised the generation of files so that they follow the newer autoconf
John Criswell [Fri, 23 Jul 2004 15:40:57 +0000 (15:40 +0000)]
Revised the generation of files so that they follow the newer autoconf
standards.  This is in hopes of fixing configuration problems on
Windows Services for Unix.

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

20 years agoImprove comments a bit
Chris Lattner [Fri, 23 Jul 2004 08:24:23 +0000 (08:24 +0000)]
Improve comments a bit

Use an explicit LiveRange class to represent ranges instead of an std::pair.
This is a minor cleanup, but is really intended to make a future patch simpler
and less invasive.

Alkis, could you please take a look at LiveInterval::liveAt?  I suspect that
you can add an operator<(unsigned) to LiveRange, allowing us to speed up the
upper_bound call by quite a bit (this would also apply to other callers of
upper/lower_bound).  I would do it myself, but I still don't understand that
crazy liveAt function, despite the comment. :)

Basically I would like to see this:
    LiveRange dummy(index, index+1);
    Ranges::const_iterator r = std::upper_bound(ranges.begin(),
                                                ranges.end(),
                                                dummy);

Turn into:
    Ranges::const_iterator r = std::upper_bound(ranges.begin(),
                                                ranges.end(),
                                                index);

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

20 years agoChange column name
Chris Lattner [Fri, 23 Jul 2004 06:50:18 +0000 (06:50 +0000)]
Change column name

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

20 years agoUpdate live intervals more accurately for PHI elim. This slightly reduces
Chris Lattner [Fri, 23 Jul 2004 05:27:43 +0000 (05:27 +0000)]
Update live intervals more accurately for PHI elim.  This slightly reduces
the live intervals for some registers.

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

20 years agoForce coallescing of live ranges that have a single definition, even if they
Chris Lattner [Fri, 23 Jul 2004 05:26:05 +0000 (05:26 +0000)]
Force coallescing of live ranges that have a single definition, even if they
interfere.  Because these intervals have a single definition, and one of them
is a copy instruction, they are always safe to merge even if their lifetimes
interfere.  This slightly reduces the amount of spill code, for example on
252.eon, from:

 12837 spiller               - Number of loads added
  7604 spiller               - Number of stores added
  5842 spiller               - Number of register spills
 18155 liveintervals         - Number of identity moves eliminated after coalescing

to:

  12754 spiller               - Number of loads added
   7585 spiller               - Number of stores added
   5803 spiller               - Number of register spills
  18262 liveintervals         - Number of identity moves eliminated after coalescing

The much much bigger win would be to merge intervals with multiple definitions
(aka phi nodes) but this is not that day.

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

20 years ago* Convert "\n" -> '\n'
Misha Brukman [Fri, 23 Jul 2004 01:30:49 +0000 (01:30 +0000)]
* Convert "\n" -> '\n'
* Print out another '\n' after printing out program execution status
* Make sure code wraps at 80 cols

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

20 years agoBool alignment on MacOSX/PowerPC is 4 bytes.
Misha Brukman [Fri, 23 Jul 2004 01:11:46 +0000 (01:11 +0000)]
Bool alignment on MacOSX/PowerPC is 4 bytes.

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

20 years ago* Change class of BoolTy back to cInt
Misha Brukman [Fri, 23 Jul 2004 01:11:19 +0000 (01:11 +0000)]
* Change class of BoolTy back to cInt
* Fix indentation back to 2 spaces

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

20 years ago* Add BoolAlignment to TargetData, default is 1 byte, size 1 byte
Misha Brukman [Fri, 23 Jul 2004 01:09:52 +0000 (01:09 +0000)]
* Add BoolAlignment to TargetData, default is 1 byte, size 1 byte
* Convert tabs to spaces

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

20 years ago* Add a BoolAlignment field to TargetData, default is 1 byte
Misha Brukman [Fri, 23 Jul 2004 01:08:13 +0000 (01:08 +0000)]
* Add a BoolAlignment field to TargetData, default is 1 byte
* Fix spacing

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

20 years agocostmetic changes
Chris Lattner [Thu, 22 Jul 2004 23:05:12 +0000 (23:05 +0000)]
costmetic changes

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