oota-llvm.git
18 years agoFor PR786:
Reid Spencer [Thu, 1 Jun 2006 01:55:21 +0000 (01:55 +0000)]
For PR786:
Turn -pedantic and -Wno-long-long compile flags on by default. In a few
places, avoid the warnings by removing these options in the local makefile.
One notable exception: lib/Target/CBackend/Writer.cpp. These warnings are
left on as a reminder to developers to clean them up.

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

18 years agoBuild llvm-config into the ToolDir not in the local directory. This makes
Reid Spencer [Thu, 1 Jun 2006 01:52:49 +0000 (01:52 +0000)]
Build llvm-config into the ToolDir not in the local directory. This makes
it more likely to be in a developer's path and consistent with all the
other tools.

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

18 years agoPut an innocuous statement in this file to quelch warnings about compiling
Reid Spencer [Thu, 1 Jun 2006 01:49:08 +0000 (01:49 +0000)]
Put an innocuous statement in this file to quelch warnings about compiling
an empty file.

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

18 years agoOops, llc needs libTarget.a not Target.o
Reid Spencer [Thu, 1 Jun 2006 01:42:33 +0000 (01:42 +0000)]
Oops, llc needs libTarget.a not Target.o

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

18 years agoUse archive libraries instead of object files for VMCore, BCReader,
Reid Spencer [Thu, 1 Jun 2006 01:30:27 +0000 (01:30 +0000)]
Use archive libraries instead of object files for VMCore, BCReader,
BCWriter, and bzip2 libraries. Adjust the various makefiles to accommodate
these changes. This was done to speed up link times.

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

18 years agoSupport correct build:
Reid Spencer [Thu, 1 Jun 2006 01:09:43 +0000 (01:09 +0000)]
Support correct build:
1. Capture the ENABLE_THREADS configure variable in Makefile.config
2. Use ENABLE_THREADS to avoid building ParallelJIT if threads are not
   present.

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

18 years agoTighten this script up a bit.
Reid Spencer [Thu, 1 Jun 2006 01:08:28 +0000 (01:08 +0000)]
Tighten this script up a bit.

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

18 years agoRemove a warning
Evan Cheng [Thu, 1 Jun 2006 00:30:39 +0000 (00:30 +0000)]
Remove a warning

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

18 years agoRename ASM modifier trunc8, trunc16 to subreg8, subreg16.
Evan Cheng [Wed, 31 May 2006 22:34:26 +0000 (22:34 +0000)]
Rename ASM modifier trunc8, trunc16 to subreg8, subreg16.

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

18 years agoFix casting so there's no warning on Alpha.
Reid Spencer [Wed, 31 May 2006 22:26:11 +0000 (22:26 +0000)]
Fix casting so there's no warning on Alpha.

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

18 years agoAdd my most recent work.
Owen Anderson [Wed, 31 May 2006 22:15:45 +0000 (22:15 +0000)]
Add my most recent work.

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

18 years agoSign extender
Evan Cheng [Wed, 31 May 2006 22:05:11 +0000 (22:05 +0000)]
Sign extender

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

18 years agoSquelch this warning:
Reid Spencer [Wed, 31 May 2006 21:53:42 +0000 (21:53 +0000)]
Squelch this warning:
/bzlib.c:126: warning: string length `1056' is greater than the length `509' ISO
C89 compilers are required to support

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

18 years agoFix utostr once and for all, by making there only be one function named
Chris Lattner [Wed, 31 May 2006 21:25:50 +0000 (21:25 +0000)]
Fix utostr once and for all, by making there only be one function named
utostr.  To keep the efficiency in the 32-bit case, make it check to see if
the value is 32-bits and if so switch over to the faster 32-bit case.

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

18 years agoSwap the order of operands created here. For +&|^, the order doesn't matter,
Chris Lattner [Wed, 31 May 2006 21:14:00 +0000 (21:14 +0000)]
Swap the order of operands created here.  For +&|^, the order doesn't matter,
but for sub, it really does!  Fix fixes a miscompilation of fibheap_cut in
llvmgcc4.

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

18 years agoExtract a huge loop into a helper method. Fix a few iterator-invalidation bugs.
Owen Anderson [Wed, 31 May 2006 20:55:06 +0000 (20:55 +0000)]
Extract a huge loop into a helper method.  Fix a few iterator-invalidation bugs.

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

18 years ago4 billion names is enough for anyone. And really fix the build on alpha this time
Andrew Lenharth [Wed, 31 May 2006 20:40:36 +0000 (20:40 +0000)]
4 billion names is enough for anyone.  And really fix the build on alpha this time

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

18 years agofix utostr
Andrew Lenharth [Wed, 31 May 2006 20:18:56 +0000 (20:18 +0000)]
fix utostr

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

18 years agoFix build breakage on alpha, without causing it on x86. as a bonus, all platforms...
Andrew Lenharth [Wed, 31 May 2006 20:18:28 +0000 (20:18 +0000)]
Fix build breakage on alpha, without causing it on x86.  as a bonus, all platforms can invent the same number of unique names now

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

18 years agorevert for now
Andrew Lenharth [Wed, 31 May 2006 19:16:26 +0000 (19:16 +0000)]
revert for now

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

18 years agoRename instructions for consistency sake.
Evan Cheng [Wed, 31 May 2006 19:00:07 +0000 (19:00 +0000)]
Rename instructions for consistency sake.

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

18 years agomake 64-bit safe and fix the build on alpha
Andrew Lenharth [Wed, 31 May 2006 18:56:42 +0000 (18:56 +0000)]
make 64-bit safe and fix the build on alpha

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

18 years agocommuteInstruction() does not always create a new MI!
Evan Cheng [Wed, 31 May 2006 18:03:39 +0000 (18:03 +0000)]
commuteInstruction() does not always create a new MI!

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

18 years agoAdd a brief description for the tblgen program. More detail is needed but
Reid Spencer [Wed, 31 May 2006 17:54:39 +0000 (17:54 +0000)]
Add a brief description for the tblgen program. More detail is needed but
the current author is not the person to provide it. Now that the file
exists, perhaps others will chime in and embellish.

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

18 years agoUpdate the documentation for llvm2cpp after the -gen-* options were added.
Reid Spencer [Wed, 31 May 2006 17:32:21 +0000 (17:32 +0000)]
Update the documentation for llvm2cpp after the -gen-* options were added.

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

18 years agoMajor reorganization and extension of the code. The diff on this will be a
Reid Spencer [Wed, 31 May 2006 17:31:38 +0000 (17:31 +0000)]
Major reorganization and extension of the code. The diff on this will be a
mess as functions were moved around into a better ordering. The code was
extended to provide various -gen-* options to better control what the
generated output should be. Currently it is possible to generate entire
modules (three different ways), functions, global variables, and types.

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

18 years agoMake the getNamedFunction and getNamedGlobal methods be const. They don't
Reid Spencer [Wed, 31 May 2006 16:40:28 +0000 (16:40 +0000)]
Make the getNamedFunction and getNamedGlobal methods be const. They don't
change the module in any way and we should enforce that.

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

18 years agoClarify type naming.
Vladimir Prus [Wed, 31 May 2006 16:03:20 +0000 (16:03 +0000)]
Clarify type naming.

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

18 years agoImprove InstVisitor docs.
Vladimir Prus [Wed, 31 May 2006 15:30:18 +0000 (15:30 +0000)]
Improve InstVisitor docs.

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

18 years agoEliminate a memory leak.
Evan Cheng [Wed, 31 May 2006 07:13:03 +0000 (07:13 +0000)]
Eliminate a memory leak.

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

18 years agovisitVBinOp: Can't fold divide by zero!
Evan Cheng [Wed, 31 May 2006 06:08:35 +0000 (06:08 +0000)]
visitVBinOp: Can't fold divide by zero!

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

18 years agoDon't generate module definitions when the -fragment option is given.
Reid Spencer [Wed, 31 May 2006 04:43:19 +0000 (04:43 +0000)]
Don't generate module definitions when the -fragment option is given.

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

18 years agoSelect vector_shuffle v1, undef <2, 3, ?, ?> to MOVHLPS.
Evan Cheng [Wed, 31 May 2006 00:51:37 +0000 (00:51 +0000)]
Select vector_shuffle v1, undef <2, 3, ?, ?> to MOVHLPS.

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

18 years agoRemove dead code.
Evan Cheng [Wed, 31 May 2006 00:50:42 +0000 (00:50 +0000)]
Remove dead code.

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

18 years agoUpdate vector extract test cases.
Evan Cheng [Wed, 31 May 2006 00:48:09 +0000 (00:48 +0000)]
Update vector extract test cases.

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

18 years agoA new entry
Evan Cheng [Tue, 30 May 2006 23:56:31 +0000 (23:56 +0000)]
A new entry

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

18 years agoMAXP{D|S} and MINP{D|S} are commutable.
Evan Cheng [Tue, 30 May 2006 23:47:30 +0000 (23:47 +0000)]
MAXP{D|S} and MINP{D|S} are commutable.

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

18 years agoCommute shufps / shufpd.
Evan Cheng [Tue, 30 May 2006 23:34:30 +0000 (23:34 +0000)]
Commute shufps / shufpd.

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

18 years ago1. No need to thwart this test with an environment variable. Turning it off
Reid Spencer [Tue, 30 May 2006 23:07:17 +0000 (23:07 +0000)]
1. No need to thwart this test with an environment variable. Turning it off
   is the default and handled by the makefile system and runtest
2. Redirect stderr of llvm-as and llvm2cpp so that warning messages about
   instrinsics don't cause Tcl to report the run as failed.

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

18 years agoSomehow I lost a condition when I was shuffling some code around. Anyway,
Evan Cheng [Tue, 30 May 2006 22:13:36 +0000 (22:13 +0000)]
Somehow I lost a condition when I was shuffling some code around. Anyway,
only transform a shufps to pshufd when the first two operands are the same.

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

18 years agoFix a build breaker.
Evan Cheng [Tue, 30 May 2006 21:45:53 +0000 (21:45 +0000)]
Fix a build breaker.

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

18 years agoOops. PSHUFD is only available with SSE2.
Evan Cheng [Tue, 30 May 2006 21:30:59 +0000 (21:30 +0000)]
Oops. PSHUFD is only available with SSE2.

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

18 years agoAdd a note
Chris Lattner [Tue, 30 May 2006 21:29:15 +0000 (21:29 +0000)]
Add a note

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

18 years agoAlways reserve space for 8 spilled GPRs. GCC apparently assumes that this
Chris Lattner [Tue, 30 May 2006 21:21:04 +0000 (21:21 +0000)]
Always reserve space for 8 spilled GPRs.  GCC apparently assumes that this
space will be available, even if the callee isn't varargs.

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

18 years agollvm2cpp is ready to be compiled so add it to the makefile, but make it
Reid Spencer [Tue, 30 May 2006 21:20:55 +0000 (21:20 +0000)]
llvm2cpp is ready to be compiled so add it to the makefile, but make it
optional.

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

18 years agoAdd the new command line arguments.
Reid Spencer [Tue, 30 May 2006 21:19:29 +0000 (21:19 +0000)]
Add the new command line arguments.

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

18 years agoFix more bugs. This version now passes all of the Feature test except for
Reid Spencer [Tue, 30 May 2006 21:18:23 +0000 (21:18 +0000)]
Fix more bugs. This version now passes all of the Feature test except for
a floating point conversion problem with NAN in intrinsics.ll. llvm2cpp
makes an attempt to provide the correct conversion, based on the
implementation in the CBackend writer, but it doesn't get NAN correct.

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

18 years agoAdded a test case for parameter passing of vector values.
Evan Cheng [Tue, 30 May 2006 20:37:00 +0000 (20:37 +0000)]
Added a test case for parameter passing of vector values.

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

18 years agoFix the test failure on non-Darwin targets.
Evan Cheng [Tue, 30 May 2006 20:35:46 +0000 (20:35 +0000)]
Fix the test failure on non-Darwin targets.

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

18 years agoAllow shufps x, x, mask to be converted to pshufd x, mask to save a move.
Evan Cheng [Tue, 30 May 2006 20:26:50 +0000 (20:26 +0000)]
Allow shufps x, x, mask to be converted to pshufd x, mask to save a move.

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

18 years agoRemove bogus comment.
Evan Cheng [Tue, 30 May 2006 20:24:48 +0000 (20:24 +0000)]
Remove bogus comment.

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

18 years agoAdd llvm2cpp program.
Reid Spencer [Tue, 30 May 2006 19:56:31 +0000 (19:56 +0000)]
Add llvm2cpp program.

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

18 years agoProvide a simpler interface for getting a ConstantArray from a character
Reid Spencer [Tue, 30 May 2006 18:15:07 +0000 (18:15 +0000)]
Provide a simpler interface for getting a ConstantArray from a character
string. Instead of specifying the length, just specify whether the user
wants a terminating null or not. The default is "true" to retain the same
behavior as previously provided by this function.

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

18 years agoMake sure the register pressure reduction schedulers work for non-uniform
Evan Cheng [Tue, 30 May 2006 18:05:39 +0000 (18:05 +0000)]
Make sure the register pressure reduction schedulers work for non-uniform
latency targets, e.g. PPC32.

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

18 years agoWhen a priority_queue is empty, the behavior of top() operator is
Evan Cheng [Tue, 30 May 2006 18:04:34 +0000 (18:04 +0000)]
When a priority_queue is empty, the behavior of top() operator is
non-deterministic. Returns NULL when it's empty!

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

18 years agoExpand ret into "CopyToReg;BRIND"
Rafael Espindola [Tue, 30 May 2006 17:33:19 +0000 (17:33 +0000)]
Expand ret into "CopyToReg;BRIND"

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

18 years agoEnable -fno-use-cxa-atexit on darwin/ppc also.
Chris Lattner [Tue, 30 May 2006 16:38:06 +0000 (16:38 +0000)]
Enable -fno-use-cxa-atexit on darwin/ppc also.

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

18 years agoUndo a patch that breaks llvm-as because the warning message is written to
Reid Spencer [Tue, 30 May 2006 16:34:59 +0000 (16:34 +0000)]
Undo a patch that breaks llvm-as because the warning message is written to
stdout when the output of llvm-as is also written to stdout. We'll have to
fix tcl some other way.

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

18 years agoWrite the WARNING message to cout instead of cerr. Writing to cerr causes
Reid Spencer [Tue, 30 May 2006 16:05:59 +0000 (16:05 +0000)]
Write the WARNING message to cout instead of cerr. Writing to cerr causes
Tcl to claim that the program had an error and thus produces errors in
the dejagnu testing when its really just a warning.

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

18 years agoMake doc comment visible in doxygen output. Clarify Type construction.
Vladimir Prus [Tue, 30 May 2006 15:49:30 +0000 (15:49 +0000)]
Make doc comment visible in doxygen output. Clarify Type construction.

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

18 years agoFix many small bugs in llvm2cpp. This patch gets llvm2cpp working with
Reid Spencer [Tue, 30 May 2006 10:21:41 +0000 (10:21 +0000)]
Fix many small bugs in llvm2cpp. This patch gets llvm2cpp working with
everything except PHI nodes and one odd recurse/opaque type situation.
PHI nodes forward reference INSTRUCTIONS (aaaaaaaahhhhhhh!) :)

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

18 years agoProperly document the second form of ConstArray::get()
Reid Spencer [Tue, 30 May 2006 08:26:13 +0000 (08:26 +0000)]
Properly document the second form of ConstArray::get()

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

18 years agoAdjust the interface to ConstantArray::get. The previous
Reid Spencer [Tue, 30 May 2006 08:23:18 +0000 (08:23 +0000)]
Adjust the interface to ConstantArray::get. The previous
implementation always added a null byte to the end of the string. It turns
out that this is not always wanted. By adding a length parameter we preserve
this behavior when length==0 (default value) but also allow other lengths
(not null terminated) to be created.

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

18 years agoAdd a note about integer multiplication by constants.
Evan Cheng [Tue, 30 May 2006 07:37:37 +0000 (07:37 +0000)]
Add a note about integer multiplication by constants.

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

18 years agoA addressing mode folding enhancement:
Evan Cheng [Tue, 30 May 2006 06:59:36 +0000 (06:59 +0000)]
A addressing mode folding enhancement:
Fold c2 in (x << c1) | c2 where (c2 < c1)
e.g.
int test(int x) {
  return (x << 3) + 7;
}

This can be codegen'd as:
leal 7(,%eax,8), %eax

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

18 years agoAdd a lea instruction selection test case.
Evan Cheng [Tue, 30 May 2006 06:53:55 +0000 (06:53 +0000)]
Add a lea instruction selection test case.

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

18 years agoSome new entries about truncate / anyext
Evan Cheng [Tue, 30 May 2006 06:23:50 +0000 (06:23 +0000)]
Some new entries about truncate / anyext

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

18 years agoFirst complete version of llvm2cpp that doesn't crash on any of the Feature
Reid Spencer [Tue, 30 May 2006 03:43:49 +0000 (03:43 +0000)]
First complete version of llvm2cpp that doesn't crash on any of the Feature
tests. The output in a few cases still doesn't compile, however.

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

18 years agomove calltarget to dsa
Andrew Lenharth [Mon, 29 May 2006 23:39:48 +0000 (23:39 +0000)]
move calltarget to dsa

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

18 years agoSince there was interest on the mailing list, this is a utility pass that
Andrew Lenharth [Mon, 29 May 2006 22:58:38 +0000 (22:58 +0000)]
Since there was interest on the mailing list, this is a utility pass that
uses DSA to make find targets of calls.  It provides a very convinient
interface to DSA results to do things with indirect calls, such as
write a devirtualizer (which I have and may commit one of these days).

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

18 years agoSilly cleanup
Chris Lattner [Mon, 29 May 2006 18:52:52 +0000 (18:52 +0000)]
Silly cleanup

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

18 years agosilly cleanup
Chris Lattner [Mon, 29 May 2006 18:52:05 +0000 (18:52 +0000)]
silly cleanup

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

18 years agoFix a bug with diffing the wrong files. Make output more readable.
Reid Spencer [Mon, 29 May 2006 18:09:38 +0000 (18:09 +0000)]
Fix a bug with diffing the wrong files. Make output more readable.

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

18 years agoNext batch of implementation:
Reid Spencer [Mon, 29 May 2006 18:08:06 +0000 (18:08 +0000)]
Next batch of implementation:
1. Get rid of old AsmWriter cruft that's not needed.
2. Implement several instructions. Enough to get by globalvars.ll and
   alignment.ll in the Feature test suite.
3. Handle constants properly (don't repeat definitions).
4. Make the output compatible with llvm-dis for diff purposes.

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

18 years agoFix file header comment.
Reid Spencer [Mon, 29 May 2006 18:06:28 +0000 (18:06 +0000)]
Fix file header comment.

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

18 years agoRemove temporary testing rules.
Reid Spencer [Mon, 29 May 2006 18:05:59 +0000 (18:05 +0000)]
Remove temporary testing rules.

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

18 years agoReset DEBUG_SYMBOL_TABLE back to 0.
Vladimir Prus [Mon, 29 May 2006 12:54:52 +0000 (12:54 +0000)]
Reset DEBUG_SYMBOL_TABLE back to 0.

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

18 years agoFix compile error when DEBUG_SYMBOL_TABLE is defined.
Vladimir Prus [Mon, 29 May 2006 12:45:15 +0000 (12:45 +0000)]
Fix compile error when DEBUG_SYMBOL_TABLE is defined.

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

18 years agoFix two bugs in the CppWriter.cpp:
Reid Spencer [Mon, 29 May 2006 02:58:15 +0000 (02:58 +0000)]
Fix two bugs in the CppWriter.cpp:
1. Return the module from the MakeModule function so it can be verified.
2. Make sure types get generated with their names

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

18 years agoFix the file's comment block.
Reid Spencer [Mon, 29 May 2006 02:35:29 +0000 (02:35 +0000)]
Fix the file's comment block.

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

18 years agoFix grammar in a comment.
Reid Spencer [Mon, 29 May 2006 02:34:34 +0000 (02:34 +0000)]
Fix grammar in a comment.

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

18 years agoReplace an old C-style cast with a C++ cast (squelch warning)
Reid Spencer [Mon, 29 May 2006 02:32:43 +0000 (02:32 +0000)]
Replace an old C-style cast with a C++ cast (squelch warning)

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

18 years agoCorrect some grammar and describe current reality.
Reid Spencer [Mon, 29 May 2006 02:31:47 +0000 (02:31 +0000)]
Correct some grammar and describe current reality.

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

18 years agoRequire both tests to pass.
Owen Anderson [Mon, 29 May 2006 01:28:16 +0000 (01:28 +0000)]
Require both tests to pass.

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

18 years agoUpdate the testcase to check the full extent of LCSSA.
Owen Anderson [Mon, 29 May 2006 01:07:04 +0000 (01:07 +0000)]
Update the testcase to check the full extent of LCSSA.

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

18 years agoAdd Use replacement. Assuming there is nothing horribly wrong with this, LCSSA
Owen Anderson [Mon, 29 May 2006 01:00:00 +0000 (01:00 +0000)]
Add Use replacement.  Assuming there is nothing horribly wrong with this, LCSSA
is now theoretically feature-complete.  It has not, however, been thoroughly
test, and is still considered experimental.

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

18 years agoInitial Commit of llvm2cpp
Reid Spencer [Mon, 29 May 2006 00:57:22 +0000 (00:57 +0000)]
Initial Commit of llvm2cpp
This is a safekeeping commit. The program is not finished. It currently
handles modules, types, global variables and function declarations. Blocks
and instructions remain to be done.

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

18 years agoMajor think-o. Iterate over all live out-of-loop values, and perform the
Owen Anderson [Sun, 28 May 2006 19:33:28 +0000 (19:33 +0000)]
Major think-o.  Iterate over all live out-of-loop values, and perform the
other calculations on each individually, rather than trying to delay it and do
them all at the end.

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

18 years agoFix a problem where dejagnu won't accept the value of global tcl variable
Reid Spencer [Sun, 28 May 2006 07:22:42 +0000 (07:22 +0000)]
Fix a problem where dejagnu won't accept the value of global tcl variable
"libdir" for some reason. Changing to llvmlibsdir instead fixes it.

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

18 years agoProvide an infrastructure for testing the llvm2cpp program (yet to be
Reid Spencer [Sun, 28 May 2006 04:21:40 +0000 (04:21 +0000)]
Provide an infrastructure for testing the llvm2cpp program (yet to be
committed). This infrastructure is only activated when RUNLLVM2CPP=1 is
specified on the make command line. Currently it is only supported in the
Feature test suite.

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

18 years agoMake LCSSA insert proper Phi nodes throughout the rest of the CFG by computing
Owen Anderson [Sat, 27 May 2006 18:47:11 +0000 (18:47 +0000)]
Make LCSSA insert proper Phi nodes throughout the rest of the CFG by computing
the iterated Dominance Frontier of the loop-closure Phi's.  This is the
second phase of the LCSSA pass.  The third phase (coming soon) will be to
update all uses of loop variables to use the loop-closure Phi's instead.

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

18 years agoFix some regression from the inliner patch I committed last night. This fixes
Chris Lattner [Sat, 27 May 2006 17:28:13 +0000 (17:28 +0000)]
Fix some regression from the inliner patch I committed last night.  This fixes
ldecod, lencod, and SPASS.

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

18 years agoFix pastos in comments
Chris Lattner [Sat, 27 May 2006 06:57:55 +0000 (06:57 +0000)]
Fix pastos in comments

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

18 years agoSwitch the inliner over to using CloneAndPruneFunctionInto. This effectively
Chris Lattner [Sat, 27 May 2006 01:28:04 +0000 (01:28 +0000)]
Switch the inliner over to using CloneAndPruneFunctionInto.  This effectively
makes it so that it constant folds instructions on the fly.  This is good
for several reasons:

0. Many instructions are constant foldable after inlining, particularly if
   inlining a call with constant arguments.
1. Without this, the inliner has to allocate memory for all of the instructions
   that can be constant folded, then a subsequent pass has to delete them.  This
   gets the job done without this extra work.
2. This makes the inliner *pass* a bit more aggressive: in particular, it
   partially solves a phase order issue where the inliner would inline lots
   of code that folds away to nothing, but think that the resultant function
   is big because of this code that will be gone.  Now the code never exists.

This is the first part of a 2-step process.  The second part will be smart
enough to see when this implicit constant folding propagates a constant into
a branch or switch instruction, making CFG edges dead.

This implements Transforms/Inline/inline_constprop.ll

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

18 years agoIgnore generated files
Chris Lattner [Sat, 27 May 2006 01:23:30 +0000 (01:23 +0000)]
Ignore generated files

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

18 years agoImplement a new method, CloneAndPruneFunctionInto, as documented.
Chris Lattner [Sat, 27 May 2006 01:22:24 +0000 (01:22 +0000)]
Implement a new method, CloneAndPruneFunctionInto, as documented.

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

18 years agoImplement a new method: CloneAndPruneFunctionInto, as documented.
Chris Lattner [Sat, 27 May 2006 01:21:50 +0000 (01:21 +0000)]
Implement a new method: CloneAndPruneFunctionInto, as documented.

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

18 years agoRefactor some code to expose an interface to constant fold and instruction given...
Chris Lattner [Sat, 27 May 2006 01:18:04 +0000 (01:18 +0000)]
Refactor some code to expose an interface to constant fold and instruction given it's opcode, typeand operands.

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

18 years agoAdd an interface to constant fold and instruction given it's opcode, type
Chris Lattner [Sat, 27 May 2006 01:17:40 +0000 (01:17 +0000)]
Add an interface to constant fold and instruction given it's opcode, type
and operands.

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

18 years agoNew testcase: check that the inliner constant folds instructions on the
Chris Lattner [Sat, 27 May 2006 01:16:22 +0000 (01:16 +0000)]
New testcase: check that the inliner constant folds instructions on the
fly if it can.

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