oota-llvm.git
19 years ago* Unbreak optimized build (noticed by Eric van Riet Paap)
Misha Brukman [Thu, 4 Aug 2005 14:16:48 +0000 (14:16 +0000)]
* Unbreak optimized build (noticed by Eric van Riet Paap)
* Comment #endif clauses for readability

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

19 years agoAdd Subtarget support to PowerPC. Next up, using it.
Nate Begeman [Thu, 4 Aug 2005 07:12:09 +0000 (07:12 +0000)]
Add Subtarget support to PowerPC.  Next up, using it.

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

19 years agorefactor some code
Chris Lattner [Thu, 4 Aug 2005 01:19:13 +0000 (01:19 +0000)]
refactor some code

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

19 years agothis is not implemented by lsr yet
Chris Lattner [Thu, 4 Aug 2005 01:18:48 +0000 (01:18 +0000)]
this is not implemented by lsr yet

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

19 years agoinvert to if's to make the logic simpler
Chris Lattner [Thu, 4 Aug 2005 00:40:47 +0000 (00:40 +0000)]
invert to if's to make the logic simpler

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

19 years agoWhen processing outer loops and we find uses of an IV in inner loops, make
Chris Lattner [Thu, 4 Aug 2005 00:14:11 +0000 (00:14 +0000)]
When processing outer loops and we find uses of an IV in inner loops, make
sure to handle the use, just don't recurse into it.

This permits us to generate this code for a simple nested loop case:

.LBB_foo_0:     ; entry
        stwu r1, -48(r1)
        stw r29, 44(r1)
        stw r30, 40(r1)
        mflr r11
        stw r11, 56(r1)
        lis r2, ha16(L_A$non_lazy_ptr)
        lwz r30, lo16(L_A$non_lazy_ptr)(r2)
        li r29, 1
.LBB_foo_1:     ; no_exit.0
        bl L_bar$stub
        li r2, 1
        or r3, r30, r30
.LBB_foo_2:     ; no_exit.1
        lfd f0, 8(r3)
        stfd f0, 0(r3)
        addi r4, r2, 1
        addi r3, r3, 8
        cmpwi cr0, r2, 100
        or r2, r4, r4
        bne .LBB_foo_2  ; no_exit.1
.LBB_foo_3:     ; loopexit.1
        addi r30, r30, 800
        addi r2, r29, 1
        cmpwi cr0, r29, 100
        or r29, r2, r2
        bne .LBB_foo_1  ; no_exit.0
.LBB_foo_4:     ; return
        lwz r11, 56(r1)
        mtlr r11
        lwz r30, 40(r1)
        lwz r29, 44(r1)
        lwz r1, 0(r1)
        blr

instead of this:

_foo:
.LBB_foo_0:     ; entry
        stwu r1, -48(r1)
        stw r28, 44(r1)                   ;; uses an extra register.
        stw r29, 40(r1)
        stw r30, 36(r1)
        mflr r11
        stw r11, 56(r1)
        li r30, 1
        li r29, 0
        or r28, r29, r29
.LBB_foo_1:     ; no_exit.0
        bl L_bar$stub
        mulli r2, r28, 800           ;; unstrength-reduced multiply
        lis r3, ha16(L_A$non_lazy_ptr)   ;; loop invariant address computation
        lwz r3, lo16(L_A$non_lazy_ptr)(r3)
        add r2, r2, r3
        mulli r4, r29, 800           ;; unstrength-reduced multiply
        addi r3, r3, 8
        add r3, r4, r3
        li r4, 1
.LBB_foo_2:     ; no_exit.1
        lfd f0, 0(r3)
        stfd f0, 0(r2)
        addi r5, r4, 1
        addi r2, r2, 8                 ;; multiple stride 8 IV's
        addi r3, r3, 8
        cmpwi cr0, r4, 100
        or r4, r5, r5
        bne .LBB_foo_2  ; no_exit.1
.LBB_foo_3:     ; loopexit.1
        addi r28, r28, 1               ;;; Many IV's with stride 1
        addi r29, r29, 1
        addi r2, r30, 1
        cmpwi cr0, r30, 100
        or r30, r2, r2
        bne .LBB_foo_1  ; no_exit.0
.LBB_foo_4:     ; return
        lwz r11, 56(r1)
        mtlr r11
        lwz r30, 36(r1)
        lwz r29, 40(r1)
        lwz r28, 44(r1)
        lwz r1, 0(r1)
        blr

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

19 years agoTeach loop-reduce to see into nested loops, to pull out immediate values
Chris Lattner [Wed, 3 Aug 2005 23:44:42 +0000 (23:44 +0000)]
Teach loop-reduce to see into nested loops, to pull out immediate values
pushed down by SCEV.

In a nested loop case, this allows us to emit this:

        lis r3, ha16(L_A$non_lazy_ptr)
        lwz r3, lo16(L_A$non_lazy_ptr)(r3)
        add r2, r2, r3
        li r3, 1
.LBB_foo_2:     ; no_exit.1
        lfd f0, 8(r2)        ;; Uses offset of 8 instead of 0
        stfd f0, 0(r2)
        addi r4, r3, 1
        addi r2, r2, 8
        cmpwi cr0, r3, 100
        or r3, r4, r4
        bne .LBB_foo_2  ; no_exit.1

instead of this:

        lis r3, ha16(L_A$non_lazy_ptr)
        lwz r3, lo16(L_A$non_lazy_ptr)(r3)
        add r2, r2, r3
        addi r3, r3, 8
        li r4, 1
.LBB_foo_2:     ; no_exit.1
        lfd f0, 0(r3)
        stfd f0, 0(r2)
        addi r5, r4, 1
        addi r2, r2, 8
        addi r3, r3, 8
        cmpwi cr0, r4, 100
        or r4, r5, r5
        bne .LBB_foo_2  ; no_exit.1

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

19 years agoimprove debug output
Chris Lattner [Wed, 3 Aug 2005 23:30:08 +0000 (23:30 +0000)]
improve debug output

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

19 years agoScalar SSE: load +0.0 -> xorps/xorpd
Nate Begeman [Wed, 3 Aug 2005 23:26:28 +0000 (23:26 +0000)]
Scalar SSE: load +0.0 -> xorps/xorpd
Scalar SSE: a < b ? c : 0.0 -> cmpss, andps
Scalar SSE: float -> i16 needs to be promoted

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

19 years agothis now passes
Chris Lattner [Wed, 3 Aug 2005 22:51:40 +0000 (22:51 +0000)]
this now passes

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

19 years agoMove from Stage 0 to Stage 1.
Chris Lattner [Wed, 3 Aug 2005 22:51:21 +0000 (22:51 +0000)]
Move from Stage 0 to Stage 1.

Only emit one PHI node for IV uses with identical bases and strides (after
moving foldable immediates to the load/store instruction).

This implements LoopStrengthReduce/dont_insert_redundant_ops.ll, allowing
us to generate this PPC code for test1:

        or r30, r3, r3
.LBB_test1_1:   ; Loop
        li r2, 0
        stw r2, 0(r30)
        stw r2, 4(r30)
        bl L_pred$stub
        addi r30, r30, 8
        cmplwi cr0, r3, 0
        bne .LBB_test1_1        ; Loop

instead of this code:

        or r30, r3, r3
        or r29, r3, r3
.LBB_test1_1:   ; Loop
        li r2, 0
        stw r2, 0(r29)
        stw r2, 4(r30)
        bl L_pred$stub
        addi r30, r30, 8        ;; Two iv's with step of 8
        addi r29, r29, 8
        cmplwi cr0, r3, 0
        bne .LBB_test1_1        ; Loop

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

19 years agoAlpha ABI specifies stack is always 16 byte alligned, and gcc does it, so I will too
Andrew Lenharth [Wed, 3 Aug 2005 22:33:21 +0000 (22:33 +0000)]
Alpha ABI specifies stack is always 16 byte alligned, and gcc does it, so I will too

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

19 years agoRename IVUse to IVUsersOfOneStride, use a struct instead of a pair to
Chris Lattner [Wed, 3 Aug 2005 22:21:05 +0000 (22:21 +0000)]
Rename IVUse to IVUsersOfOneStride, use a struct instead of a pair to
unify some parallel vectors and get field names more descriptive than
"first" and "second".  This isn't lisp afterall :)

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

19 years agoFix a nasty dangling pointer issue. The ScalarEvolution pass would keep a
Chris Lattner [Wed, 3 Aug 2005 21:36:09 +0000 (21:36 +0000)]
Fix a nasty dangling pointer issue.  The ScalarEvolution pass would keep a
map from instruction* to SCEVHandles.  When we delete instructions, we have
to tell it about it.  We would run into nasty cases where new instructions
were reallocated at old instruction addresses and get the old map values.
Bad bad bad :(

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

19 years agoFix this to test the BE we care about
Chris Lattner [Wed, 3 Aug 2005 21:01:46 +0000 (21:01 +0000)]
Fix this to test the BE we care about

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

19 years agoFix an obvious bug in the Log2 stuff that broke SingleSource/UnitTests/2005-05-12...
Chris Lattner [Wed, 3 Aug 2005 20:53:19 +0000 (20:53 +0000)]
Fix an obvious bug in the Log2 stuff that broke SingleSource/UnitTests/2005-05-12-Int64ToFP
last night.

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

19 years agoFix PR611, codegen'ing SREM of FP operands to fmod or fmodf instead of
Chris Lattner [Wed, 3 Aug 2005 20:31:37 +0000 (20:31 +0000)]
Fix PR611, codegen'ing SREM of FP operands to fmod or fmodf instead of
the sequence used for integer ops

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

19 years agoThe correct fix for PR612, which also fixes
Chris Lattner [Wed, 3 Aug 2005 18:51:44 +0000 (18:51 +0000)]
The correct fix for PR612, which also fixes
Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll

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

19 years agonew testcase for PR612
Chris Lattner [Wed, 3 Aug 2005 18:51:15 +0000 (18:51 +0000)]
new testcase for PR612

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

19 years agoWhen inserting code, make sure not to insert it before PHI nodes. This
Chris Lattner [Wed, 3 Aug 2005 18:34:29 +0000 (18:34 +0000)]
When inserting code, make sure not to insert it before PHI nodes.  This
fixes PR612 and Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll

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

19 years agonew testcase for PR612
Chris Lattner [Wed, 3 Aug 2005 18:33:48 +0000 (18:33 +0000)]
new testcase for PR612

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

19 years agoAdd a couple rlwinm tests for bitfield clears
Nate Begeman [Wed, 3 Aug 2005 18:27:17 +0000 (18:27 +0000)]
Add a couple rlwinm tests for bitfield clears

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

19 years agoUpdate rlwimi tests to catch all the cases we care about
Nate Begeman [Wed, 3 Aug 2005 18:11:23 +0000 (18:11 +0000)]
Update rlwimi tests to catch all the cases we care about

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

19 years agoTestcase that used to crash simplifycfg
Chris Lattner [Wed, 3 Aug 2005 18:01:07 +0000 (18:01 +0000)]
Testcase  that used to crash simplifycfg

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

19 years agoFix Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll, a problem that
Chris Lattner [Wed, 3 Aug 2005 17:59:45 +0000 (17:59 +0000)]
Fix Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll, a problem that
occurred while bugpointing another testcase

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

19 years agoadd support for Graphviz when viewing CFGs
Chris Lattner [Wed, 3 Aug 2005 17:55:05 +0000 (17:55 +0000)]
add support for Graphviz when viewing CFGs

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

19 years agoFix grammar: apostrophe-s ('s) is possessive, not plural; also iff vs. if.
Misha Brukman [Wed, 3 Aug 2005 17:29:52 +0000 (17:29 +0000)]
Fix grammar: apostrophe-s ('s) is possessive, not plural; also iff vs. if.

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

19 years agoWrap comments to 80 cols, fix code sequence for CountLeadingZeros_64 on
Chris Lattner [Wed, 3 Aug 2005 16:53:58 +0000 (16:53 +0000)]
Wrap comments to 80 cols, fix code sequence for CountLeadingZeros_64 on
non-ppc GCC 4.0 machines.  Patch by Jim Laskey!

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

19 years agominor capitalization thing, patch by Jim Laskey
Chris Lattner [Wed, 3 Aug 2005 16:52:22 +0000 (16:52 +0000)]
minor capitalization thing, patch by Jim Laskey

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

19 years agoFix another bug in the clz patch that caused miscompilations when !gcc4
Chris Lattner [Wed, 3 Aug 2005 01:04:40 +0000 (01:04 +0000)]
Fix another bug in the clz patch that caused miscompilations when !gcc4

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

19 years agoFinally, add the required constraint checks to fix Transforms/SimplifyCFG/2005-08...
Chris Lattner [Wed, 3 Aug 2005 00:59:12 +0000 (00:59 +0000)]
Finally, add the required constraint checks to fix  Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll
the right way

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

19 years agoun-xfail this
Chris Lattner [Wed, 3 Aug 2005 00:58:44 +0000 (00:58 +0000)]
un-xfail this

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

19 years agoSimplify some code, add the correct pred checks
Chris Lattner [Wed, 3 Aug 2005 00:38:27 +0000 (00:38 +0000)]
Simplify some code, add the correct pred checks

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

19 years agoRefactor code out of PropagatePredecessorsForPHIs, turning it into a pure function...
Chris Lattner [Wed, 3 Aug 2005 00:29:26 +0000 (00:29 +0000)]
Refactor code out of PropagatePredecessorsForPHIs, turning it into a pure function with no side-effects

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

19 years agouse splice instead of remove/insert to avoid some symtab operations
Chris Lattner [Wed, 3 Aug 2005 00:23:42 +0000 (00:23 +0000)]
use splice instead of remove/insert to avoid some symtab operations

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

19 years agomove two functions up in the file, use SafeToMergeTerminators to eliminate
Chris Lattner [Wed, 3 Aug 2005 00:19:45 +0000 (00:19 +0000)]
move two functions up in the file, use SafeToMergeTerminators to eliminate
some duplicated code

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

19 years agoRip some code out of the main SimplifyCFG function into a subfunction and
Chris Lattner [Wed, 3 Aug 2005 00:11:16 +0000 (00:11 +0000)]
Rip some code out of the main SimplifyCFG function into a subfunction and
call it from the only place it is live.  No functionality changes.

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

19 years agoThis fails for now
Chris Lattner [Wed, 3 Aug 2005 00:10:28 +0000 (00:10 +0000)]
This fails for now

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

19 years agoDisable this patch:
Chris Lattner [Tue, 2 Aug 2005 23:31:38 +0000 (23:31 +0000)]
Disable this patch:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050801/027345.html

This breaks real programs and only fixes an obscure regression testcase.  A
real fix is in development.

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

19 years agoChange a place to use an arbitrary value instead of null, when possible
Chris Lattner [Tue, 2 Aug 2005 23:29:23 +0000 (23:29 +0000)]
Change a place to use an arbitrary value instead of null, when possible

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

19 years agoIf the user interrupts bugpoint, don't extract loops
Chris Lattner [Tue, 2 Aug 2005 23:25:56 +0000 (23:25 +0000)]
If the user interrupts bugpoint, don't extract loops

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

19 years agoAdd a note, people are responsible for requesting that they be added to the
Chris Lattner [Tue, 2 Aug 2005 22:10:21 +0000 (22:10 +0000)]
Add a note, people are responsible for requesting that they be added to the
file.

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

19 years agoPass -export-dynamic to gcc when compiling with -native and the link is
Chris Lattner [Tue, 2 Aug 2005 22:07:38 +0000 (22:07 +0000)]
Pass -export-dynamic to gcc when compiling with -native and the link is
performed with -export-dynamic (aka. -disable-internalize).

Patch by Nicholas Riley!

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

19 years agoFix the non-gcc 4.0 paths for countleadingzeros
Chris Lattner [Tue, 2 Aug 2005 20:21:33 +0000 (20:21 +0000)]
Fix the non-gcc 4.0 paths for countleadingzeros

Patch fixed by Jim Laskey

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

19 years agoFix inverted conditionals
Chris Lattner [Tue, 2 Aug 2005 20:06:18 +0000 (20:06 +0000)]
Fix inverted conditionals

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

19 years agoone more hunk that got dropped
Chris Lattner [Tue, 2 Aug 2005 19:35:29 +0000 (19:35 +0000)]
one more hunk that got dropped

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

19 years agoThis hunk accidentally got dropped. Patch by Jim Laskey
Chris Lattner [Tue, 2 Aug 2005 19:30:55 +0000 (19:30 +0000)]
This hunk accidentally got dropped.  Patch by Jim Laskey

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

19 years agoUpdate to use the new MathExtras.h support for log2 computation.
Chris Lattner [Tue, 2 Aug 2005 19:26:06 +0000 (19:26 +0000)]
Update to use the new MathExtras.h support for log2 computation.
Patch contributed by Jim Laskey!

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

19 years agoFix the non-gcc 4.0 path to compile
Chris Lattner [Tue, 2 Aug 2005 19:21:51 +0000 (19:21 +0000)]
Fix the non-gcc 4.0 path to compile

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

19 years agoUpdate to use the new MathExtras.h support for log2 computation.
Chris Lattner [Tue, 2 Aug 2005 19:16:58 +0000 (19:16 +0000)]
Update to use the new MathExtras.h support for log2 computation.
Patch contributed by Jim Laskey!

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

19 years agoConsolidate all of the various log2 computing functions into MathExtras.h.
Chris Lattner [Tue, 2 Aug 2005 19:15:30 +0000 (19:15 +0000)]
Consolidate all of the various log2 computing functions into MathExtras.h.
Also, provide accelerated implementations when building with GCC.
Patch contributed by Jim Laskey!

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

19 years agoUpdate a doc, patch contributed by Jim Laskey!
Chris Lattner [Tue, 2 Aug 2005 19:14:25 +0000 (19:14 +0000)]
Update a doc, patch contributed by Jim Laskey!

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

19 years agoadd a pass name to make debugging dumps nicer
Chris Lattner [Tue, 2 Aug 2005 19:07:49 +0000 (19:07 +0000)]
add a pass name to make debugging dumps nicer

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

19 years agoFix grammar: it's == "it is".
Misha Brukman [Tue, 2 Aug 2005 16:04:59 +0000 (16:04 +0000)]
Fix grammar: it's == "it is".

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

19 years agoLike the comment says, do not insert cast instructions before phi nodes
Chris Lattner [Tue, 2 Aug 2005 03:31:14 +0000 (03:31 +0000)]
Like the comment says, do not insert cast instructions before phi nodes

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

19 years agoIt's dangerous coding on Mondays.
Jeff Cohen [Tue, 2 Aug 2005 03:26:32 +0000 (03:26 +0000)]
It's dangerous coding on Mondays.

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

19 years agoThis code was very close, but not quite right. It did not take into
Chris Lattner [Tue, 2 Aug 2005 03:24:05 +0000 (03:24 +0000)]
This code was very close, but not quite right.  It did not take into
consideration the case where a reference in an unreachable block could
occur.  This fixes Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll,
something I ran into while bugpoint'ing another pass.

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

19 years agoNew testcase that caused simplifycfg to crash
Chris Lattner [Tue, 2 Aug 2005 03:23:03 +0000 (03:23 +0000)]
New testcase that caused simplifycfg to crash

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

19 years agoImplement SetInterruptFunction for Windows.
Jeff Cohen [Tue, 2 Aug 2005 03:04:47 +0000 (03:04 +0000)]
Implement SetInterruptFunction for Windows.

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

19 years agoadd a comment, make a check more lenient
Chris Lattner [Tue, 2 Aug 2005 02:52:02 +0000 (02:52 +0000)]
add a comment, make a check more lenient

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

19 years agoSimplify for loop, clear a per-loop map after processing each loop
Chris Lattner [Tue, 2 Aug 2005 02:44:31 +0000 (02:44 +0000)]
Simplify for loop, clear a per-loop map after processing each loop

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

19 years agoWhen the user hits ctrl-c, bugpoint should attempt to stop reduction as
Chris Lattner [Tue, 2 Aug 2005 02:16:17 +0000 (02:16 +0000)]
When the user hits ctrl-c, bugpoint should attempt to stop reduction as
quickly as possible and output what it has so far.  If they hit it twice,
bugpoint is killed.

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

19 years agoImplement sys::SetInterruptFunction on Unix, stub it on win32 so that the
Chris Lattner [Tue, 2 Aug 2005 02:14:22 +0000 (02:14 +0000)]
Implement sys::SetInterruptFunction on Unix, stub it on win32 so that the
build will not fail

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

19 years agoadd a new function proto
Chris Lattner [Tue, 2 Aug 2005 02:13:42 +0000 (02:13 +0000)]
add a new function proto

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

19 years agoAdd a comment
Chris Lattner [Tue, 2 Aug 2005 01:32:29 +0000 (01:32 +0000)]
Add a comment
Make LSR ignore GEP's that have loop variant base values, as we currently
cannot codegen them

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

19 years agoFix an iterator invalidation problem
Chris Lattner [Tue, 2 Aug 2005 00:41:11 +0000 (00:41 +0000)]
Fix an iterator invalidation problem

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

19 years ago200.sixtrack prints FP numbers with a very strange notation that uses D
Chris Lattner [Tue, 2 Aug 2005 00:11:53 +0000 (00:11 +0000)]
200.sixtrack prints FP numbers with a very strange notation that uses D
instead of E for exponentials (e.g. 1.234D-43).  Add support for this
notation.

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

19 years agomake is the standard name, not gmake
Chris Lattner [Tue, 2 Aug 2005 00:10:52 +0000 (00:10 +0000)]
make is the standard name, not gmake

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

19 years agoMark these as V9 specific
Chris Lattner [Mon, 1 Aug 2005 20:38:31 +0000 (20:38 +0000)]
Mark these as V9 specific

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

19 years agoupdate function codes to reflect /su flags that have been added since this was written
Andrew Lenharth [Mon, 1 Aug 2005 20:06:01 +0000 (20:06 +0000)]
update function codes to reflect /su flags that have been added since this was written

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

19 years agoFix casts from long to sbyte on ppc
Chris Lattner [Mon, 1 Aug 2005 18:16:37 +0000 (18:16 +0000)]
Fix casts from long to sbyte on ppc

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

19 years agouse llabs not abs
Andrew Lenharth [Mon, 1 Aug 2005 17:47:28 +0000 (17:47 +0000)]
use llabs not abs

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

19 years agoone cannot allocate a global, until one is done initializing the global pointers
Andrew Lenharth [Mon, 1 Aug 2005 17:35:40 +0000 (17:35 +0000)]
one cannot allocate a global, until one is done initializing the global pointers

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

19 years agotemporarily fail these two tests until LSR evolves to support them
Chris Lattner [Mon, 1 Aug 2005 17:10:50 +0000 (17:10 +0000)]
temporarily fail these two tests until LSR evolves to support them

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

19 years agoConstantInt::get only works for arguments < 128.
Chris Lattner [Mon, 1 Aug 2005 16:52:50 +0000 (16:52 +0000)]
ConstantInt::get only works for arguments < 128.

SimplifyLibCalls probably has to be audited to make sure it does not make
this mistake elsewhere.  Also, if this code knows that the type will be
unsigned, obviously one arm of this is dead.

Reid, can you take a look into this further?

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

19 years agoKeep tabs and trailing spaces out.
Jeff Cohen [Sat, 30 Jul 2005 18:33:25 +0000 (18:33 +0000)]
Keep tabs and trailing spaces out.

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

19 years agoFix VC++ build problems.
Jeff Cohen [Sat, 30 Jul 2005 18:22:27 +0000 (18:22 +0000)]
Fix VC++ build problems.

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

19 years agofix float->long conversions on x86
Chris Lattner [Sat, 30 Jul 2005 01:40:57 +0000 (01:40 +0000)]
fix float->long conversions on x86

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

19 years agothis tests every fp-to-integer conversion
Chris Lattner [Sat, 30 Jul 2005 01:33:38 +0000 (01:33 +0000)]
this tests every fp-to-integer conversion

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

19 years agofix a typeo
Chris Lattner [Sat, 30 Jul 2005 00:43:00 +0000 (00:43 +0000)]
fix a typeo

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

19 years agoAck, typo
Nate Begeman [Sat, 30 Jul 2005 00:21:31 +0000 (00:21 +0000)]
Ack, typo

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

19 years agoChange the fp to integer code to not perform 2-byte stores followed by
Chris Lattner [Sat, 30 Jul 2005 00:17:52 +0000 (00:17 +0000)]
Change the fp to integer code to not perform 2-byte stores followed by
1 byte loads and other operations.  This is bad for store-forwarding on
common CPUs.  We now do this:

fnstcw WORD PTR [%ESP]
mov %AX, WORD PTR [%ESP]

instead of:

fnstcw WORD PTR [%ESP]
mov %AL, BYTE PTR [%ESP + 1]

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

19 years agoCommit a new LoopStrengthReduce pass that can use scalar evolutions and
Nate Begeman [Sat, 30 Jul 2005 00:15:07 +0000 (00:15 +0000)]
Commit a new LoopStrengthReduce pass that can use scalar evolutions and
target data to decide which loop induction variables to strength reduce
and how to do so.  This work is mostly by Chris Lattner, with tweaks by
me to get it working on some of MultiSource.

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

19 years agoBreak SCEVExpander out of IndVarSimplify into its own .h/.cpp file so that
Nate Begeman [Sat, 30 Jul 2005 00:12:19 +0000 (00:12 +0000)]
Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so that
other passes may use it.

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

19 years agoUse a custom expander for all FP to int conversions, as the X86 only has
Chris Lattner [Sat, 30 Jul 2005 00:05:54 +0000 (00:05 +0000)]
Use a custom expander for all FP to int conversions, as the X86 only has
FP-to-int-in-memory: this exposes the load from the stored slot to the
selection dag, allowing it to be folded into other operaions.

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

19 years agoAllow targets to have custom expanders for FP_TO_*INT conversions where
Chris Lattner [Sat, 30 Jul 2005 00:04:12 +0000 (00:04 +0000)]
Allow targets to have custom expanders for FP_TO_*INT conversions where
both the src and dest values are legal

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

19 years agosupport near allocations for the JIT
Andrew Lenharth [Fri, 29 Jul 2005 23:40:16 +0000 (23:40 +0000)]
support near allocations for the JIT

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

19 years agoturn off GOT on archs that didn't use it (not that it appeard to harm them much with...
Andrew Lenharth [Fri, 29 Jul 2005 23:32:02 +0000 (23:32 +0000)]
turn off GOT on archs that didn't use it (not that it appeard to harm them much with it on)

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

19 years agoImplement a FIXME: move a bunch of cruft for handling FP_TO_*INT operations
Chris Lattner [Fri, 29 Jul 2005 01:00:29 +0000 (01:00 +0000)]
Implement a FIXME: move a bunch of cruft for handling FP_TO_*INT operations
that the X86 does not support to the legalizer.  This allows it to be better
optimized, etc, and will help with SSE support.

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

19 years agoDon't forget to diddle with the control word when performing an FISTP64.
Chris Lattner [Fri, 29 Jul 2005 00:54:34 +0000 (00:54 +0000)]
Don't forget to diddle with the control word when performing an FISTP64.

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

19 years agoUse a custom expander to compile this:
Chris Lattner [Fri, 29 Jul 2005 00:40:01 +0000 (00:40 +0000)]
Use a custom expander to compile this:

long %test4(double %X) {
        %tmp.1 = cast double %X to long         ; <long> [#uses=1]
        ret long %tmp.1
}

to this:

_test4:
        sub %ESP, 12
        fld QWORD PTR [%ESP + 16]
        fistp QWORD PTR [%ESP]
        mov %EDX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%ESP]
        add %ESP, 12
        ret

instead of this:

_test4:
        sub %ESP, 28
        fld QWORD PTR [%ESP + 32]
        fstp QWORD PTR [%ESP]
        call ___fixdfdi
        add %ESP, 28
        ret

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

19 years agoAllow targets to define custom expanders for FP_TO_*INT
Chris Lattner [Fri, 29 Jul 2005 00:33:32 +0000 (00:33 +0000)]
Allow targets to define custom expanders for FP_TO_*INT

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

19 years agoallow a target to request that unknown FP_TO_*INT conversion be promoted to
Chris Lattner [Fri, 29 Jul 2005 00:11:56 +0000 (00:11 +0000)]
allow a target to request that unknown FP_TO_*INT conversion be promoted to
a larger integer destination.

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

19 years agoinstead of having all conversions be handled by one case value, and then have
Chris Lattner [Thu, 28 Jul 2005 23:31:12 +0000 (23:31 +0000)]
instead of having all conversions be handled by one case value, and then have
subcases inside, break things out earlier.

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

19 years agoNew testcase for PR610
Chris Lattner [Thu, 28 Jul 2005 20:18:33 +0000 (20:18 +0000)]
New testcase for PR610

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

19 years agosupport bsr, and more .td simplification
Andrew Lenharth [Thu, 28 Jul 2005 18:14:47 +0000 (18:14 +0000)]
support bsr, and more .td simplification

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

19 years agonew is not a valid default anywhere, so make this pure virtual
Andrew Lenharth [Thu, 28 Jul 2005 18:13:59 +0000 (18:13 +0000)]
new is not a valid default anywhere, so make this pure virtual

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

19 years agoFix a problem in getDirectoryContents where sub-directory names were
Reid Spencer [Thu, 28 Jul 2005 16:25:57 +0000 (16:25 +0000)]
Fix a problem in getDirectoryContents where sub-directory names were
appended to a path string that didn't end in a slash, yielding invalid
path names.

Path contribute by Nicholas Riley.

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

19 years agoget lazy JITing working. Some of shootout runs now
Andrew Lenharth [Thu, 28 Jul 2005 12:45:20 +0000 (12:45 +0000)]
get lazy JITing working.  Some of shootout runs now

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

19 years agoLike constants, globals on some platforms are GOT relative. This means they have...
Andrew Lenharth [Thu, 28 Jul 2005 12:44:13 +0000 (12:44 +0000)]
Like constants, globals on some platforms are GOT relative.  This means they have to be allocated
near the GOT, which new doesn't do.  So break out the allocate into a new function.

Also move GOT index handling into JITResolver.  This lets it update the mapping when a Lazy
function is JITed.  It doesn't managed the table, just the mapping.  Note that this is
still non-ideal, as any function that takes a function address should also take a GOT
index, but that is a lot of changes.  The relocation resolve process updates any GOT entry
it sees is out of date.

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