oota-llvm.git
19 years agoComment cleanups
Chris Lattner [Thu, 7 Oct 2004 06:00:24 +0000 (06:00 +0000)]
Comment cleanups

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

19 years ago* Rename pass to globalopt, since we do more than just constify
Chris Lattner [Thu, 7 Oct 2004 04:16:33 +0000 (04:16 +0000)]
* Rename pass to globalopt, since we do more than just constify
* Instead of handling dead functions specially, just nuke them.
* Be more aggressive about cleaning up after constification, in
  particular, handle getelementptr instructions and constantexprs.
* Be a little bit more structured about how we process globals.

*** Delete globals that are only stored to, and never read.  These are
    clearly not useful, so they should go.  This implements deadglobal.llx

This last one triggers quite a few times.  In particular, 2208 in the
external tests, 1865 of which are in 252.eon.  This shrinks eon from
1995094 to 1732341 bytes of bytecode.

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

19 years agoRename pass
Chris Lattner [Thu, 7 Oct 2004 04:12:02 +0000 (04:12 +0000)]
Rename pass

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

19 years agoThis pass is not needed, as there is only ever one global: the stack
Chris Lattner [Thu, 7 Oct 2004 04:10:36 +0000 (04:10 +0000)]
This pass is not needed, as there is only ever one global: the stack

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

19 years agoAdd new testcase, rename pass
Chris Lattner [Thu, 7 Oct 2004 04:07:08 +0000 (04:07 +0000)]
Add new testcase, rename pass

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

19 years agoDon't add libz or libbz2 to the USEDLIBS lists, those are for LLVM libraries.
Chris Lattner [Thu, 7 Oct 2004 00:03:11 +0000 (00:03 +0000)]
Don't add libz or libbz2 to the USEDLIBS lists, those are for LLVM libraries.

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

19 years agoDon't call memset if malloc returns a null pointer
Chris Lattner [Wed, 6 Oct 2004 23:08:03 +0000 (23:08 +0000)]
Don't call memset if malloc returns a null pointer

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

19 years agoImplement GlobalConstifier/trivialstore.llx, and also do some
Chris Lattner [Wed, 6 Oct 2004 20:57:02 +0000 (20:57 +0000)]
Implement GlobalConstifier/trivialstore.llx, and also do some
simplifications of the resultant program to avoid making later passes
do it all.

This allows us to constify globals that just have the same constant that
they are initialized stored into them.

Suprisingly this comes up ALL of the freaking time, dozens of times in
SPEC, 30 times in vortex alone.

For example, on 256.bzip2, it allows us to constify these two globals:

%smallMode = internal global ubyte 0             ; <ubyte*> [#uses=8]
%verbosity = internal global int 0               ; <int*> [#uses=49]

Which (with later optimizations) results in the bytecode file shrinking
from 82286 to 69686 bytes!  Lets hear it for IPO :)

For the record, it's nuking lots of "if (verbosity > 2) { do lots of stuff }"
code.

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

19 years agoNew testcase
Chris Lattner [Wed, 6 Oct 2004 20:42:51 +0000 (20:42 +0000)]
New testcase

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

19 years agoDont' let null nodes sneak past cast instructions
Chris Lattner [Wed, 6 Oct 2004 19:29:13 +0000 (19:29 +0000)]
Dont' let null nodes sneak past cast instructions

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

19 years agoUndoxyfy internal method.
Misha Brukman [Wed, 6 Oct 2004 17:19:58 +0000 (17:19 +0000)]
Undoxyfy internal method.

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

19 years agoDoxygen-ify comments
Misha Brukman [Wed, 6 Oct 2004 16:56:16 +0000 (16:56 +0000)]
Doxygen-ify comments

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

19 years agoChange Type::isAbstract to have better comments, a more correct name
Chris Lattner [Wed, 6 Oct 2004 16:36:46 +0000 (16:36 +0000)]
Change Type::isAbstract to have better comments, a more correct name
(PromoteAbstractToConcrete), and to use a set to avoid recomputation.
In particular, this set eliminates the potentially exponential cases
from this little recursive algorithm.

On a particularly nasty testcase, llvm-dis on the .bc file went from 34
minutes (which is when I killed it, it still hadn't finished) to 0.57s.
Remember kids, exponential algorithms are bad.

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

19 years agoRename method, change comment, add argument
Chris Lattner [Wed, 6 Oct 2004 16:34:23 +0000 (16:34 +0000)]
Rename method, change comment, add argument

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

19 years agoCorrect some typeos
Chris Lattner [Wed, 6 Oct 2004 16:28:24 +0000 (16:28 +0000)]
Correct some typeos

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

19 years agoInstcombine: -(X sdiv C) -> (X sdiv -C), tested by sub.ll:test16
Chris Lattner [Wed, 6 Oct 2004 15:08:25 +0000 (15:08 +0000)]
Instcombine: -(X sdiv C)  -> (X sdiv -C), tested by sub.ll:test16

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

19 years agoNew testcase
Chris Lattner [Wed, 6 Oct 2004 15:07:56 +0000 (15:07 +0000)]
New testcase

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

19 years agoRemove debugging code, fix encoding problem. This fixes the problems
Chris Lattner [Wed, 6 Oct 2004 14:31:50 +0000 (14:31 +0000)]
Remove debugging code, fix encoding problem.  This fixes the problems
the JIT had last night.

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

19 years agoTurning on fsel code gen now that we can do so would be good.
Nate Begeman [Wed, 6 Oct 2004 11:03:30 +0000 (11:03 +0000)]
Turning on fsel code gen now that we can do so would be good.

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

19 years agoImplement floating point select for lt, gt, le, ge using the powerpc fsel
Nate Begeman [Wed, 6 Oct 2004 09:53:04 +0000 (09:53 +0000)]
Implement floating point select for lt, gt, le, ge using the powerpc fsel
instruction.

Now, rather than emitting the following loop out of bisect:
.LBB_main_19: ; no_exit.0.i
rlwinm r3, r2, 3, 0, 28
lfdx f1, r3, r27
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f2, lo16(.CPI_main_1-"L00000$pb")(r3)
fsub f2, f2, f1
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f4, lo16(.CPI_main_1-"L00000$pb")(r3)
fcmpu cr0, f1, f4
bge .LBB_main_64 ; no_exit.0.i
.LBB_main_63: ; no_exit.0.i
b .LBB_main_65 ; no_exit.0.i
.LBB_main_64: ; no_exit.0.i
fmr f2, f1
.LBB_main_65: ; no_exit.0.i
addi r3, r2, 1
rlwinm r3, r3, 3, 0, 28
lfdx f1, r3, r27
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f4, lo16(.CPI_main_1-"L00000$pb")(r3)
fsub f4, f4, f1
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f5, lo16(.CPI_main_1-"L00000$pb")(r3)
fcmpu cr0, f1, f5
bge .LBB_main_67 ; no_exit.0.i
.LBB_main_66: ; no_exit.0.i
b .LBB_main_68 ; no_exit.0.i
.LBB_main_67: ; no_exit.0.i
fmr f4, f1
.LBB_main_68: ; no_exit.0.i
fadd f1, f2, f4
addis r3, r30, ha16(.CPI_main_2-"L00000$pb")
lfd f2, lo16(.CPI_main_2-"L00000$pb")(r3)
fmul f1, f1, f2
rlwinm r3, r2, 3, 0, 28
lfdx f2, r3, r28
fadd f4, f2, f1
fcmpu cr0, f4, f0
bgt .LBB_main_70 ; no_exit.0.i
.LBB_main_69: ; no_exit.0.i
b .LBB_main_71 ; no_exit.0.i
.LBB_main_70: ; no_exit.0.i
fmr f0, f4
.LBB_main_71: ; no_exit.0.i
fsub f1, f2, f1
addi r2, r2, -1
fcmpu cr0, f1, f3
blt .LBB_main_73 ; no_exit.0.i
.LBB_main_72: ; no_exit.0.i
b .LBB_main_74 ; no_exit.0.i
.LBB_main_73: ; no_exit.0.i
fmr f3, f1
.LBB_main_74: ; no_exit.0.i
cmpwi cr0, r2, -1
fmr f16, f0
fmr f17, f3
bgt .LBB_main_19 ; no_exit.0.i

We emit this instead:
.LBB_main_19: ; no_exit.0.i
rlwinm r3, r2, 3, 0, 28
lfdx f1, r3, r27
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f2, lo16(.CPI_main_1-"L00000$pb")(r3)
fsub f2, f2, f1
fsel f1, f1, f1, f2
addi r3, r2, 1
rlwinm r3, r3, 3, 0, 28
lfdx f2, r3, r27
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f4, lo16(.CPI_main_1-"L00000$pb")(r3)
fsub f4, f4, f2
fsel f2, f2, f2, f4
fadd f1, f1, f2
addis r3, r30, ha16(.CPI_main_2-"L00000$pb")
lfd f2, lo16(.CPI_main_2-"L00000$pb")(r3)
fmul f1, f1, f2
rlwinm r3, r2, 3, 0, 28
lfdx f2, r3, r28
fadd f4, f2, f1
fsub f5, f0, f4
fsel f0, f5, f0, f4
fsub f1, f2, f1
addi r2, r2, -1
fsub f2, f1, f3
fsel f3, f2, f3, f1
cmpwi cr0, r2, -1
fmr f16, f0
fmr f17, f3
bgt .LBB_main_19 ; no_exit.0.i

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

19 years agoCodegen signed mod by 2 or -2 more efficiently. Instead of generating:
Chris Lattner [Wed, 6 Oct 2004 05:01:07 +0000 (05:01 +0000)]
Codegen signed mod by 2 or -2 more efficiently.  Instead of generating:

t:
        mov %EDX, DWORD PTR [%ESP + 4]
        mov %ECX, 2
        mov %EAX, %EDX
        sar %EDX, 31
        idiv %ECX
        mov %EAX, %EDX
        ret

Generate:
t:
        mov %ECX, DWORD PTR [%ESP + 4]
***     mov %EAX, %ECX
        cdq
        and %ECX, 1
        xor %ECX, %EDX
        sub %ECX, %EDX
***     mov %EAX, %ECX
        ret

Note that the two marked moves are redundant, and should be eliminated by the
register allocator, but aren't.

Compare this to GCC, which generates:

t:
        mov     %eax, DWORD PTR [%esp+4]
        mov     %edx, %eax
        shr     %edx, 31
        lea     %ecx, [%edx+%eax]
        and     %ecx, -2
        sub     %eax, %ecx
        ret

or ICC 8.0, which generates:

t:
        movl      4(%esp), %ecx                                 #3.5
        movl      $-2147483647, %eax                            #3.25
        imull     %ecx                                          #3.25
        movl      %ecx, %eax                                    #3.25
        sarl      $31, %eax                                     #3.25
        addl      %ecx, %edx                                    #3.25
        subl      %edx, %eax                                    #3.25
        addl      %eax, %eax                                    #3.25
        negl      %eax                                          #3.25
        subl      %eax, %ecx                                    #3.25
        movl      %ecx, %eax                                    #3.25
        ret                                                     #3.25

We would be in great shape if not for the moves.

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

19 years agoReally fix FreeBSD, which apparently doesn't tolerate the extern.
Chris Lattner [Wed, 6 Oct 2004 04:21:52 +0000 (04:21 +0000)]
Really fix FreeBSD, which apparently doesn't tolerate the extern.
Thanks to Jeff Cohen for pointing out my goof.

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

19 years agoFix a scary bug with signed division by a power of two. We used to generate:
Chris Lattner [Wed, 6 Oct 2004 04:19:43 +0000 (04:19 +0000)]
Fix a scary bug with signed division by a power of two.  We used to generate:

s:   ;; X / 4
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        sar %ECX, 1
        shr %ECX, 30
        mov %EDX, %EAX
        add %EDX, %ECX
        sar %EAX, 2
        ret

When we really meant:

s:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        sar %ECX, 1
        shr %ECX, 30
        add %EAX, %ECX
        sar %EAX, 2
        ret

Hey, this also reduces register pressure too :)

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

19 years agoCodegen signed divides by 2 and -2 more efficiently. In particular
Chris Lattner [Wed, 6 Oct 2004 04:02:39 +0000 (04:02 +0000)]
Codegen signed divides by 2 and -2 more efficiently.  In particular
instead of:

s:   ;; X / 2
        movl 4(%esp), %eax
        movl %eax, %ecx
        shrl $31, %ecx
        movl %eax, %edx
        addl %ecx, %edx
        sarl $1, %eax
        ret

t:   ;; X / -2
        movl 4(%esp), %eax
        movl %eax, %ecx
        shrl $31, %ecx
        movl %eax, %edx
        addl %ecx, %edx
        sarl $1, %eax
        negl %eax
        ret

Emit:

s:
        movl 4(%esp), %eax
        cmpl $-2147483648, %eax
        sbbl $-1, %eax
        sarl $1, %eax
        ret

t:
        movl 4(%esp), %eax
        cmpl $-2147483648, %eax
        sbbl $-1, %eax
        sarl $1, %eax
        negl %eax
        ret

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

19 years agoAdd some new instructions. Fix the asm string for sbb32rr
Chris Lattner [Wed, 6 Oct 2004 04:01:02 +0000 (04:01 +0000)]
Add some new instructions.  Fix the asm string for sbb32rr

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

19 years agoReduce code growth implied by the tail duplication pass by not duplicating
Chris Lattner [Wed, 6 Oct 2004 03:27:37 +0000 (03:27 +0000)]
Reduce code growth implied by the tail duplication pass by not duplicating
an instruction if it can be hoisted to a common dominator of the block.
This implements: test/Regression/Transforms/TailDup/MergeTest.ll

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

19 years agoWhen tail duplicating these functions, the add instruction should not be
Chris Lattner [Wed, 6 Oct 2004 03:26:38 +0000 (03:26 +0000)]
When tail duplicating these functions, the add instruction should not be
duplicated, even though the block it is in is duplicated.

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

19 years agoFreeBSD uses GCC. Patch contributed by Jeff Cohen!
Chris Lattner [Wed, 6 Oct 2004 03:15:44 +0000 (03:15 +0000)]
FreeBSD uses GCC.  Patch contributed by Jeff Cohen!

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

19 years agoFix the path to the fixinc'd headers. Patch contributed by Jeff Cohen!
Chris Lattner [Wed, 6 Oct 2004 03:13:47 +0000 (03:13 +0000)]
Fix the path to the fixinc'd headers.  Patch contributed by Jeff Cohen!

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

19 years agoMust include sys/stat.h before declaring a 'struct stat'
Brian Gaeke [Tue, 5 Oct 2004 18:46:59 +0000 (18:46 +0000)]
Must include sys/stat.h before declaring a 'struct stat'

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

19 years agoBuild BFtoLLVM example front-end by default
Brian Gaeke [Tue, 5 Oct 2004 18:05:53 +0000 (18:05 +0000)]
Build BFtoLLVM example front-end by default

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

19 years agoAdd BFtoLLVM example front end
Brian Gaeke [Tue, 5 Oct 2004 18:05:25 +0000 (18:05 +0000)]
Add BFtoLLVM example front end

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

19 years agoMake sure the const bit gets inherited correctly when linking declarations
Chris Lattner [Tue, 5 Oct 2004 02:28:11 +0000 (02:28 +0000)]
Make sure the const bit gets inherited correctly when linking declarations
of disagreeing constness.  This fixes
test/Regression/Linker/ConstantGlobals[123].ll

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

19 years agoAnother testcase for constness linkage
Chris Lattner [Tue, 5 Oct 2004 02:16:01 +0000 (02:16 +0000)]
Another testcase for constness linkage

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

19 years agoTestcase to ensure that the 'constant' flag follows the definition when there
Chris Lattner [Tue, 5 Oct 2004 02:12:20 +0000 (02:12 +0000)]
Testcase to ensure that the 'constant' flag follows the definition when there
is a question.

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

19 years agoAdjust sys/stat.h inclusion so its only for SunOS.
Reid Spencer [Tue, 5 Oct 2004 00:56:46 +0000 (00:56 +0000)]
Adjust sys/stat.h inclusion so its only for SunOS.

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

19 years agoAdded a couple of includes to get this to compile on Sparc.
Tanya Lattner [Tue, 5 Oct 2004 00:51:26 +0000 (00:51 +0000)]
Added a couple of includes to get this to compile on Sparc.

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

19 years agoSolaris doesn't have MAP_FILE.
Chris Lattner [Tue, 5 Oct 2004 00:46:21 +0000 (00:46 +0000)]
Solaris doesn't have MAP_FILE.

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

19 years agoBug fixed
Chris Lattner [Tue, 5 Oct 2004 00:23:02 +0000 (00:23 +0000)]
Bug fixed

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

19 years agoNew testcase for PR450
Chris Lattner [Tue, 5 Oct 2004 00:18:21 +0000 (00:18 +0000)]
New testcase for PR450

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

19 years agoAdd checks for the ZLIB and BZIP2 header files, not just the libraries.
Reid Spencer [Mon, 4 Oct 2004 22:05:53 +0000 (22:05 +0000)]
Add checks for the ZLIB and BZIP2 header files, not just the libraries.

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

19 years agoFix #include flavor
Chris Lattner [Mon, 4 Oct 2004 18:10:18 +0000 (18:10 +0000)]
Fix #include flavor

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

19 years agoMove the warning about no compression library down to the bottom, away
Reid Spencer [Mon, 4 Oct 2004 18:02:55 +0000 (18:02 +0000)]
Move the warning about no compression library down to the bottom, away
from the fray, so it gets noticed. This commit is made without the
corresponding configure script commit because it doesn't affect
functionality and we don't want to force everyone into another reconfigure

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

19 years agoFix typo in makefile variable name that prevents zlib from being recognized
Reid Spencer [Mon, 4 Oct 2004 17:49:19 +0000 (17:49 +0000)]
Fix typo in makefile variable name that prevents zlib from being recognized

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

19 years agoAdd HAVE_BZIP2 and HAVE_ZLIB
Reid Spencer [Mon, 4 Oct 2004 17:48:37 +0000 (17:48 +0000)]
Add HAVE_BZIP2 and HAVE_ZLIB

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

19 years agoExcise the ill-advised RLCOMP compression algorithm and simply leave the
Reid Spencer [Mon, 4 Oct 2004 17:45:44 +0000 (17:45 +0000)]
Excise the ill-advised RLCOMP compression algorithm and simply leave the
previously temporary NULLCOMP implementation that merely copies the data
verbatim without compression. Also, don't warn if there's no compression
library as that is taken care of during configuration time.

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

19 years agoAdd example 'abstract' architectures for LLI: MIX, MMIX, and DLX
Misha Brukman [Mon, 4 Oct 2004 17:36:35 +0000 (17:36 +0000)]
Add example 'abstract' architectures for LLI: MIX, MMIX, and DLX

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

19 years agoAdd a context for the callback so different compression scenarios can be
Reid Spencer [Mon, 4 Oct 2004 17:29:25 +0000 (17:29 +0000)]
Add a context for the callback so different compression scenarios can be
distinguished. Tidy up documentation.  Thanks, Chris.

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

19 years agoMinor corrections suggested by Chris' ever-watchful eye.
Reid Spencer [Mon, 4 Oct 2004 17:26:26 +0000 (17:26 +0000)]
Minor corrections suggested by Chris' ever-watchful eye.

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

19 years agoFix build if not HAVE_BZIP2
Chris Lattner [Mon, 4 Oct 2004 16:33:25 +0000 (16:33 +0000)]
Fix build if not HAVE_BZIP2

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

19 years agoFirst version of the MappedFile abstraction for operating system idependent
Reid Spencer [Mon, 4 Oct 2004 11:08:32 +0000 (11:08 +0000)]
First version of the MappedFile abstraction for operating system idependent
mapping of files. This first version uses mmap where its available. The
class needs to implement an alternate mechanism based on malloc'd memory
and file reading/writing for platforms without virtual memory.

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

19 years agoFirst version of a support utility to provide generalized compression in
Reid Spencer [Mon, 4 Oct 2004 10:49:41 +0000 (10:49 +0000)]
First version of a support utility to provide generalized compression in
LLVM that handles availability and unavailability of bzip2 and zlib.

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

19 years ago* Prune #includes
Chris Lattner [Mon, 4 Oct 2004 07:31:08 +0000 (07:31 +0000)]
* Prune #includes
* Update comments
* Rearrange code a bit
* Finally ELIMINATE the GAS workaround emitter for Intel mode.  woot!

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

19 years agoAdd support for emitting AT&T style .s files, and make it the default. Users
Chris Lattner [Mon, 4 Oct 2004 07:24:48 +0000 (07:24 +0000)]
Add support for emitting AT&T style .s files, and make it the default.  Users
may now choose their output format with the -x86-asm-syntax={intel|att} flag.

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

19 years agoConvert some missed patterns to support AT&T style
Chris Lattner [Mon, 4 Oct 2004 07:23:07 +0000 (07:23 +0000)]
Convert some missed patterns to support AT&T style

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

19 years agoApparently the GNU assembler has a HUGE hack to be compatible with really
Chris Lattner [Mon, 4 Oct 2004 07:08:46 +0000 (07:08 +0000)]
Apparently the GNU assembler has a HUGE hack to be compatible with really
old and broken AT&T syntax assemblers.  The problem with this hack is that
*SOME* forms of the fdiv and fsub instructions have the 'r' bit inverted.
This was a real pain to figure out, but is trivially easy to support: thus
we are now bug compatible with gas and gcc.

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

19 years agoProvide support for auto-detection and use of compression libraries.
Reid Spencer [Mon, 4 Oct 2004 07:05:07 +0000 (07:05 +0000)]
Provide support for auto-detection and use of compression libraries.

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

19 years agoFix incorrect suffix
Chris Lattner [Mon, 4 Oct 2004 05:20:16 +0000 (05:20 +0000)]
Fix incorrect suffix

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

19 years agoFix some more missed suffixes and swapped operands
Chris Lattner [Mon, 4 Oct 2004 01:38:10 +0000 (01:38 +0000)]
Fix some more missed suffixes and swapped operands

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

19 years agoAdd missing suffixes to FP instructions for AT&T mode
Chris Lattner [Mon, 4 Oct 2004 00:43:31 +0000 (00:43 +0000)]
Add missing suffixes to FP instructions for AT&T mode

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

19 years agoAdd support for the -x86-asm-syntax flag, which can be used to choose between
Chris Lattner [Sun, 3 Oct 2004 20:36:57 +0000 (20:36 +0000)]
Add support for the -x86-asm-syntax flag, which can be used to choose between
Intel and AT&T style assembly language.  The ultimate goal of this is to
eliminate the GasBugWorkaroundEmitter class, but for now AT&T style emission
is not fully operational.

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

19 years agoAdd support to the instruction patterns for AT&T style output, which will
Chris Lattner [Sun, 3 Oct 2004 20:35:00 +0000 (20:35 +0000)]
Add support to the instruction patterns for AT&T style output, which will
hopefully lead to the death of the 'GasBugWorkaroundEmitter'.  This also
includes changes to wrap the whole file to 80 columns! Woot! :)

Note that the AT&T style output has not been tested at all.

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

19 years agoCorrectly parse variant notation
Chris Lattner [Sun, 3 Oct 2004 20:19:02 +0000 (20:19 +0000)]
Correctly parse variant notation

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

19 years agoAdd initial support for variants. This just parses the new format, no
Chris Lattner [Sun, 3 Oct 2004 19:34:31 +0000 (19:34 +0000)]
Add initial support for variants.  This just parses the new format, no
functionality is added

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

19 years agoAdd initial support for variants
Chris Lattner [Sun, 3 Oct 2004 19:34:18 +0000 (19:34 +0000)]
Add initial support for variants

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

19 years agoAdd checks for bzip2 and libz for use with the Compression concept for
Reid Spencer [Sat, 2 Oct 2004 08:50:58 +0000 (08:50 +0000)]
Add checks for bzip2 and libz for use with the Compression concept for
lib/System and the compressing llvm archiver.

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

19 years agoDo not repeat the map lookup
Chris Lattner [Fri, 1 Oct 2004 23:16:43 +0000 (23:16 +0000)]
Do not repeat the map lookup

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

19 years agoWhen a virtual register is folded into an instruction, keep track of whether
Chris Lattner [Fri, 1 Oct 2004 23:15:36 +0000 (23:15 +0000)]
When a virtual register is folded into an instruction, keep track of whether
it was a use, def, or both.  This allows us to be less pessimistic in our
analysis of them.  In practice, this doesn't make a big difference, but it
doesn't hurt either.

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

19 years agoAdd project
Chris Lattner [Fri, 1 Oct 2004 22:25:28 +0000 (22:25 +0000)]
Add project

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

19 years agoAdd a simple little improvement to the local spiller to keep track of stores
Chris Lattner [Fri, 1 Oct 2004 19:47:12 +0000 (19:47 +0000)]
Add a simple little improvement to the local spiller to keep track of stores
and delete them if they turn out to be dead.  This is a useful little hack
that even speeds up some programs.  For example, it speeds up Ptrdist/ks
from 17.53s to 15.59s, and 188.ammp from 149s to 146s.

This also speeds up llc :)

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

19 years agoSubstantially revamp the local spiller, causing it to actually improve the
Chris Lattner [Fri, 1 Oct 2004 19:04:51 +0000 (19:04 +0000)]
Substantially revamp the local spiller, causing it to actually improve the
generated code over the simple spiller.  The new local spiller generates
substantially better code than the simple one in some cases, by reusing
values that are loaded out of stack slots and kept available in registers.

This primarily helps programs that are spilling a lot, and there is still
stuff that can be done to improve it.  This patch makes the local spiller
the default, as it's only a tiny bit slower than the simple spiller (it
increases the runtime of llc by < 1%).

Here are some numbers with speedups.

Program    #reuse  old(s)    new(s)  Speedup

Povray:     3452,  16.87 ->  15.93   (5.5%)
177.mesa:   2176,   2.77 ->   2.76   (0%)
179.art:      35,  28.43 ->  28.01   (1.5%)
183.equake:   55,  61.44 ->  61.41   (0%)
188.ammp:    869, 174    -> 149      (15%)

164.gzip:     43,  40.73 ->  40.71   (0%)
175.vpr:     351,  18.54 ->  17.34   (6.5%)
176.gcc:    2471,   5.01 ->   4.92   (1.8%)
181.mcf       42,  79.30 ->  75.20   (5.2%)
186.crafty:  484,  29.73 ->  30.04   (-1%)
197.parser:  251,  10.47 ->  10.67   (-1%)
252.eon:    1501,   1.98 ->   1.75   (12%)
253.perlbm: 1183,  14.83 ->  14.42   (2.8%)
254.gap:     825,   7.46 ->   7.29   (2.3%)
255.vortex:  285,  10.51 ->  10.27   (2.3%)
256.bzip2:    63,  55.70 ->  55.20   (0.9%)
300.twolf:   830,  21.63 ->  22.00   (-1%)

PtrDist/ks    14,  32.75 -> 17.53    (46.5%)
Olden/tsp     46,   8.71 ->  8.24    (5.4%)
Free/distray  70,   1.09 ->  0.99    (9.2%)

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

19 years agoPretty print a bit nicer :)
Chris Lattner [Fri, 1 Oct 2004 19:01:39 +0000 (19:01 +0000)]
Pretty print a bit nicer :)

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

19 years agoAdd note about converting Skeleton to a useful backend and using it in the
Misha Brukman [Fri, 1 Oct 2004 18:36:22 +0000 (18:36 +0000)]
Add note about converting Skeleton to a useful backend and using it in the
Interpreter.

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

19 years agoDocument this class a bit :-)
Alkis Evlogimenos [Fri, 1 Oct 2004 00:35:07 +0000 (00:35 +0000)]
Document this class a bit :-)

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

19 years agoAdd const version of getLastBlock() member function.
Alkis Evlogimenos [Thu, 30 Sep 2004 21:42:02 +0000 (21:42 +0000)]
Add const version of getLastBlock() member function.

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

19 years agoRemove whitespace from the end of the line.
Alkis Evlogimenos [Thu, 30 Sep 2004 21:39:47 +0000 (21:39 +0000)]
Remove whitespace from the end of the line.

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

19 years agoMake EmitMappingInfo into an "external location" option, so that it can be set
Brian Gaeke [Thu, 30 Sep 2004 20:20:01 +0000 (20:20 +0000)]
Make EmitMappingInfo into an "external location" option, so that it can be set
or cleared externally.

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

19 years agoAdd accessor function.
Brian Gaeke [Thu, 30 Sep 2004 20:14:29 +0000 (20:14 +0000)]
Add accessor function.

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

19 years agoCorrect type of accessor functions.
Brian Gaeke [Thu, 30 Sep 2004 20:14:18 +0000 (20:14 +0000)]
Correct type of accessor functions.

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

19 years agoNamespacify. Add accessor function.
Brian Gaeke [Thu, 30 Sep 2004 20:14:07 +0000 (20:14 +0000)]
Namespacify.  Add accessor function.

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

19 years agoAdd accessor function prototypes for reoptimizer support passes.
Brian Gaeke [Thu, 30 Sep 2004 20:13:55 +0000 (20:13 +0000)]
Add accessor function prototypes for reoptimizer support passes.
Make accessors return FunctionPass* as appropriate.

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

19 years agoI think this will handle double args.
Brian Gaeke [Thu, 30 Sep 2004 19:44:32 +0000 (19:44 +0000)]
I think this will handle double args.

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

19 years agoThat should actually be __MING, not __MINGW.
Misha Brukman [Thu, 30 Sep 2004 18:28:07 +0000 (18:28 +0000)]
That should actually be __MING, not __MINGW.

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

19 years ago#include DataTypes.h to compile on MinGW, patch by Henrik Bach.
Misha Brukman [Thu, 30 Sep 2004 18:27:39 +0000 (18:27 +0000)]
#include DataTypes.h to compile on MinGW, patch by Henrik Bach.

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

19 years agoCheck for __MINGW define instead of __MINGW_H, patch by Henrik Bach.
Misha Brukman [Thu, 30 Sep 2004 18:24:58 +0000 (18:24 +0000)]
Check for __MINGW define instead of __MINGW_H, patch by Henrik Bach.

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

19 years agoUse more efficient map operations. Fix a bug that would affect hypothetical
Chris Lattner [Thu, 30 Sep 2004 16:35:08 +0000 (16:35 +0000)]
Use more efficient map operations.  Fix a bug that would affect hypothetical
targets that supported multiple memory operands.

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

19 years agoThere is no need to call MachineInstr::print directly, just send the MI& to an ostream.
Chris Lattner [Thu, 30 Sep 2004 16:10:45 +0000 (16:10 +0000)]
There is no need to call MachineInstr::print directly, just send the MI& to an ostream.

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

19 years ago* Wrap some comments to 80 cols
Chris Lattner [Thu, 30 Sep 2004 15:59:17 +0000 (15:59 +0000)]
* Wrap some comments to 80 cols
* Add const_iterator stuff
* Add a print method, which means that I can now call dump() from the
  debugger.

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

19 years agoMark the instructions that have delay slots with the hasDelaySlot flag.
Brian Gaeke [Thu, 30 Sep 2004 04:04:48 +0000 (04:04 +0000)]
Mark the instructions that have delay slots with the hasDelaySlot flag.
Add some comments.

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

19 years agoUse TargetMachine::hasDelaySlot() instead of our old switch statement
Brian Gaeke [Thu, 30 Sep 2004 04:04:47 +0000 (04:04 +0000)]
Use TargetMachine::hasDelaySlot() instead of our old switch statement
to find instrs that have delay slots.

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

19 years agoSimplify the logic in the simple spiller and capitalize some variables
Chris Lattner [Thu, 30 Sep 2004 02:59:33 +0000 (02:59 +0000)]
Simplify the logic in the simple spiller and capitalize some variables

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

19 years agoSwitch from defaulting to the 'local' spiller to the 'simple' spiller. The
Chris Lattner [Thu, 30 Sep 2004 02:40:06 +0000 (02:40 +0000)]
Switch from defaulting to the 'local' spiller to the 'simple' spiller.  The
two spillers produce perfectly identical code (at least on povray and eon),
but the simple spiller is substantially faster than the local spiller. Once
the local spiller is improved, we can switch back.

Switching cuts 5.2% off of the llc time for povray (about 1.3s).

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

19 years agoDon't use a densemap for keeping track of which vregs are already loaded, just
Chris Lattner [Thu, 30 Sep 2004 02:33:48 +0000 (02:33 +0000)]
Don't use a densemap for keeping track of which vregs are already loaded, just
use a simple vector.  This speeds up -spiller=simple from taking 22s to taking
.1s on povray (debug build).  This change does not modify the generated code.

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

19 years agoUse longer and more explicit names for instance vars (particularly important
Chris Lattner [Thu, 30 Sep 2004 02:15:18 +0000 (02:15 +0000)]
Use longer and more explicit names for instance vars (particularly important
data structures).  Fix the print method to send to the right ostream, not
always cerr.  Delete typedefs that are only used once.

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

19 years agoFree the VirtRegMap at the end of MachineFunction processing instead of at
Chris Lattner [Thu, 30 Sep 2004 02:02:33 +0000 (02:02 +0000)]
Free the VirtRegMap at the end of MachineFunction processing instead of at
the beginning of processing the next one.

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

19 years agoReindent code, improve comments, move huge nested methods out of classes,
Chris Lattner [Thu, 30 Sep 2004 01:54:45 +0000 (01:54 +0000)]
Reindent code, improve comments, move huge nested methods out of classes,
prune #includes, add print/dump methods, etc.  No functionality changes.

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

19 years agoDisable the 'WARNING: Found global types that are not compatible' warning
Chris Lattner [Thu, 30 Sep 2004 00:12:29 +0000 (00:12 +0000)]
Disable the 'WARNING: Found global types that are not compatible' warning
that always prints when linking programs to libstdc++ :(

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

19 years agoChange the #ifdefs to allow compilation with a V8 compiler, but the JIT still
Misha Brukman [Wed, 29 Sep 2004 23:01:17 +0000 (23:01 +0000)]
Change the #ifdefs to allow compilation with a V8 compiler, but the JIT still
won't work if not compiled in V9 mode, currently by GCC only, because Sun's
system compiler does not tell us if it's a V8 or V9 system.

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

19 years agoHrm, debugging printouts do not need to be in here
Chris Lattner [Wed, 29 Sep 2004 21:21:14 +0000 (21:21 +0000)]
Hrm, debugging printouts do not need to be in here

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

19 years agoMake sure to check select instructions for generic instruction properties
Chris Lattner [Wed, 29 Sep 2004 21:19:28 +0000 (21:19 +0000)]
Make sure to check select instructions for generic instruction properties

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