oota-llvm.git
20 years agoAdd std:: prefix for compilers without correct koenig lookup implemented.
Chris Lattner [Tue, 12 Oct 2004 16:10:39 +0000 (16:10 +0000)]
Add std:: prefix for compilers without correct koenig lookup implemented.
Patch contributed by Paolo Invernizzi

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

20 years agoTransform memmove -> memcpy when the source is obviously constant memory.
Chris Lattner [Tue, 12 Oct 2004 04:52:52 +0000 (04:52 +0000)]
Transform memmove -> memcpy when the source is obviously constant memory.

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

20 years agoNew testcase for memmove -> memcpy transform
Chris Lattner [Tue, 12 Oct 2004 04:51:55 +0000 (04:51 +0000)]
New testcase for memmove -> memcpy transform

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

20 years agoRight, calls have Operand#0 == the called function, don't forget this.
Chris Lattner [Tue, 12 Oct 2004 04:45:20 +0000 (04:45 +0000)]
Right, calls have Operand#0 == the called function, don't forget this.

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

20 years agoMinor tweaks
Chris Lattner [Tue, 12 Oct 2004 04:32:37 +0000 (04:32 +0000)]
Minor tweaks

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

20 years agoNew header. Classes can be added as needed.
Chris Lattner [Tue, 12 Oct 2004 04:20:46 +0000 (04:20 +0000)]
New header.  Classes can be added as needed.

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

20 years agoImplement a new method
Chris Lattner [Tue, 12 Oct 2004 04:20:25 +0000 (04:20 +0000)]
Implement a new method

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

20 years agoThis nutty patch has been in my tree since before 1.3 went out, and it needs
Chris Lattner [Tue, 12 Oct 2004 01:49:27 +0000 (01:49 +0000)]
This nutty patch has been in my tree since before 1.3 went out, and it needs
to go in.  This patch allows us to compute the trip count of loops controlled
by values loaded from constant arrays.  The cannonnical example of this is
strlen when passed a constant argument:

for (int i = 0; "constantstring"[i]; ++i) ;
return i;

In this case, it will compute that the loop executes 14 times, which means
that the exit value of i is 14.  Because of this, the loop gets DCE'd and
we are happy.  This also applies to anything that does similar things, e.g.
loops like this:

  const float Array[] = { 0.1, 2.1, 3.2, 23.21 };
  for (int i = 0; Array[i] < 20; ++i)

and is actually fairly general.

The problem with this is that it almost never triggers.  The reason is that
we run indvars and the loop optimizer only at compile time, which is before
things like strlen and strcpy have been inlined into the program from libc.
Because of this, it almost never is used (it triggers twice in specint2k).

I'm committing it because it DOES work, may be useful in the future, and
doesn't slow us down at all.  If/when we start running the loop optimizer
at link-time (-O4?) this will be very nice indeed :)

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

20 years agoFix a REALLY obscure bug in my previous checkin, which was splicing the END
Chris Lattner [Tue, 12 Oct 2004 01:02:29 +0000 (01:02 +0000)]
Fix a REALLY obscure bug in my previous checkin, which was splicing the END
marker from one ilist into the middle of another basic block!

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

20 years agoHandle a common case more carefully. In particular, instead of transforming
Chris Lattner [Mon, 11 Oct 2004 23:06:50 +0000 (23:06 +0000)]
Handle a common case more carefully.  In particular, instead of transforming
pointer recurrences into expressions from this:

  %P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ]
  %inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1            ; <sbyte*> [#uses=2]

into this:

  %inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec

Actually create something nice, like this:

  %inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec

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

20 years agoAllow creation of GEP constantexprs with a vector of value* operands as
Chris Lattner [Mon, 11 Oct 2004 22:52:25 +0000 (22:52 +0000)]
Allow creation of GEP constantexprs with a vector of value* operands as
well as a vector of constant*'s.  It turns out that this is more efficient
and all of the clients want to do that, so we should cater to them.

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

20 years agoImplement remove/eraseFromParent methods
Chris Lattner [Mon, 11 Oct 2004 22:21:39 +0000 (22:21 +0000)]
Implement remove/eraseFromParent methods

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

20 years agoAdd long overdue methods
Chris Lattner [Mon, 11 Oct 2004 22:21:13 +0000 (22:21 +0000)]
Add long overdue methods

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

20 years agoMake this build
Chris Lattner [Mon, 11 Oct 2004 20:53:28 +0000 (20:53 +0000)]
Make this build

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

20 years agoReenable the transform, turning X/-10 < 1 into X > -10
Chris Lattner [Mon, 11 Oct 2004 19:40:04 +0000 (19:40 +0000)]
Reenable the transform, turning X/-10 < 1 into X > -10

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

20 years agoFix a warning that is emitted on the suns
Chris Lattner [Mon, 11 Oct 2004 15:50:40 +0000 (15:50 +0000)]
Fix a warning that is emitted on the suns

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

20 years agoThis patch implements two things (sorry).
Chris Lattner [Mon, 11 Oct 2004 05:54:41 +0000 (05:54 +0000)]
This patch implements two things (sorry).

First, it allows SRA of globals that have embedded arrays, implementing
GlobalOpt/globalsra-partial.llx.  This comes up infrequently, but does allow,
for example, deleting several stores to dead parts of globals in dhrystone.

Second, this implements GlobalOpt/malloc-promote-*.llx, which is the
following nifty transformation:

Basically if a global pointer is initialized with malloc, and we can tell
that the program won't notice, we transform this:

struct foo *FooPtr;
...
  FooPtr = malloc(sizeof(struct foo));
...
  FooPtr->A   FooPtr->B

Into:

struct foo FooPtrBody;
...
   FooPtrBody.A  FooPtrBody.B

This comes up occasionally, for example, the 'disp' global in 183.equake (where
the xform speeds the CBE version of the program up from 56.16s to 52.40s (7%)
on apoc), and the 'desired_accept', 'fixLRBT', 'macroArray', & 'key_queue'
globals in 300.twolf (speeding it up from 22.29s to 21.55s (3.4%)).

The nice thing about this xform is that it exposes the resulting global to
global variable optimization and makes alias analysis easier in addition to
eliminating a few loads.

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

20 years agoThis testcase ensures that we can SRA a global even if part of the global
Chris Lattner [Mon, 11 Oct 2004 05:00:30 +0000 (05:00 +0000)]
This testcase ensures that we can SRA a global even if part of the global
cannot be SRA'd

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

20 years agoThese testcases check to see if we can promote malloc's to globals in some
Chris Lattner [Mon, 11 Oct 2004 05:00:12 +0000 (05:00 +0000)]
These testcases check to see if we can promote malloc's to globals in some
cases.

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

20 years agoDon't miss global optimizations because we run before the inliner
Chris Lattner [Mon, 11 Oct 2004 04:47:18 +0000 (04:47 +0000)]
Don't miss global optimizations because we run before the inliner

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

20 years agoFix SingleSource/Benchmarks/McGill/chomp
Chris Lattner [Mon, 11 Oct 2004 04:07:27 +0000 (04:07 +0000)]
Fix SingleSource/Benchmarks/McGill/chomp

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

20 years agoIf we are trying to create a ConstantExpr cast that is really a GEP to the
Chris Lattner [Mon, 11 Oct 2004 03:57:30 +0000 (03:57 +0000)]
If we are trying to create a ConstantExpr cast that is really a GEP to the
first element of an array, return a GEP instead of a cast.  This allows us
to transparently fold this:

int* getelementptr (int* cast ([100 x int]* %Gbody to int*), int 40)

into this:

int* getelementptr ([100 x int]* %Gbody, int 0, int 40)

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

20 years agoFix grammar
Misha Brukman [Mon, 11 Oct 2004 02:06:40 +0000 (02:06 +0000)]
Fix grammar

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

20 years agoRemove exhuberant-style comments which remained from copying file from `sample'
Misha Brukman [Mon, 11 Oct 2004 00:56:41 +0000 (00:56 +0000)]
Remove exhuberant-style comments which remained from copying file from `sample'

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

20 years agoFix file header comment; remove sample project (extra-verbose) comments
Misha Brukman [Mon, 11 Oct 2004 00:55:47 +0000 (00:55 +0000)]
Fix file header comment; remove sample project (extra-verbose) comments

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

20 years agoFix file header comment
Misha Brukman [Mon, 11 Oct 2004 00:54:59 +0000 (00:54 +0000)]
Fix file header comment

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

20 years agoModuloScheduling has moved to lib/Target/SparcV9
Misha Brukman [Sun, 10 Oct 2004 23:37:40 +0000 (23:37 +0000)]
ModuloScheduling has moved to lib/Target/SparcV9

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

20 years agoAdd ModuloScheduling to the recursive build tree
Misha Brukman [Sun, 10 Oct 2004 23:36:09 +0000 (23:36 +0000)]
Add ModuloScheduling to the recursive build tree

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

20 years agoAdjust header file inclusion due to move
Misha Brukman [Sun, 10 Oct 2004 23:34:50 +0000 (23:34 +0000)]
Adjust header file inclusion due to move

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

20 years agoAdjust comment header and paths to refect move
Misha Brukman [Sun, 10 Oct 2004 23:34:36 +0000 (23:34 +0000)]
Adjust comment header and paths to refect move

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

20 years agoModuloScheduling moved to lib/Target/SparcV9 as it is SparcV9-specific
Misha Brukman [Sun, 10 Oct 2004 23:33:20 +0000 (23:33 +0000)]
ModuloScheduling moved to lib/Target/SparcV9 as it is SparcV9-specific

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

20 years agoJust because we cannot completely eliminate all uses of a global, we can
Chris Lattner [Sun, 10 Oct 2004 23:14:11 +0000 (23:14 +0000)]
Just because we cannot completely eliminate all uses of a global, we can
still optimize away all of the indirect calls and loads, etc from it.
This turns code like this:

  if (G != 0)
    G();

into
   if (G != 0)
     ActualCallee();

This triggers a couple of times in gcc and libstdc++.

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

20 years agoAnother testcase. We should be able to devirtualize the call even though
Chris Lattner [Sun, 10 Oct 2004 23:12:33 +0000 (23:12 +0000)]
Another testcase.  We should be able to devirtualize the call even though
we cannot completely eliminate the global.

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

20 years agoReorganize FINDLIBS to make most comment libs searched first.
Reid Spencer [Sun, 10 Oct 2004 22:54:46 +0000 (22:54 +0000)]
Reorganize FINDLIBS to make most comment libs searched first.

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

20 years agoInitial version of automake Makefile.am file.
Reid Spencer [Sun, 10 Oct 2004 22:52:14 +0000 (22:52 +0000)]
Initial version of automake Makefile.am file.

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

20 years agoAdd the new InstrSched directory.
Reid Spencer [Sun, 10 Oct 2004 22:51:03 +0000 (22:51 +0000)]
Add the new InstrSched directory.

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

20 years agoFix named of a library.
Reid Spencer [Sun, 10 Oct 2004 22:50:31 +0000 (22:50 +0000)]
Fix named of a library.

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

20 years agoAdded debug information. Fixed several bugs in the reconstruct loop function.
Tanya Lattner [Sun, 10 Oct 2004 22:44:35 +0000 (22:44 +0000)]
Added debug information. Fixed several bugs in the reconstruct loop function.

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

20 years agoInitial version of automake Makefile.am file.
Reid Spencer [Sun, 10 Oct 2004 22:36:40 +0000 (22:36 +0000)]
Initial version of automake Makefile.am file.

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

20 years agoInitial version of automake Makefile.am file.
Reid Spencer [Sun, 10 Oct 2004 22:20:40 +0000 (22:20 +0000)]
Initial version of automake Makefile.am file.

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

20 years agoBuild both archive and relinked objects
Reid Spencer [Sun, 10 Oct 2004 22:17:39 +0000 (22:17 +0000)]
Build both archive and relinked objects

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

20 years agoDirectory changes
Reid Spencer [Sun, 10 Oct 2004 22:17:02 +0000 (22:17 +0000)]
Directory changes

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

20 years agoA configure script to configure LLVM for compilation with automake
Reid Spencer [Sun, 10 Oct 2004 22:16:50 +0000 (22:16 +0000)]
A configure script to configure LLVM for compilation with automake

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

20 years agoInitial version of common automake Rules for LLVM
Reid Spencer [Sun, 10 Oct 2004 22:16:37 +0000 (22:16 +0000)]
Initial version of common automake Rules for LLVM

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

20 years agoInitial version of automake Makefile.am file.
Reid Spencer [Sun, 10 Oct 2004 22:07:57 +0000 (22:07 +0000)]
Initial version of automake Makefile.am file.

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

20 years agoRemove the InstrSched directory (moved to SparcV9)
Reid Spencer [Sun, 10 Oct 2004 21:19:41 +0000 (21:19 +0000)]
Remove the InstrSched directory (moved to SparcV9)

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

20 years agoDirectory no long exists (moved to Targets/SparcV9).
Reid Spencer [Sun, 10 Oct 2004 21:18:31 +0000 (21:18 +0000)]
Directory no long exists (moved to Targets/SparcV9).

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

20 years agoInitial version of automake Makefile.am file.
Reid Spencer [Sun, 10 Oct 2004 20:43:57 +0000 (20:43 +0000)]
Initial version of automake Makefile.am file.

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

20 years agoFix assertion failure when calling or returning from a function which
Brian Gaeke [Sun, 10 Oct 2004 20:34:17 +0000 (20:34 +0000)]
Fix assertion failure when calling or returning from a function which
returns 'bool' type.

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

20 years agoImplement eliminateCallFramePseudoInstr().
Brian Gaeke [Sun, 10 Oct 2004 19:57:21 +0000 (19:57 +0000)]
Implement eliminateCallFramePseudoInstr().
Wrap a long comment line.

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

20 years agoModel calls as *both* using *and* killing O0..O5, because callees use the
Brian Gaeke [Sun, 10 Oct 2004 19:57:20 +0000 (19:57 +0000)]
Model calls as *both* using *and* killing O0..O5, because callees use the
argument values passed in (so they're not dead until *after* the call),
and callees are free to modify those registers.

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

20 years agoFix whitespace and wrap some long lines.
Brian Gaeke [Sun, 10 Oct 2004 19:57:18 +0000 (19:57 +0000)]
Fix whitespace and wrap some long lines.
Deal with allocating stack space for outgoing args and copying them into the
correct stack slots (at least, we can copy <=32-bit int args).
We now correctly generate ADJCALLSTACK* instructions.

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

20 years agoTop level makefile for building LLVM with automake.
Reid Spencer [Sun, 10 Oct 2004 19:13:03 +0000 (19:13 +0000)]
Top level makefile for building LLVM with automake.

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

20 years agoEnsure timestamp on saved contents of configure.ac is not changed.
Reid Spencer [Sun, 10 Oct 2004 19:09:33 +0000 (19:09 +0000)]
Ensure timestamp on saved contents of configure.ac is not changed.
Use correct options to automake.

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

20 years agoFix 2004-10-10-CastStoreOnce.llx, by adjusting types back if we strip off a cast
Chris Lattner [Sun, 10 Oct 2004 17:07:12 +0000 (17:07 +0000)]
Fix 2004-10-10-CastStoreOnce.llx, by adjusting types back if we strip off a cast

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

20 years agoNew testcase that crashes -globalopt. I found this through inspection, not
Chris Lattner [Sun, 10 Oct 2004 17:06:09 +0000 (17:06 +0000)]
New testcase that crashes -globalopt.  I found this through inspection, not
actually in the wild :)

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

20 years agoImplement GlobalOpt/deadglobal-2.llx, deletion of globals that are only
Chris Lattner [Sun, 10 Oct 2004 16:47:33 +0000 (16:47 +0000)]
Implement GlobalOpt/deadglobal-2.llx, deletion of globals that are only
stored to, but are stored at variable indexes.  This occurs at least in
176.gcc, but probably others, and we should handle it for completeness.

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

20 years agoNew testcase we were not handling before.
Chris Lattner [Sun, 10 Oct 2004 16:46:48 +0000 (16:46 +0000)]
New testcase we were not handling before.

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

20 years agoAvoid calling use_size() which could (in theory) be expensive if the global
Chris Lattner [Sun, 10 Oct 2004 16:43:46 +0000 (16:43 +0000)]
Avoid calling use_size() which could (in theory) be expensive if the global
has a large number of users.  Instead, just keep track of whether we're
making changes as we do so.

This patch has no functionlity changes.

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

20 years agobling bling!
Chris Lattner [Sun, 10 Oct 2004 16:26:13 +0000 (16:26 +0000)]
bling bling!

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

20 years agoA testcase that globalopt now handles
Chris Lattner [Sat, 9 Oct 2004 21:50:05 +0000 (21:50 +0000)]
A testcase that globalopt now handles

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

20 years agoEliminate global pointers that are only stored a single value and null if
Chris Lattner [Sat, 9 Oct 2004 21:48:45 +0000 (21:48 +0000)]
Eliminate global pointers that are only stored a single value and null if
we know that all uses of the global will trap if the pointer contained is
null.  In this case, we forward substitute the stored value to any uses.

This has the effect of devirtualizing trivial globals in trivial cases.  For
example, 164.gzip contains this:

gzip.h:extern   int (*read_buf) OF((char *buf, unsigned size));
bits.c: read_buf  = file_read;
deflate.c:    lookahead = read_buf((char*)window,
deflate.c:        n = read_buf((char*)window+strstart+lookahead, more);

Since read_buf has to point to file_read at every use, we just replace
the calls through read_buf with a direct call to file_read.

This occurs in several benchmarks, including 176.gcc and 164.gzip.  Direct
calls are good and stuff.

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

20 years agoInstead of silently breaking, print notification of why this doesn't work.
Chris Lattner [Sat, 9 Oct 2004 21:13:51 +0000 (21:13 +0000)]
Instead of silently breaking, print notification of why this doesn't work.

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

20 years agoFix grammaro
Chris Lattner [Sat, 9 Oct 2004 19:37:02 +0000 (19:37 +0000)]
Fix grammaro

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

20 years agoUse DEBUG instead of DebugFlag directly, as DebugFlag does not respect
Chris Lattner [Sat, 9 Oct 2004 19:30:36 +0000 (19:30 +0000)]
Use DEBUG instead of DebugFlag directly, as DebugFlag does not respect
-debug-only!

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

20 years agoIt looks like we're not releasing 1.4 with llvm.org as the official domain
Chris Lattner [Sat, 9 Oct 2004 19:19:57 +0000 (19:19 +0000)]
It looks like we're not releasing 1.4 with llvm.org as the official domain

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

20 years agoupdate according to tonight's info
Brian Gaeke [Sat, 9 Oct 2004 05:58:27 +0000 (05:58 +0000)]
update according to tonight's info

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

20 years agoImplement getModuleMatchQuality and getJITMatchQuality so that v8 will be the
Brian Gaeke [Sat, 9 Oct 2004 05:57:01 +0000 (05:57 +0000)]
Implement getModuleMatchQuality and getJITMatchQuality so that v8 will be the
default 32/BE target on sparc hosts, and ppc will continue to be the default
on other hosts.

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

20 years agoFix infinite loop due to iteration
Chris Lattner [Sat, 9 Oct 2004 03:32:52 +0000 (03:32 +0000)]
Fix infinite loop due to iteration

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

20 years agoImplement sub.ll:test17, -X/C -> X/-C
Chris Lattner [Sat, 9 Oct 2004 02:50:40 +0000 (02:50 +0000)]
Implement sub.ll:test17, -X/C -> X/-C

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

20 years agoNew testcase
Chris Lattner [Sat, 9 Oct 2004 02:50:01 +0000 (02:50 +0000)]
New testcase

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

20 years agoAdd a check to avoid an assertion on malformed input
Chris Lattner [Sat, 9 Oct 2004 02:18:58 +0000 (02:18 +0000)]
Add a check to avoid an assertion on malformed input

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

20 years agoThe person who was planning to add SSE support isn't anymore, so disable
Chris Lattner [Fri, 8 Oct 2004 22:41:46 +0000 (22:41 +0000)]
The person who was planning to add SSE support isn't anymore, so disable
the -sse* options (to avoid misleading people).

Also, the stack alignment of the target doesn't depend on whether SSE is
eventually implemented, so remove a comment.

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

20 years agoFix a major regression from the bugfix for 2004-10-08-SelectSetCCFold.llx,
Chris Lattner [Fri, 8 Oct 2004 22:24:31 +0000 (22:24 +0000)]
Fix a major regression from the bugfix for 2004-10-08-SelectSetCCFold.llx,
which prevented setcc's from being folded into branches.  It appears that
conditional branchinst's CC operand is actually operand(2), not operand(0)
as we might expect. :(

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

20 years agoIf we found a dead global, we should at least delete it...
Chris Lattner [Fri, 8 Oct 2004 22:05:31 +0000 (22:05 +0000)]
If we found a dead global, we should at least delete it...

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

20 years ago* Pull out the meat of runOnModule into another function for clarity.
Chris Lattner [Fri, 8 Oct 2004 20:59:28 +0000 (20:59 +0000)]
* Pull out the meat of runOnModule into another function for clarity.
* Do not lead dangling dead constants prevent optimization
* Iterate global optimization while we're making progress.

These changes allow us to be more aggressive, handling cases like
GlobalOpt/iterate.llx without a problem (turning it into 'ret int 0').

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

20 years agoNew testcase
Chris Lattner [Fri, 8 Oct 2004 20:57:46 +0000 (20:57 +0000)]
New testcase

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

20 years agoWe might as well delete the known-dead global sooner rather than later since
Chris Lattner [Fri, 8 Oct 2004 20:25:55 +0000 (20:25 +0000)]
We might as well delete the known-dead global sooner rather than later since
we know it is dead.

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

20 years agoHyphenate target-(in)dependent for more tasty grammar goodness (tm)
Misha Brukman [Fri, 8 Oct 2004 19:43:31 +0000 (19:43 +0000)]
Hyphenate target-(in)dependent for more tasty grammar goodness (tm)

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

20 years agoTemporarily disable a buggy transformation until it can be fixed. This fixes
Chris Lattner [Fri, 8 Oct 2004 19:15:44 +0000 (19:15 +0000)]
Temporarily disable a buggy transformation until it can be fixed.  This fixes
254.gap.

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

20 years agoAdjust paths due to moving InstrSched to lib/Target/SparcV9
Misha Brukman [Fri, 8 Oct 2004 18:30:22 +0000 (18:30 +0000)]
Adjust paths due to moving InstrSched to lib/Target/SparcV9

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

20 years agoUse the SparcV9-marked instr scheduling library
Misha Brukman [Fri, 8 Oct 2004 18:14:56 +0000 (18:14 +0000)]
Use the SparcV9-marked instr scheduling library

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

20 years agoInstrSched has been moved to lib/Target/SparcV9
Misha Brukman [Fri, 8 Oct 2004 18:12:53 +0000 (18:12 +0000)]
InstrSched has been moved to lib/Target/SparcV9

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

20 years agoInstrSched is SparcV9-specific and so has been moved to lib/Target/SparcV9/
Misha Brukman [Fri, 8 Oct 2004 18:12:14 +0000 (18:12 +0000)]
InstrSched is SparcV9-specific and so has been moved to lib/Target/SparcV9/

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

20 years agoSingle-space instead of double-spacing in the Makefile
Misha Brukman [Fri, 8 Oct 2004 18:11:14 +0000 (18:11 +0000)]
Single-space instead of double-spacing in the Makefile

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

20 years agoBuild InstrSched as well, and all three subdirs can be built independently
Misha Brukman [Fri, 8 Oct 2004 18:10:48 +0000 (18:10 +0000)]
Build InstrSched as well, and all three subdirs can be built independently

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

20 years ago* Adjust for the move to lib/Target/SparcV9/InstrSched
Misha Brukman [Fri, 8 Oct 2004 18:10:01 +0000 (18:10 +0000)]
* Adjust for the move to lib/Target/SparcV9/InstrSched
* Rename library to mark it SparcV9-specific

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

20 years agoSingle-space instead of double-spacing in the Makefile
Misha Brukman [Fri, 8 Oct 2004 18:05:25 +0000 (18:05 +0000)]
Single-space instead of double-spacing in the Makefile

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

20 years agoRemove unused variable.
Reid Spencer [Fri, 8 Oct 2004 18:01:31 +0000 (18:01 +0000)]
Remove unused variable.

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

20 years agoMake it so that positional parameters can have spaces in them.
Reid Spencer [Fri, 8 Oct 2004 17:59:29 +0000 (17:59 +0000)]
Make it so that positional parameters can have spaces in them.

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

20 years agoImplement SRA for global variables. This allows the other global variable
Chris Lattner [Fri, 8 Oct 2004 17:32:09 +0000 (17:32 +0000)]
Implement SRA for global variables.  This allows the other global variable
optimizations to trigger much more often.  This allows the elimination of
several dozen more global variables in Programs/External.  Note that we only
do this for non-constant globals: constant globals will already be optimized
out if the accesses to them permit it.

This implements Transforms/GlobalOpt/globalsra.llx

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

20 years agoNew testcase
Chris Lattner [Fri, 8 Oct 2004 17:29:47 +0000 (17:29 +0000)]
New testcase

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

20 years agoFix bug: 2004-10-08-SelectSetCCFold.llx. Normally this is hidden by the
Chris Lattner [Fri, 8 Oct 2004 16:34:13 +0000 (16:34 +0000)]
Fix bug: 2004-10-08-SelectSetCCFold.llx.  Normally this is hidden by the
instcombine xform, which is why we didn't notice it before.

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

20 years agoNew testcase. The setcc is only used by a select, but not as a condition:
Chris Lattner [Fri, 8 Oct 2004 16:33:40 +0000 (16:33 +0000)]
New testcase.  The setcc is only used by a select, but not as a condition:
it cannot be folded in.

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

20 years agoProperly `quote' names, and don't forget to add the ending quote!
Misha Brukman [Fri, 8 Oct 2004 14:59:05 +0000 (14:59 +0000)]
Properly `quote' names, and don't forget to add the ending quote!

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

20 years agoAdd the --with-automake option to AutoRegen.sh and provide the automake
Reid Spencer [Fri, 8 Oct 2004 05:33:35 +0000 (05:33 +0000)]
Add the --with-automake option to AutoRegen.sh and provide the automake
version of the configure script. This is an early commit of the automake
support so that automake support can be tested on multiple platforms. Many
additional Makefile.am need to be added to LLVM before this is of any use.
Please wait until automake support is announced on llvmdev list before
using the --with-automake option.

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

20 years agoInstcombine (X & FF00) + xx00 -> (X+xx00) & FF00, implementing and.ll:test27
Chris Lattner [Fri, 8 Oct 2004 05:07:56 +0000 (05:07 +0000)]
Instcombine (X & FF00) + xx00  -> (X+xx00) & FF00, implementing and.ll:test27

This comes up when doing adds to bitfield elements.

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

20 years agoNew testcase
Chris Lattner [Fri, 8 Oct 2004 05:03:25 +0000 (05:03 +0000)]
New testcase

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

20 years agoLittle patch to turn (shl (add X, 123), 4) -> (add (shl X, 4), 123 << 4)
Chris Lattner [Fri, 8 Oct 2004 03:46:20 +0000 (03:46 +0000)]
Little patch to turn (shl (add X, 123), 4) -> (add (shl X, 4), 123 << 4)

This triggers in cases of bitfield additions, opening opportunities for
future improvements.

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

20 years agoNew testcase
Chris Lattner [Fri, 8 Oct 2004 03:41:59 +0000 (03:41 +0000)]
New testcase

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