oota-llvm.git
20 years agoAnother testcase
Chris Lattner [Sun, 18 Apr 2004 06:55:57 +0000 (06:55 +0000)]
Another testcase

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

20 years agoImplement method
Chris Lattner [Sun, 18 Apr 2004 06:54:48 +0000 (06:54 +0000)]
Implement method

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

20 years agoAdd a new method
Chris Lattner [Sun, 18 Apr 2004 06:54:34 +0000 (06:54 +0000)]
Add a new method

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

20 years agoAfter unrolling our single basic block loop, fold it into the preheader and exit
Chris Lattner [Sun, 18 Apr 2004 06:27:43 +0000 (06:27 +0000)]
After unrolling our single basic block loop, fold it into the preheader and exit
block.  The primary motivation for doing this is that we can now unroll nested loops.

This makes a pretty big difference in some cases.  For example, in 183.equake,
we are now beating the native compiler with the CBE, and we are a lot closer
with LLC.

I'm now going to play around a bit with the unroll factor and see what effect
it really has.

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

20 years agoFix a bug: this does not preserve the CFG!
Chris Lattner [Sun, 18 Apr 2004 05:38:37 +0000 (05:38 +0000)]
Fix a bug: this does not preserve the CFG!

While we're at it, add support for updating loop information correctly.

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

20 years agoAdd a new method, add a check missing that caused a segfault if a loop didn't
Chris Lattner [Sun, 18 Apr 2004 05:38:05 +0000 (05:38 +0000)]
Add a new method, add a check missing that caused a segfault if a loop didn't
have a canonical indvar

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

20 years agoAllow clients to delete loops, add a new method
Chris Lattner [Sun, 18 Apr 2004 05:37:42 +0000 (05:37 +0000)]
Allow clients to delete loops, add a new method

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

20 years agoMove loop optimization passes up, add loop unroller
Chris Lattner [Sun, 18 Apr 2004 05:21:01 +0000 (05:21 +0000)]
Move loop optimization passes up, add loop unroller

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

20 years agoAdd prototype
Chris Lattner [Sun, 18 Apr 2004 05:20:32 +0000 (05:20 +0000)]
Add prototype

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

20 years agoInitial checkin of a simple loop unroller. This pass is extremely basic and
Chris Lattner [Sun, 18 Apr 2004 05:20:17 +0000 (05:20 +0000)]
Initial checkin of a simple loop unroller.  This pass is extremely basic and
limited.  Even in it's extremely simple state (it can only *fully* unroll single
basic block loops that execute a constant number of times), it already helps improve
performance a LOT on some benchmarks, particularly with the native code generators.

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

20 years agoMake the tail duplication threshold accessible from the command line instead of hardcoded
Chris Lattner [Sun, 18 Apr 2004 00:52:43 +0000 (00:52 +0000)]
Make the tail duplication threshold accessible from the command line instead of hardcoded

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

20 years agoFix a memory leak. We leaked the vector holding the entries in switch tables.
Chris Lattner [Sat, 17 Apr 2004 23:49:15 +0000 (23:49 +0000)]
Fix a memory leak.  We leaked the vector holding the entries in switch tables.

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

20 years agoNew testcase
Chris Lattner [Sat, 17 Apr 2004 23:00:51 +0000 (23:00 +0000)]
New testcase

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

20 years agoAdd the ability to compute exit values for complex loop using unanalyzable
Chris Lattner [Sat, 17 Apr 2004 22:58:41 +0000 (22:58 +0000)]
Add the ability to compute exit values for complex loop using unanalyzable
operations.  This allows us to compile this testcase:

int main() {
        int h = 1;
         do h = 3 * h + 1; while (h <= 256);
        printf("%d\n", h);
        return 0;
}

into this:

int %main() {
entry:
        call void %__main( )
        %tmp.6 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]*  %.str_1, long 0, long 0), int 364 )        ; <int> [#uses=0]
        ret int 0
}

This testcase was taken directly from 256.bzip2, believe it or not.

This code is not as general as I would like.  Next up is to refactor it
a bit to handle more cases.

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

20 years agoIf the loop executes a constant number of times, try a bit harder to replace
Chris Lattner [Sat, 17 Apr 2004 18:44:09 +0000 (18:44 +0000)]
If the loop executes a constant number of times, try a bit harder to replace
exit values.

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

20 years agoAdd the ability to compute trip counts that are only controlled by constants
Chris Lattner [Sat, 17 Apr 2004 18:36:24 +0000 (18:36 +0000)]
Add the ability to compute trip counts that are only controlled by constants
even if the loop is using expressions that we can't compute as a closed-form.
This allows us to calculate that this function always returns 55:

int test() {
  double X;
  int Count = 0;
  for (X = 100; X > 1; X = sqrt(X), ++Count)
    /*empty*/;
  return Count;
}

And allows us to compute trip counts for loops like:

        int h = 1;
         do h = 3 * h + 1; while (h <= 256);

(which occurs in bzip2), and for this function, which occurs after inlining
and other optimizations:

int popcount()
{
   int x = 666;
  int result = 0;
  while (x != 0) {
    result = result + (x & 0x1);
    x = x >> 1;
  }
  return result;
}

We still cannot compute the exit values of result or h in the two loops above,
which means we cannot delete the loop, but we are getting closer.  Being able to
compute a constant trip count for these two loops will allow us to unroll them
completely though.

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

20 years agoFix a HUGE pessimization on X86. The indvars pass was taking this
Chris Lattner [Sat, 17 Apr 2004 18:16:10 +0000 (18:16 +0000)]
Fix a HUGE pessimization on X86.  The indvars pass was taking this
(familiar) function:

int _strlen(const char *str) {
    int len = 0;
    while (*str++) len++;
    return len;
}

And transforming it to use a ulong induction variable, because the type of
the pointer index was left as a constant long.  This is obviously very bad.

The fix is to shrink long constants in getelementptr instructions to intptr_t,
making the indvars pass insert a uint induction variable, which is much more
efficient.

Here's the before code for this function:

int %_strlen(sbyte* %str) {
entry:
        %tmp.13 = load sbyte* %str              ; <sbyte> [#uses=1]
        %tmp.24 = seteq sbyte %tmp.13, 0                ; <bool> [#uses=1]
        br bool %tmp.24, label %loopexit, label %no_exit

no_exit:                ; preds = %entry, %no_exit
***     %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=2]
***     %indvar = phi ulong [ %indvar.next, %no_exit ], [ 0, %entry ]           ; <ulong> [#uses=2]
        %indvar1 = cast ulong %indvar to uint           ; <uint> [#uses=1]
        %inc.02.sum = add uint %indvar1, 1              ; <uint> [#uses=1]
        %inc.0.0 = getelementptr sbyte* %str, uint %inc.02.sum          ; <sbyte*> [#uses=1]
        %tmp.1 = load sbyte* %inc.0.0           ; <sbyte> [#uses=1]
        %tmp.2 = seteq sbyte %tmp.1, 0          ; <bool> [#uses=1]
        %indvar.next = add ulong %indvar, 1             ; <ulong> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.2, label %loopexit.loopexit, label %no_exit

loopexit.loopexit:              ; preds = %no_exit
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %inc.1 = add int %indvar, 1             ; <int> [#uses=1]
        ret int %inc.1

loopexit:               ; preds = %entry
        ret int 0
}

Here's the after code:

int %_strlen(sbyte* %str) {
entry:
        %inc.02 = getelementptr sbyte* %str, uint 1             ; <sbyte*> [#uses=1]
        %tmp.13 = load sbyte* %str              ; <sbyte> [#uses=1]
        %tmp.24 = seteq sbyte %tmp.13, 0                ; <bool> [#uses=1]
        br bool %tmp.24, label %loopexit, label %no_exit

no_exit:                ; preds = %entry, %no_exit
***     %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=3]
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %inc.0.0 = getelementptr sbyte* %inc.02, uint %indvar           ; <sbyte*> [#uses=1]
        %inc.1 = add int %indvar, 1             ; <int> [#uses=1]
        %tmp.1 = load sbyte* %inc.0.0           ; <sbyte> [#uses=1]
        %tmp.2 = seteq sbyte %tmp.1, 0          ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.2, label %loopexit, label %no_exit

loopexit:               ; preds = %entry, %no_exit
        %len.0.1 = phi int [ 0, %entry ], [ %inc.1, %no_exit ]          ; <int> [#uses=1]
        ret int %len.0.1
}

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

20 years agoEven if there are not any induction variables in the loop, if we can compute
Chris Lattner [Sat, 17 Apr 2004 18:08:33 +0000 (18:08 +0000)]
Even if there are not any induction variables in the loop, if we can compute
the trip count for the loop, insert one so that we can canonicalize the exit
condition.

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

20 years agoAdd support for evaluation of exp/log/log10/pow
Chris Lattner [Fri, 16 Apr 2004 22:35:33 +0000 (22:35 +0000)]
Add support for evaluation of exp/log/log10/pow

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

20 years agoFix some really nasty dominance bugs that were exposed by my patch to
Chris Lattner [Fri, 16 Apr 2004 18:08:07 +0000 (18:08 +0000)]
Fix some really nasty dominance bugs that were exposed by my patch to
make the verifier more strict.  This fixes building zlib

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

20 years agoFix retriving parent Function.
Misha Brukman [Fri, 16 Apr 2004 17:37:12 +0000 (17:37 +0000)]
Fix retriving parent Function.

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

20 years agoFit comment into 80 cols.
Misha Brukman [Fri, 16 Apr 2004 17:13:52 +0000 (17:13 +0000)]
Fit comment into 80 cols.

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

20 years agoRegenerated using autoconf-2.57.
Brian Gaeke [Fri, 16 Apr 2004 17:13:44 +0000 (17:13 +0000)]
Regenerated using autoconf-2.57.

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

20 years agoRefactor external benchmark checking stuff into one hairy
Brian Gaeke [Fri, 16 Apr 2004 17:13:33 +0000 (17:13 +0000)]
Refactor external benchmark checking stuff into one hairy
macro-to-bind-them-all, called EXTERNAL_BENCHMARK().

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

20 years agoAdd idea about a disassembler.
Misha Brukman [Fri, 16 Apr 2004 16:55:30 +0000 (16:55 +0000)]
Add idea about a disassembler.

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

20 years agoSwitch to including <iostream> for compatibility with gcc-3.0.x (Debian).
Brian Gaeke [Fri, 16 Apr 2004 16:28:33 +0000 (16:28 +0000)]
Switch to including <iostream> for compatibility with gcc-3.0.x (Debian).

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

20 years ago* Fix capitalization of PICk
Misha Brukman [Fri, 16 Apr 2004 16:20:07 +0000 (16:20 +0000)]
* Fix capitalization of PICk
* Wrap long lines to 80 cols

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

20 years agoInclude <cmath> for compatibility with gcc 3.0.x (the system compiler on
Brian Gaeke [Fri, 16 Apr 2004 15:57:32 +0000 (15:57 +0000)]
Include <cmath> for compatibility with gcc 3.0.x (the system compiler on
Debian.)

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

20 years agoInclude <string> for compatibility with gcc 3.0.x (the system compiler on
Brian Gaeke [Fri, 16 Apr 2004 15:57:14 +0000 (15:57 +0000)]
Include <string> for compatibility with gcc 3.0.x (the system compiler on
Debian.)

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

20 years agoAs a part of the bootstrapping process, the top-level tools-only target
Brian Gaeke [Fri, 16 Apr 2004 15:57:02 +0000 (15:57 +0000)]
As a part of the bootstrapping process, the top-level tools-only target
should not build projects.

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

20 years agoAssert if deleting BasicBlock before removing it from Function.
Misha Brukman [Fri, 16 Apr 2004 15:47:21 +0000 (15:47 +0000)]
Assert if deleting BasicBlock before removing it from Function.

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

20 years agoAssert if Instruction is being deleted before being removed from BasicBlock.
Misha Brukman [Fri, 16 Apr 2004 15:46:43 +0000 (15:46 +0000)]
Assert if Instruction is being deleted before being removed from BasicBlock.

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

20 years agoRemove libraries that have no reason to be here, and keep breaking the nightly tester...
Chris Lattner [Fri, 16 Apr 2004 14:12:36 +0000 (14:12 +0000)]
Remove libraries that have no reason to be here, and keep breaking the nightly tester because their makefiles do not have the right dependencies!!

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

20 years agoFix some of the strange CBE-only failures that happened last night.
Chris Lattner [Fri, 16 Apr 2004 06:03:17 +0000 (06:03 +0000)]
Fix some of the strange CBE-only failures that happened last night.

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

20 years agoMake sure to check for a very bad class of errors: an instruction
Chris Lattner [Fri, 16 Apr 2004 05:51:47 +0000 (05:51 +0000)]
Make sure to check for a very bad class of errors: an instruction
that does not dominate all of its users, but is in the same basic block as
its users.  This class of error is what caused the mysterious CBE only
failures last night.

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

20 years agoBugpoint was not correctly capturing stderr! This caused it to "find" bugs
Chris Lattner [Fri, 16 Apr 2004 05:35:58 +0000 (05:35 +0000)]
Bugpoint was not correctly capturing stderr!  This caused it to "find" bugs
that didn't exist, missing the ones that do :(

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

20 years agoFix Inline/2004-04-15-InlineDeletesCall.ll
Chris Lattner [Fri, 16 Apr 2004 05:17:59 +0000 (05:17 +0000)]
Fix Inline/2004-04-15-InlineDeletesCall.ll

Basically we were using SimplifyCFG as a huge sledgehammer for a simple
optimization.  Because simplifycfg does so many things, we can't use it
for this purpose.

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

20 years agoAdd note about easier way to debug tests in the llvm tree.
Misha Brukman [Thu, 15 Apr 2004 21:01:21 +0000 (21:01 +0000)]
Add note about easier way to debug tests in the llvm tree.

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

20 years agoAdd note about passing arguments to program being debugged.
Misha Brukman [Thu, 15 Apr 2004 20:49:32 +0000 (20:49 +0000)]
Add note about passing arguments to program being debugged.

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

20 years agoNew testcase that Brian provided which crashes the inliner
Chris Lattner [Thu, 15 Apr 2004 20:45:45 +0000 (20:45 +0000)]
New testcase that Brian provided which crashes the inliner

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

20 years agoFix a bug in the previous checkin: if the exit block is not the same as
Chris Lattner [Thu, 15 Apr 2004 20:26:22 +0000 (20:26 +0000)]
Fix a bug in the previous checkin: if the exit block is not the same as
the back-edge block, we must check the preincremented value.

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

20 years agoGive SparcV9CodeEmitter a head-of-file comment and a PassName.
Brian Gaeke [Thu, 15 Apr 2004 20:23:13 +0000 (20:23 +0000)]
Give SparcV9CodeEmitter a head-of-file comment and a PassName.

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

20 years agoIf we're going to use tabs, use them consistently. Maybe doxygen will find the
Misha Brukman [Thu, 15 Apr 2004 15:38:48 +0000 (15:38 +0000)]
If we're going to use tabs, use them consistently. Maybe doxygen will find the
@parameter line documentation that way, too.

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

20 years agoRemoved obsolete doxygen options (they were blank anyway).
Misha Brukman [Thu, 15 Apr 2004 15:33:49 +0000 (15:33 +0000)]
Removed obsolete doxygen options (they were blank anyway).

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

20 years agoThe "best" of both worlds: readable C++ comments and valid HTML For doxygen.
Misha Brukman [Thu, 15 Apr 2004 15:30:15 +0000 (15:30 +0000)]
The "best" of both worlds: readable C++ comments and valid HTML For doxygen.

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

20 years agoDon't use invalid HTML in doxygen comments.
Misha Brukman [Thu, 15 Apr 2004 15:24:55 +0000 (15:24 +0000)]
Don't use invalid HTML in doxygen comments.

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

20 years agoDon't use invalid HTML in a doxygen comment.
Misha Brukman [Thu, 15 Apr 2004 15:23:45 +0000 (15:23 +0000)]
Don't use invalid HTML in a doxygen comment.

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

20 years agoChange the canonical induction variable that we insert.
Chris Lattner [Thu, 15 Apr 2004 15:21:43 +0000 (15:21 +0000)]
Change the canonical induction variable that we insert.
Instead of producing code like this:

Loop:
  X = phi 0, X2
  ...

  X2 = X + 1
  if (X != N-1) goto Loop

We now generate code that looks like this:

Loop:
  X = phi 0, X2
  ...

  X2 = X + 1
  if (X2 != N) goto Loop

This has two big advantages:
  1. The trip count of the loop is now explicit in the code, allowing
     the direct implementation of Loop::getTripCount()
  2. This reduces register pressure in the loop, and allows X and X2 to be
     put into the same register.

As a consequence of the second point, the code we generate for loops went
from:

.LBB2:  # no_exit.1
...
        mov %EDI, %ESI
        inc %EDI
        cmp %ESI, 2
        mov %ESI, %EDI
        jne .LBB2 # PC rel: no_exit.1

To:

.LBB2:  # no_exit.1
...
        inc %ESI
        cmp %ESI, 3
        jne .LBB2 # PC rel: no_exit.1

... which has two fewer moves, and uses one less register.

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

20 years agoadd some helpful methods. Rearrange #includes to proper order
Chris Lattner [Thu, 15 Apr 2004 15:16:02 +0000 (15:16 +0000)]
add some helpful methods.  Rearrange #includes to proper order

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

20 years agoAdd some helpful methods
Chris Lattner [Thu, 15 Apr 2004 15:15:40 +0000 (15:15 +0000)]
Add some helpful methods

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

20 years agoFactor a bunch of classes out into a public header
Chris Lattner [Thu, 15 Apr 2004 15:07:24 +0000 (15:07 +0000)]
Factor a bunch of classes out into a public header

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

20 years agoPublically export all of these classes from the ScalarEvolutions.cpp file
Chris Lattner [Thu, 15 Apr 2004 15:06:59 +0000 (15:06 +0000)]
Publically export all of these classes from the ScalarEvolutions.cpp file

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

20 years agoUnbreak the build
Chris Lattner [Thu, 15 Apr 2004 14:17:43 +0000 (14:17 +0000)]
Unbreak the build

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

20 years agoImplement a FIXME: if we're going to insert a cast, we might as well only
Chris Lattner [Wed, 14 Apr 2004 22:01:22 +0000 (22:01 +0000)]
Implement a FIXME: if we're going to insert a cast, we might as well only
insert it once!

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

20 years agoRemove code to adjust the iterator for llvm.readio and llvm.writeio.
John Criswell [Wed, 14 Apr 2004 21:27:56 +0000 (21:27 +0000)]
Remove code to adjust the iterator for llvm.readio and llvm.writeio.
The iterator is pointing at the next instruction which should not disappear
when doing the load/store replacement.

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

20 years agoFix typo.
Brian Gaeke [Wed, 14 Apr 2004 21:21:56 +0000 (21:21 +0000)]
Fix typo.

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

20 years agoThis is a trivial tweak to the addrec insertion code: insert the increment
Chris Lattner [Wed, 14 Apr 2004 21:11:25 +0000 (21:11 +0000)]
This is a trivial tweak to the addrec insertion code: insert the increment
at the bottom of the loop instead of the top.  This reduces the number of
overlapping live ranges a lot, for example, eliminating a spill in an important
loop in 183.equake with linear scan.

I still need to make the exit comparison of the loop use the post-incremented
version of this variable, but this is an easy first step.

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

20 years agoAdd a TargetData to the PassManager regardless of the TargetMachine.
Brian Gaeke [Wed, 14 Apr 2004 17:45:52 +0000 (17:45 +0000)]
Add a TargetData to the PassManager regardless of the TargetMachine.
This should unbreak the Sparc JIT again.

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

20 years agoAdd a copy constructor for TargetData.
Brian Gaeke [Wed, 14 Apr 2004 17:45:48 +0000 (17:45 +0000)]
Add a copy constructor for TargetData.

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

20 years agoWe are now on LLVM 1.3
Chris Lattner [Wed, 14 Apr 2004 16:32:34 +0000 (16:32 +0000)]
We are now on LLVM 1.3
Make autoconf default to checking to look to see if our funny directory exists

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

20 years agoRegenerated
Chris Lattner [Wed, 14 Apr 2004 16:32:09 +0000 (16:32 +0000)]
Regenerated

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

20 years agoRemove the return type check for llvm.readio. This check is done for all
John Criswell [Wed, 14 Apr 2004 15:06:48 +0000 (15:06 +0000)]
Remove the return type check for llvm.readio.  This check is done for all
functions and is not needed here.
Simplify the pointer type check per Chris's suggestions.

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

20 years agoAdded code to verify that llvm.readio's pointer argument returns something
John Criswell [Wed, 14 Apr 2004 14:49:36 +0000 (14:49 +0000)]
Added code to verify that llvm.readio's pointer argument returns something
that matches its return type.

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

20 years agoTest for memory mapped I/O intrinsics.
John Criswell [Wed, 14 Apr 2004 13:52:56 +0000 (13:52 +0000)]
Test for memory mapped I/O intrinsics.

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

20 years agoFinish adding the llvm.readio and llvm.writeio intrinsics.
John Criswell [Wed, 14 Apr 2004 13:46:52 +0000 (13:46 +0000)]
Finish adding the llvm.readio and llvm.writeio intrinsics.
Sorry these didn't get in yesterday.

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

20 years agoADd a trivial instcombine: load null -> null
Chris Lattner [Wed, 14 Apr 2004 03:28:36 +0000 (03:28 +0000)]
ADd a trivial instcombine: load null -> null

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

20 years agoThis is the real fix for Codegen/X86/2004-04-13-FPCMOV-Crash.llx which works
Chris Lattner [Wed, 14 Apr 2004 02:42:32 +0000 (02:42 +0000)]
This is the real fix for Codegen/X86/2004-04-13-FPCMOV-Crash.llx which works
even when the "optimization" I added before is turned off.  It generates this
extremely pointless code:

test:
        fld QWORD PTR [%ESP + 4]
        mov %AL, 0
        test %AL, %AL
        fcmove %ST(0), %ST(0)
        ret

Good thing the optimizer will have removed this before code generation
anyway.  :)

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

20 years agoTemporarily hack in the intrinsics that John added. I expect him to finish up their...
Chris Lattner [Wed, 14 Apr 2004 02:22:54 +0000 (02:22 +0000)]
Temporarily hack in the intrinsics that John added.  I expect him to finish up their addition, but in the meantime, the build should not be broken.

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

20 years agoAdded support for the llvm.readio and llvm.writeio intrinsics.
John Criswell [Tue, 13 Apr 2004 22:13:14 +0000 (22:13 +0000)]
Added support for the llvm.readio and llvm.writeio intrinsics.
On x86, memory operations occur in-order, so these are just lowered into
volatile loads and stores.

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

20 years agoImplement a small optimization, which papers over the problem in
Chris Lattner [Tue, 13 Apr 2004 21:56:09 +0000 (21:56 +0000)]
Implement a small optimization, which papers over the problem in
X86/2004-04-13-FPCMOV-Crash.llx

A more robust fix is to follow.

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

20 years agoFix bug, add support for +/-
Chris Lattner [Tue, 13 Apr 2004 21:48:43 +0000 (21:48 +0000)]
Fix bug, add support for +/-

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

20 years agonew testcase that crashes the fp stackifier
Chris Lattner [Tue, 13 Apr 2004 21:44:54 +0000 (21:44 +0000)]
new testcase that crashes the fp stackifier

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

20 years agoWe actually don't have spiff anymore
Chris Lattner [Tue, 13 Apr 2004 20:59:47 +0000 (20:59 +0000)]
We actually don't have spiff anymore

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

20 years agoOut with spiff, in with fpcmp
Chris Lattner [Tue, 13 Apr 2004 20:59:24 +0000 (20:59 +0000)]
Out with spiff, in with fpcmp

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

20 years agoRemove spiff. Though it looked good, it was not really as spiffy as it seemed
Chris Lattner [Tue, 13 Apr 2004 20:58:42 +0000 (20:58 +0000)]
Remove spiff.  Though it looked good, it was not really as spiffy as it seemed

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

20 years agoOkay, spiff is completely incapable of handling files of nontrivial size.
Chris Lattner [Tue, 13 Apr 2004 20:55:49 +0000 (20:55 +0000)]
Okay, spiff is completely incapable of handling files of nontrivial size.
Here is a simple minimal program that does what we want.  Instead of taking
minutes to compare mesa's output, and crashing on binary files (like spiff
does), this take < .02s in the common case and doesn't crash.

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

20 years agoAdd a note
Chris Lattner [Tue, 13 Apr 2004 19:48:55 +0000 (19:48 +0000)]
Add a note

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

20 years agoAdd SCCP support for constant folding calls, implementing:
Chris Lattner [Tue, 13 Apr 2004 19:43:54 +0000 (19:43 +0000)]
Add SCCP support for constant folding calls, implementing:
test/Regression/Transforms/SCCP/calltest.ll

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

20 years agoNew testcase
Chris Lattner [Tue, 13 Apr 2004 19:43:33 +0000 (19:43 +0000)]
New testcase

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

20 years agoAdd a simple call constant propagation interface.
Chris Lattner [Tue, 13 Apr 2004 19:28:52 +0000 (19:28 +0000)]
Add a simple call constant propagation interface.

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

20 years agoAdd new interfaces
Chris Lattner [Tue, 13 Apr 2004 19:28:32 +0000 (19:28 +0000)]
Add new interfaces

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

20 years agoConstant propagation should remove the dead instructions
Chris Lattner [Tue, 13 Apr 2004 19:28:20 +0000 (19:28 +0000)]
Constant propagation should remove the dead instructions

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

20 years agoNew testcase
Chris Lattner [Tue, 13 Apr 2004 19:28:09 +0000 (19:28 +0000)]
New testcase

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

20 years agoRegenerated using autoconf-2.57.
Brian Gaeke [Tue, 13 Apr 2004 19:03:49 +0000 (19:03 +0000)]
Regenerated using autoconf-2.57.

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

20 years agoRewrite POV-Ray check as per PR301
Brian Gaeke [Tue, 13 Apr 2004 19:02:51 +0000 (19:02 +0000)]
Rewrite POV-Ray check as per PR301

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

20 years agoIncrease buffer size again. *sigh*
Chris Lattner [Tue, 13 Apr 2004 18:43:18 +0000 (18:43 +0000)]
Increase buffer size again. *sigh*

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

20 years agoDon't index spiff. It should not count as lines of LLVM code
Chris Lattner [Tue, 13 Apr 2004 18:37:51 +0000 (18:37 +0000)]
Don't index spiff.  It should not count as lines of LLVM code

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

20 years agoFixed sized limits are bad... duh.
Chris Lattner [Tue, 13 Apr 2004 18:34:16 +0000 (18:34 +0000)]
Fixed sized limits are bad... duh.

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

20 years agoReally spiff, don't chatter :)
Chris Lattner [Tue, 13 Apr 2004 18:33:21 +0000 (18:33 +0000)]
Really spiff, don't chatter :)

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

20 years agoI don't think we have to have 4 extra allocated (but unused) bytes on the stack.
Brian Gaeke [Tue, 13 Apr 2004 18:28:37 +0000 (18:28 +0000)]
I don't think we have to have 4 extra allocated (but unused) bytes on the stack.

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

20 years agoI started working on casts, but I don't have anything compilable yet.
Brian Gaeke [Tue, 13 Apr 2004 18:27:46 +0000 (18:27 +0000)]
I started working on casts, but I don't have anything compilable yet.

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

20 years agoDon't underline diffs
Brian Gaeke [Tue, 13 Apr 2004 18:24:01 +0000 (18:24 +0000)]
Don't underline diffs

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

20 years agoEmit the immediate form of in/out when possible.
Chris Lattner [Tue, 13 Apr 2004 17:20:37 +0000 (17:20 +0000)]
Emit the immediate form of in/out when possible.
Fix several bugs in the intrinsics:
  1. Make sure to copy the input registers before the instructions that use them
  2. Make sure to copy the value returned by 'in' out of EAX into the register
     it is supposed to be in.

This fixes assertions when using in/out and linear scan.

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

20 years agoAdd immediate forms of in/out. Use let to shorten lines
Chris Lattner [Tue, 13 Apr 2004 17:19:31 +0000 (17:19 +0000)]
Add immediate forms of in/out.  Use let to shorten lines

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

20 years agoAdd support for new instruction type
Chris Lattner [Tue, 13 Apr 2004 17:18:51 +0000 (17:18 +0000)]
Add support for new instruction type

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

20 years agoAdd support for the printImplicitDefsBefore flag
Chris Lattner [Tue, 13 Apr 2004 17:18:39 +0000 (17:18 +0000)]
Add support for the printImplicitDefsBefore flag

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

20 years agoMake the testcase more challenging
Chris Lattner [Tue, 13 Apr 2004 17:18:07 +0000 (17:18 +0000)]
Make the testcase more challenging

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

20 years agoReenable library now that the loopsimplify bug is fixed
Chris Lattner [Tue, 13 Apr 2004 16:24:53 +0000 (16:24 +0000)]
Reenable library now that the loopsimplify bug is fixed

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

20 years agoFix LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll
Chris Lattner [Tue, 13 Apr 2004 16:23:25 +0000 (16:23 +0000)]
Fix LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll

LoopSimplify was not updating dominator frontiers correctly in some cases.

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

20 years agoNew testcase where loop simplify is not updating domfrontiers correctly
Chris Lattner [Tue, 13 Apr 2004 16:22:04 +0000 (16:22 +0000)]
New testcase where loop simplify is not updating domfrontiers correctly

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