oota-llvm.git
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

18 years agoFix a nasty dag combiner bug that caused nondeterminstic crashes (MY FAVORITE!):
Chris Lattner [Sat, 27 May 2006 00:43:02 +0000 (00:43 +0000)]
Fix a nasty dag combiner bug that caused nondeterminstic crashes (MY FAVORITE!):
SimplifySelectOps would eliminate a Select, delete it, then return true.

The clients would see that it did something and return null.

The top level would see a null return, and decide that nothing happened,
proceeding to process the node in other ways: boom.

The fix is simple: clients of SimplifySelectOps should return the select
node itself.

In order to catch really obnoxious boogs like this in the future, add an
assert that nodes are not deleted.  We do this by checking for a sentry node
type that the SDNode dtor sets when a node is destroyed.

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

18 years agoAdd a new sentry node type, allowing assertions to catch trivial
Chris Lattner [Sat, 27 May 2006 00:40:15 +0000 (00:40 +0000)]
Add a new sentry node type, allowing assertions to catch trivial
use-after-deleted errors.

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

18 years agoA few small clean-ups, and the addition of an LCSSA statistic.
Owen Anderson [Sat, 27 May 2006 00:31:37 +0000 (00:31 +0000)]
A few small clean-ups, and the addition of an LCSSA statistic.

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

18 years agoMake CALL node consistent with RET node. Signness of value has type MVT::i32
Evan Cheng [Fri, 26 May 2006 23:13:20 +0000 (23:13 +0000)]
Make CALL node consistent with RET node. Signness of value has type MVT::i32
instead of MVT::i1. Either is fine except MVT::i32 is probably a legal type
for most (if not all) platforms while MVT::i1 is not.

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

18 years agoChange RET node to include signness information of the return values. i.e.
Evan Cheng [Fri, 26 May 2006 23:10:12 +0000 (23:10 +0000)]
Change RET node to include signness information of the return values. i.e.
RET chain, value1, sign1, value2, sign2, ...

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

18 years agoChange RET node to include signness information of the return values. e.g.
Evan Cheng [Fri, 26 May 2006 23:09:09 +0000 (23:09 +0000)]
Change RET node to include signness information of the return values. e.g.
RET chain, value1, sign1, value2, sign2

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

18 years agoTrivial testcase that LCSSA can already handle.
Owen Anderson [Fri, 26 May 2006 21:59:20 +0000 (21:59 +0000)]
Trivial testcase that LCSSA can already handle.

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

18 years agoFix a copy-and-paste-o that would break some compilers.
Owen Anderson [Fri, 26 May 2006 21:19:17 +0000 (21:19 +0000)]
Fix a copy-and-paste-o that would break some compilers.

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

18 years agoClean up and refactor LCSSA a bunch. It should also run faster now, though
Owen Anderson [Fri, 26 May 2006 21:11:53 +0000 (21:11 +0000)]
Clean up and refactor LCSSA a bunch.  It should also run faster now, though
there's still a lot of work to be done on it.

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

18 years agoVector argument must be passed in memory location aligned on 16-byte boundary.
Evan Cheng [Fri, 26 May 2006 20:37:47 +0000 (20:37 +0000)]
Vector argument must be passed in memory location aligned on 16-byte boundary.

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

18 years agoMac OS X ABI document lied. The first four XMM registers are used to pass
Evan Cheng [Fri, 26 May 2006 19:22:06 +0000 (19:22 +0000)]
Mac OS X ABI document lied. The first four XMM registers are used to pass
vector arguments, not three.

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

18 years agoImplement Transforms/InstCombine/store.ll:test2.
Chris Lattner [Fri, 26 May 2006 19:19:20 +0000 (19:19 +0000)]
Implement Transforms/InstCombine/store.ll:test2.

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

18 years agoNew testcase for trivial DSE
Chris Lattner [Fri, 26 May 2006 19:18:40 +0000 (19:18 +0000)]
New testcase for trivial DSE

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

18 years agoFix a bug in the bc reader/writer: we were not correctly encoding varargs
Chris Lattner [Fri, 26 May 2006 18:42:34 +0000 (18:42 +0000)]
Fix a bug in the bc reader/writer: we were not correctly encoding varargs
nonccc calls (we were dropping the CC and tail flag).  This broke several
FORTRAN programs.

Testcase here: Regression/Assembler/2006-05-26-VarargsCallEncode.ll

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

18 years agoNew testcase, check that the bc file correctly encodes varargs nonccc calls.
Chris Lattner [Fri, 26 May 2006 18:41:26 +0000 (18:41 +0000)]
New testcase, check that the bc file correctly encodes varargs nonccc calls.

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

18 years agoMinor update to make the code more clear
Evan Cheng [Fri, 26 May 2006 18:39:59 +0000 (18:39 +0000)]
Minor update to make the code more clear

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

18 years agoUpdate more comments.
Evan Cheng [Fri, 26 May 2006 18:37:16 +0000 (18:37 +0000)]
Update more comments.

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

18 years agoFix some comments.
Evan Cheng [Fri, 26 May 2006 18:25:43 +0000 (18:25 +0000)]
Fix some comments.

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