oota-llvm.git
19 years agoRewrite emitCastOperation, refactoring parts of it into emitIntegerCast, and
Brian Gaeke [Thu, 14 Oct 2004 19:39:34 +0000 (19:39 +0000)]
Rewrite emitCastOperation, refactoring parts of it into emitIntegerCast, and
adding emitFPToIntegerCast.

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

19 years agoAdd list of libc procedures we'll use, at some point.
Brian Gaeke [Thu, 14 Oct 2004 19:39:33 +0000 (19:39 +0000)]
Add list of libc procedures we'll use, at some point.
Update list of currently failing tests.
ADJCALLSTACK* support is done.

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

19 years agoUse the shared Makefile.JIT for JIT-enablement, which also enables the examples
Misha Brukman [Thu, 14 Oct 2004 19:02:13 +0000 (19:02 +0000)]
Use the shared Makefile.JIT for JIT-enablement, which also enables the examples
to have the JIT functioning on more platforms than just x86

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

19 years agoUse the shared Makefile.JIT for JIT-enablement
Misha Brukman [Thu, 14 Oct 2004 19:01:25 +0000 (19:01 +0000)]
Use the shared Makefile.JIT for JIT-enablement

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

19 years agoAdd Makefile.JIT to the list of Makefiles transferred to the build dir to give
Misha Brukman [Thu, 14 Oct 2004 18:59:42 +0000 (18:59 +0000)]
Add Makefile.JIT to the list of Makefiles transferred to the build dir to give
tools and examples a simple way to JIT-enable themselves

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

19 years agoTransfer Makefile.JIT into the build tree for JIT-enabling tools and examples
Misha Brukman [Thu, 14 Oct 2004 18:59:09 +0000 (18:59 +0000)]
Transfer Makefile.JIT into the build tree for JIT-enabling tools and examples

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

19 years agoSince several tools and examples want JIT support, factor out the process of
Misha Brukman [Thu, 14 Oct 2004 18:58:19 +0000 (18:58 +0000)]
Since several tools and examples want JIT support, factor out the process of
adding the right libs for any given architecture's JIT into a single place

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

19 years agoConvert tabs to spaces
Misha Brukman [Thu, 14 Oct 2004 18:47:56 +0000 (18:47 +0000)]
Convert tabs to spaces

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

19 years agoMake sure any client of Dominators.h links in Dominators.cpp
Chris Lattner [Thu, 14 Oct 2004 15:47:16 +0000 (15:47 +0000)]
Make sure any client of Dominators.h links in Dominators.cpp
Patch by Morten Ofstad

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

19 years agoMake sure any client of Dominators.h links in Dominators.cpp
Chris Lattner [Thu, 14 Oct 2004 15:46:59 +0000 (15:46 +0000)]
Make sure any client of Dominators.h links in Dominators.cpp

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

19 years agoDo not use the same variable name for two different variables in the
Chris Lattner [Thu, 14 Oct 2004 14:59:16 +0000 (14:59 +0000)]
Do not use the same variable name for two different variables in the
same scope.  This confused VC++ (and probably people too!).  Patch by
Morten Ofstad!

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

19 years agoRemove unneeded typedef, patch by Morten Ofstad
Chris Lattner [Thu, 14 Oct 2004 14:51:09 +0000 (14:51 +0000)]
Remove unneeded typedef, patch by Morten Ofstad

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

19 years ago* Claim to support machine code emission - return false from
Misha Brukman [Thu, 14 Oct 2004 06:39:56 +0000 (06:39 +0000)]
* Claim to support machine code emission - return false from
  addPassesToEmitMachineCode()
* Add support for registers and constants in getMachineOpValue()

This enables running "int main() { ret 0 }" via the PowerPC JIT.

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

19 years agoEnable the PowerPC JIT by compiling powerpc.o library into lli
Misha Brukman [Thu, 14 Oct 2004 06:35:11 +0000 (06:35 +0000)]
Enable the PowerPC JIT by compiling powerpc.o library into lli

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

19 years ago* Include the real (generated) version of getBinaryCodeForInstr()
Misha Brukman [Thu, 14 Oct 2004 06:07:25 +0000 (06:07 +0000)]
* Include the real (generated) version of getBinaryCodeForInstr()
* Add implementation of getMachineOpValue() for generated code emitter
* Convert assert()s in unimplemented functions to abort()s so that non-debug
  builds fail predictably
* Add file header comments

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

19 years ago* Make a PPC32-specific code emitter because we have separate classes for 32-
Misha Brukman [Thu, 14 Oct 2004 06:04:56 +0000 (06:04 +0000)]
* Make a PPC32-specific code emitter because we have separate classes for 32-
  and 64-bit code emitters that cannot share code unless we use virtual
  functions
* Identify components being built by tablegen with more detail by assigning them
  to PowerPC, PPC32, or PPC64 more specifically; also avoids seeing 'building
  PowerPC XYZ' messages twice, where one is for PPC32 and one for PPC64

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

19 years agoChecking in code that works on my simple test case. However, there is still a bug...
Tanya Lattner [Thu, 14 Oct 2004 06:04:28 +0000 (06:04 +0000)]
Checking in code that works on my simple test case. However, there is still a bug with branches that I need to fix.

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

19 years agoThere is only one field in an instruction, and that is `Inst', the final view of
Misha Brukman [Thu, 14 Oct 2004 05:55:37 +0000 (05:55 +0000)]
There is only one field in an instruction, and that is `Inst', the final view of
the instruction binary format, all others are simply operands and should not
have the `field' label

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

19 years agoPowerPC instruction definitions use LittleEndian-style encoding [0..31]
Misha Brukman [Thu, 14 Oct 2004 05:54:38 +0000 (05:54 +0000)]
PowerPC instruction definitions use LittleEndian-style encoding [0..31]

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

19 years agoAdd isLittleEndianEncoding to InstrInfo class, defaults to `off'
Misha Brukman [Thu, 14 Oct 2004 05:53:40 +0000 (05:53 +0000)]
Add isLittleEndianEncoding to InstrInfo class, defaults to `off'

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

19 years ago* Factor out (into new fn) a loop emitting operand shifts into the instruction
Misha Brukman [Thu, 14 Oct 2004 05:53:01 +0000 (05:53 +0000)]
* Factor out (into new fn) a loop emitting operand shifts into the instruction
* Reverse instruction bit components for a LittleEndian-style encoding
* Fix some comments and spacing

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

19 years ago* Add option to read isLittleEndianEncoding for InstrInfo classes
Misha Brukman [Thu, 14 Oct 2004 05:50:43 +0000 (05:50 +0000)]
* Add option to read isLittleEndianEncoding for InstrInfo classes
* Doxygen-ify some function comments

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

19 years agoWhen converting phi nodes into select instructions, we shouldn't promote PHI
Chris Lattner [Thu, 14 Oct 2004 05:13:36 +0000 (05:13 +0000)]
When converting phi nodes into select instructions, we shouldn't promote PHI
nodes unless we KNOW that we are able to promote all of them.

This fixes: test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll

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

19 years agoWhen converting phi nodes into select instructions, we shouldn't promote PHI
Chris Lattner [Thu, 14 Oct 2004 05:12:50 +0000 (05:12 +0000)]
When converting phi nodes into select instructions, we shouldn't promote PHI
nodes unless we KNOW that we are able to promote all of them.  In this case
promoting the phi to a select is silly because we will always have to do the
call conditionally.  As such, select promotion is actually a pessimization.

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

19 years agoAllow this file to compile on Darwin.
Reid Spencer [Thu, 14 Oct 2004 03:33:25 +0000 (03:33 +0000)]
Allow this file to compile on Darwin.

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

19 years agoUse __MINGW instead of __MING. Patch contributed by Henrik Bach.
Reid Spencer [Thu, 14 Oct 2004 03:09:02 +0000 (03:09 +0000)]
Use __MINGW instead of __MING. Patch contributed by Henrik Bach.

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

19 years agoGet proper BSD #includes for MappedFile implementation.
Reid Spencer [Thu, 14 Oct 2004 03:06:59 +0000 (03:06 +0000)]
Get proper BSD #includes for MappedFile implementation.

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

19 years agoImplementation of MappedFile for Win32. Patch provided by Jeff Cohen.
Reid Spencer [Thu, 14 Oct 2004 03:05:59 +0000 (03:05 +0000)]
Implementation of MappedFile for Win32. Patch provided by Jeff Cohen.

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

19 years agoToday is not my day. Fix broken #
Chris Lattner [Thu, 14 Oct 2004 02:31:35 +0000 (02:31 +0000)]
Today is not my day.  Fix broken #

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

19 years agounbreak previous checkin :(
Chris Lattner [Thu, 14 Oct 2004 02:06:48 +0000 (02:06 +0000)]
unbreak previous checkin :(

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

19 years agoAdd back a missing paren
Chris Lattner [Thu, 14 Oct 2004 01:57:28 +0000 (01:57 +0000)]
Add back a missing paren

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

19 years agoFit to 80 cols
Chris Lattner [Thu, 14 Oct 2004 01:49:34 +0000 (01:49 +0000)]
Fit to 80 cols

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

19 years agoWrap to 80 cols, delete some seriously old debugging printouts
Chris Lattner [Thu, 14 Oct 2004 01:46:07 +0000 (01:46 +0000)]
Wrap to 80 cols, delete some seriously old debugging printouts

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

19 years agoFit in 80 columns
Chris Lattner [Thu, 14 Oct 2004 01:39:18 +0000 (01:39 +0000)]
Fit in 80 columns

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

19 years agoMinor cleanups
Chris Lattner [Thu, 14 Oct 2004 01:35:17 +0000 (01:35 +0000)]
Minor cleanups

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

19 years agoPatch to make VS happier, thanks to Morten Ofstad for pointing this out.
Chris Lattner [Wed, 13 Oct 2004 15:25:46 +0000 (15:25 +0000)]
Patch to make VS happier, thanks to Morten Ofstad for pointing this out.

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

19 years agoUse explicit std:: qualification to avoid relying on Koenig lookup, which
Chris Lattner [Wed, 13 Oct 2004 15:11:23 +0000 (15:11 +0000)]
Use explicit std:: qualification to avoid relying on Koenig lookup, which
VC++ does not do properly.  Thanks to Morten Ofstad for the patch!

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

19 years agoGet rid of template templates that were preventing VC from compiling the
Chris Lattner [Wed, 13 Oct 2004 15:09:21 +0000 (15:09 +0000)]
Get rid of template templates that were preventing VC from compiling the
set_intersect template.  Thanks to Morten Ofstad and Jeff Cohen for the
patch!

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

19 years agoChanges for automake.
Reid Spencer [Wed, 13 Oct 2004 11:56:07 +0000 (11:56 +0000)]
Changes for automake.

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

19 years agoSet up BUILD_MODE based on the configuration so the default build mode
Reid Spencer [Wed, 13 Oct 2004 11:53:12 +0000 (11:53 +0000)]
Set up BUILD_MODE based on the configuration so the default build mode
is established from configuration. Also, don't make the ENABLE_ options
AM_CONDITIONALs.

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

19 years agoUpdates for changes in Makefile rules.
Reid Spencer [Wed, 13 Oct 2004 11:48:50 +0000 (11:48 +0000)]
Updates for changes in Makefile rules.

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

19 years agoUpdate to reflect changes in Makefile rules.
Reid Spencer [Wed, 13 Oct 2004 11:46:52 +0000 (11:46 +0000)]
Update to reflect changes in Makefile rules.

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

19 years agoGet rid of the horrendous FIND_PATH macro, have libs and progs linked into
Reid Spencer [Wed, 13 Oct 2004 11:39:51 +0000 (11:39 +0000)]
Get rid of the horrendous FIND_PATH macro, have libs and progs linked into
a common directory for simplicity. Provide an easy way to relink some
objects

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

19 years agoUpdate doco, make doxygen more, use standard dividers.
Chris Lattner [Wed, 13 Oct 2004 04:44:53 +0000 (04:44 +0000)]
Update doco, make doxygen more, use standard dividers.

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

19 years agoSave Reid's notes from bugzilla on the proper procedure to upgrade libtool
Misha Brukman [Wed, 13 Oct 2004 01:07:55 +0000 (01:07 +0000)]
Save Reid's notes from bugzilla on the proper procedure to upgrade libtool

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

19 years agoResolution to PR451.
Reid Spencer [Wed, 13 Oct 2004 01:01:03 +0000 (01:01 +0000)]
Resolution to PR451.

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

19 years agoChanges for libtool 1.5.10
Reid Spencer [Wed, 13 Oct 2004 00:51:45 +0000 (00:51 +0000)]
Changes for libtool 1.5.10

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

19 years agoUpdate for libtool 1.5.10
Reid Spencer [Wed, 13 Oct 2004 00:19:25 +0000 (00:19 +0000)]
Update for libtool 1.5.10

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

19 years agoHarden the version requirements to the set that actually works after three
Reid Spencer [Wed, 13 Oct 2004 00:18:58 +0000 (00:18 +0000)]
Harden the version requirements to the set that actually works after three
days of trying to figure it out. Despite some developer's penchant for
relaxing the tool versions, this just isn't possible. Only certain versions
work with certain other versions.

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

19 years agoFix file comment header
Misha Brukman [Tue, 12 Oct 2004 21:48:02 +0000 (21:48 +0000)]
Fix file comment header

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

19 years agoOn second thought, OpaqueType is not really a good first-class type.
Misha Brukman [Tue, 12 Oct 2004 20:35:04 +0000 (20:35 +0000)]
On second thought, OpaqueType is not really a good first-class type.

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

19 years agoNo space allowed between \ and end-of-line
Misha Brukman [Tue, 12 Oct 2004 19:17:11 +0000 (19:17 +0000)]
No space allowed between \ and end-of-line

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

19 years agoWrap lines at 80 cols
Misha Brukman [Tue, 12 Oct 2004 18:35:57 +0000 (18:35 +0000)]
Wrap lines at 80 cols

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

19 years agoAdd comment
Chris Lattner [Tue, 12 Oct 2004 17:08:44 +0000 (17:08 +0000)]
Add comment

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

19 years agoOpaque types are considered to be first-class.
Misha Brukman [Tue, 12 Oct 2004 17:06:17 +0000 (17:06 +0000)]
Opaque types are considered to be first-class.

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

19 years agoMinor cleanups:
Chris Lattner [Tue, 12 Oct 2004 16:52:09 +0000 (16:52 +0000)]
Minor cleanups:
 * fit in 80 lines
 * Eliminate extra namespaces
 * Drop llvm::

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

19 years agoDon't emit the method into the llvm namespace, let the #includer decide where it...
Chris Lattner [Tue, 12 Oct 2004 16:21:18 +0000 (16:21 +0000)]
Don't emit the method into the llvm namespace, let the #includer decide where it goes

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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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