oota-llvm.git
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

20 years agoAdd the enum corresponding to the source change I made earlier
Chris Lattner [Fri, 7 May 2004 02:27:32 +0000 (02:27 +0000)]
Add the enum corresponding to the source change I made earlier

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

20 years agoBug fixed.
John Criswell [Thu, 6 May 2004 22:23:24 +0000 (22:23 +0000)]
Bug fixed.

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

20 years agoDon't call getForwardedType() twice, as recommended by Chris.
John Criswell [Thu, 6 May 2004 22:15:47 +0000 (22:15 +0000)]
Don't call getForwardedType() twice, as recommended by Chris.

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

20 years agoUse the new commandline flag to allow us to call bugpoint like this:
Chris Lattner [Thu, 6 May 2004 22:05:35 +0000 (22:05 +0000)]
Use the new commandline flag to allow us to call bugpoint like this:

 bugpoint ... --tool-args -enable-correct-eh-support -regalloc=linearscan --args -- -foo

So that tool-args option gets the -enable-correct-eh-support -regalloc=linearscan flags instead of bugpoint.

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

20 years agoImplement the new cl::PositionalEatsArgs flag, refactor code a bit
Chris Lattner [Thu, 6 May 2004 22:04:31 +0000 (22:04 +0000)]
Implement the new cl::PositionalEatsArgs flag, refactor code a bit

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

20 years agoAdd a new cl::PositionalEatsArgs flag
Chris Lattner [Thu, 6 May 2004 22:03:59 +0000 (22:03 +0000)]
Add a new cl::PositionalEatsArgs flag

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

20 years agoFix for PR#330.
John Criswell [Thu, 6 May 2004 21:18:08 +0000 (21:18 +0000)]
Fix for PR#330.
When looking at getelementptr instructions, make sure to use a forwarded
type.  We want to do this because a DerivedType may drop its uses and then
refine its users, who may then use another user who hasn't been refined yet.
By getting the forwarded type, we always ensure that we're looking at a
Type that isn't in a halfway refined state.

Now, I should be able to put this stuff in PATypeHandle, but it doesn't work
for some reason.  This should do for now.

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

20 years agoRemove a really old comment
Chris Lattner [Thu, 6 May 2004 19:29:58 +0000 (19:29 +0000)]
Remove a really old comment

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

20 years agoJust testing the "Reid has CVS commit access" system
Reid Spencer [Thu, 6 May 2004 18:06:18 +0000 (18:06 +0000)]
Just testing the "Reid has CVS commit access" system

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

20 years agoGive props to Vladimir Prus for the inst_iterator patch.
Misha Brukman [Thu, 6 May 2004 16:53:18 +0000 (16:53 +0000)]
Give props to Vladimir Prus for the inst_iterator patch.

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

20 years agonumeric_limits::infinity() apparently does not work on all systems. As a
Chris Lattner [Thu, 6 May 2004 16:25:59 +0000 (16:25 +0000)]
numeric_limits::infinity() apparently does not work on all systems.  As a
workaround, use the C HUGE_VAL macro instead.

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

20 years agoFix for gcc3.4: invalid use of forward delacred class on line 93
Alkis Evlogimenos [Thu, 6 May 2004 02:07:42 +0000 (02:07 +0000)]
Fix for gcc3.4: invalid use of forward delacred class on line 93

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

20 years agoMove the stuff that fixes the size, orientation & fonts of graphs to
Brian Gaeke [Wed, 5 May 2004 06:10:06 +0000 (06:10 +0000)]
Move the stuff that fixes the size, orientation & fonts of graphs to
the debugging functions that call "dot". These fixed settings have
various problems: for example, the fixed size that is set in the graph
traits classes is not appropriate for turning the dot file into a PNG,
and if TrueType font rendering is being used, the 'Courier' TrueType font
may not be installed. It seems easy enough to specify these things on the
command line, anyhow.

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

20 years agoApply simplification suggested by Chris: why assign() when operator = will do?
Brian Gaeke [Tue, 4 May 2004 22:02:41 +0000 (22:02 +0000)]
Apply simplification suggested by Chris: why assign() when operator = will do?

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

20 years agoFixed inconsistent indentation.
John Criswell [Tue, 4 May 2004 21:46:05 +0000 (21:46 +0000)]
Fixed inconsistent indentation.

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

20 years agoMissing piece of fix for Bug 333
Brian Gaeke [Tue, 4 May 2004 21:41:45 +0000 (21:41 +0000)]
Missing piece of fix for Bug 333

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

20 years agoBugs fixed
Brian Gaeke [Tue, 4 May 2004 21:22:57 +0000 (21:22 +0000)]
Bugs fixed

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

20 years agoupdate command guide to have --tool-args
Brian Gaeke [Tue, 4 May 2004 21:13:35 +0000 (21:13 +0000)]
update command guide to have --tool-args

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

20 years agoAdd --tool-args flag which lets you pass arguments to llc or lli.
Brian Gaeke [Tue, 4 May 2004 21:09:16 +0000 (21:09 +0000)]
Add --tool-args flag which lets you pass arguments to llc or lli.
This is intended to address Bug 40.

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

20 years agoCorrectly mangle function names when they are used as part of a
Brian Gaeke [Tue, 4 May 2004 21:09:02 +0000 (21:09 +0000)]
Correctly mangle function names when they are used as part of a
constant pool member's name.
This is intended to address Bug 333.

Also, fix an anachronistic usage of "M" as a parameter of type Function *.

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

20 years agoAdd "Args" optional argument to AbstractInterpreter factory methods, which
Brian Gaeke [Tue, 4 May 2004 21:09:01 +0000 (21:09 +0000)]
Add "Args" optional argument to AbstractInterpreter factory methods, which
fills in a ToolArgs vector in the AbstractInterpreter if it is set. This
ToolArgs vector is used to pass additional arguments to LLI and/or LLC.
This is intended to address Bug 40.

Also, make -debug-only=toolrunner work for the LLC and CBE
AbstractInterpreters.

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

20 years agoRemove unneeded check
Chris Lattner [Tue, 4 May 2004 19:35:11 +0000 (19:35 +0000)]
Remove unneeded check

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

20 years agoImprove signed division by power of 2 *dramatically* from this:
Chris Lattner [Tue, 4 May 2004 19:33:58 +0000 (19:33 +0000)]
Improve signed division by power of 2 *dramatically* from this:

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

to this:

div:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        sar %ECX, 5
        shr %ECX, 26
        mov %EDX, %EAX
        add %EDX, %ECX
        sar %EAX, 6
        ret

Note that the intel compiler is currently making this:

div:
        movl      4(%esp), %edx                                 #3.5
        movl      %edx, %eax                                    #4.14
        sarl      $5, %eax                                      #4.14
        shrl      $26, %eax                                     #4.14
        addl      %edx, %eax                                    #4.14
        sarl      $6, %eax                                      #4.14
        ret                                                     #4.14

Which has one less register->register copy.  (hint hint alkis :)

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

20 years agoProvide visit(Module&) and visitModule(Module&) functionality.
Misha Brukman [Tue, 4 May 2004 18:30:38 +0000 (18:30 +0000)]
Provide visit(Module&) and visitModule(Module&) functionality.

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

20 years agoAdd stub support for reading BBTraces.
Brian Gaeke [Tue, 4 May 2004 17:11:14 +0000 (17:11 +0000)]
Add stub support for reading BBTraces.

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

20 years agoAdd BBTrace accessor method and data member.
Brian Gaeke [Tue, 4 May 2004 17:11:13 +0000 (17:11 +0000)]
Add BBTrace accessor method and data member.

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

20 years agoBug fixed
Chris Lattner [Tue, 4 May 2004 17:04:09 +0000 (17:04 +0000)]
Bug fixed

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

20 years agoDo not mark instructions in unreachable sections of the function as live.
Chris Lattner [Tue, 4 May 2004 17:00:46 +0000 (17:00 +0000)]
Do not mark instructions in unreachable sections of the function as live.
This fixes PR332 and ADCE/2004-05-04-UnreachableBlock.llx

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

20 years agoNew testcase for PR332
Chris Lattner [Tue, 4 May 2004 17:00:10 +0000 (17:00 +0000)]
New testcase for PR332

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

20 years agoNew header file containing profile info enums shared between the C++ analysis
Brian Gaeke [Tue, 4 May 2004 16:57:57 +0000 (16:57 +0000)]
New header file containing profile info enums shared between the C++ analysis
libraries and the C runtime support library

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

20 years agoShare ProfilingType enum with the C profiling runtime libraries.
Brian Gaeke [Tue, 4 May 2004 16:53:07 +0000 (16:53 +0000)]
Share ProfilingType enum with the C profiling runtime libraries.

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

20 years agoShare the profile info type enum with the C++ analysis libraries.
Brian Gaeke [Tue, 4 May 2004 16:51:48 +0000 (16:51 +0000)]
Share the profile info type enum with the C++ analysis libraries.
Add a documentation comment for write_profiling_data().

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

20 years agoConstants for profile info type changed names to match the C++ ones.
Brian Gaeke [Tue, 4 May 2004 16:51:47 +0000 (16:51 +0000)]
Constants for profile info type changed names to match the C++ ones.

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

20 years agoConstants for profile info type changed names to match the C++ ones.
Brian Gaeke [Tue, 4 May 2004 16:51:46 +0000 (16:51 +0000)]
Constants for profile info type changed names to match the C++ ones.
Edited comments.

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

20 years agoImprove code generated for integer multiplications by 2,3,5,9
Chris Lattner [Tue, 4 May 2004 15:47:14 +0000 (15:47 +0000)]
Improve code generated for integer multiplications by 2,3,5,9

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

20 years agoMinor efficiency tweak, suggested by Patrick Meredith
Chris Lattner [Tue, 4 May 2004 15:19:33 +0000 (15:19 +0000)]
Minor efficiency tweak, suggested by Patrick Meredith

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

20 years agoFix typo
Brian Gaeke [Mon, 3 May 2004 23:52:07 +0000 (23:52 +0000)]
Fix typo

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

20 years agoAdd initial implementation of basic block tracing runtime
Brian Gaeke [Mon, 3 May 2004 23:51:50 +0000 (23:51 +0000)]
Add initial implementation of basic block tracing runtime

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

20 years agoAdd basic block tracing functions as exported symbols.
Brian Gaeke [Mon, 3 May 2004 23:49:17 +0000 (23:49 +0000)]
Add basic block tracing functions as exported symbols.

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

20 years agoAdd basic block tracing information as a type of "profiling" information.
Brian Gaeke [Mon, 3 May 2004 23:49:16 +0000 (23:49 +0000)]
Add basic block tracing information as a type of "profiling" information.

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

20 years agoIn InsertProfilingInitCall(), make it legal to pass in a null array, in
Brian Gaeke [Mon, 3 May 2004 22:06:33 +0000 (22:06 +0000)]
In InsertProfilingInitCall(), make it legal to pass in a null array, in
which case you'll get a null array and zero passed to the profiling function.

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

20 years agoAdd initial implementation of basic-block tracing instrumentation pass.
Brian Gaeke [Mon, 3 May 2004 22:06:32 +0000 (22:06 +0000)]
Add initial implementation of basic-block tracing instrumentation pass.

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

20 years agoInitialize member out of paranoia
Chris Lattner [Sun, 2 May 2004 16:06:40 +0000 (16:06 +0000)]
Initialize member out of paranoia

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

20 years agoFix a problem with double freeing memory. For some reason, CallGraph is not
Chris Lattner [Sun, 2 May 2004 16:06:18 +0000 (16:06 +0000)]
Fix a problem with double freeing memory.  For some reason, CallGraph is not
acting like a normal pass.  :(

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

20 years agoPlug a minor memory leak
Chris Lattner [Sun, 2 May 2004 07:31:34 +0000 (07:31 +0000)]
Plug a minor memory leak

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

20 years agoDo not clone arbitrary condition instructions.
Chris Lattner [Sun, 2 May 2004 05:19:36 +0000 (05:19 +0000)]
Do not clone arbitrary condition instructions.

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

20 years agoDo not infinitely "unroll" single BB loops.
Chris Lattner [Sun, 2 May 2004 05:02:03 +0000 (05:02 +0000)]
Do not infinitely "unroll" single BB loops.

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

20 years agoAdd some stuff to the release notes.
Chris Lattner [Sun, 2 May 2004 04:19:15 +0000 (04:19 +0000)]
Add some stuff to the release notes.

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

20 years agoChris told me to take these assertions out a few days ago, but I forgot to
Brian Gaeke [Sun, 2 May 2004 01:04:52 +0000 (01:04 +0000)]
Chris told me to take these assertions out a few days ago, but I forgot to
check this in.

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

20 years agoDont' merge terminators that are needed to select PHI node values.
Chris Lattner [Sun, 2 May 2004 01:00:44 +0000 (01:00 +0000)]
Dont' merge terminators that are needed to select PHI node values.

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

20 years agoImplement SimplifyCFG/branch-cond-merge.ll
Chris Lattner [Sat, 1 May 2004 23:35:43 +0000 (23:35 +0000)]
Implement SimplifyCFG/branch-cond-merge.ll
Turning "if (A < B && B < C)" into "if (A < B & B < C)"

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

20 years agoNew testcase:
Chris Lattner [Sat, 1 May 2004 23:35:21 +0000 (23:35 +0000)]
New testcase:
  Turn "if (A < B && B < C)" into "if (A < B & B < C)"

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

20 years agoMake sure to reprocess instructions used by deleted instructions to avoid
Chris Lattner [Sat, 1 May 2004 23:27:23 +0000 (23:27 +0000)]
Make sure to reprocess instructions used by deleted instructions to avoid
missing opportunities for combination.

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

20 years agoMake sure the instruction combiner doesn't lose track of instructions
Chris Lattner [Sat, 1 May 2004 23:19:52 +0000 (23:19 +0000)]
Make sure the instruction combiner doesn't lose track of instructions
when replacing them, missing the opportunity to do simplifications

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

20 years agoFix my missing parens
Chris Lattner [Sat, 1 May 2004 22:41:51 +0000 (22:41 +0000)]
Fix my missing parens

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