oota-llvm.git
16 years agomany cleanups and fixed, contributed by Sam Bishop
Chris Lattner [Wed, 9 Jan 2008 19:28:50 +0000 (19:28 +0000)]
many cleanups and fixed, contributed by Sam Bishop

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

16 years agoStrongPHIElim: Now with even fewer trivial bugs!
Owen Anderson [Wed, 9 Jan 2008 10:41:39 +0000 (10:41 +0000)]
StrongPHIElim: Now with even fewer trivial bugs!

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

16 years agoFix an infinite recursion bug in InsertCopies.
Owen Anderson [Wed, 9 Jan 2008 10:32:30 +0000 (10:32 +0000)]
Fix an infinite recursion bug in InsertCopies.

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

16 years agoFix some simple bugs. StrongPHIElimination now does not crash on 164.gzip.
Owen Anderson [Wed, 9 Jan 2008 06:19:05 +0000 (06:19 +0000)]
Fix some simple bugs.  StrongPHIElimination now does not crash on 164.gzip.

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

16 years agoFix sse2.psrl.w and sse2.psrl.q definitions.
Evan Cheng [Wed, 9 Jan 2008 02:16:44 +0000 (02:16 +0000)]
Fix sse2.psrl.w and sse2.psrl.q definitions.

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

16 years agoFix llvm-ld -Xlinker, patch by Daniel Teske!
Chris Lattner [Wed, 9 Jan 2008 01:01:17 +0000 (01:01 +0000)]
Fix llvm-ld -Xlinker, patch by Daniel Teske!

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

16 years agoadd a testcase
Chris Lattner [Wed, 9 Jan 2008 00:37:18 +0000 (00:37 +0000)]
add a testcase

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

16 years agoadd a note
Chris Lattner [Wed, 9 Jan 2008 00:17:57 +0000 (00:17 +0000)]
add a note

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

16 years agoMake load->store deletion a bit smarter. This allows us to compile this:
Chris Lattner [Tue, 8 Jan 2008 23:08:06 +0000 (23:08 +0000)]
Make load->store deletion a bit smarter.  This allows us to compile this:

void test(long long *P) { *P ^= 1; }

into just:

_test:
movl 4(%esp), %eax
xorl $1, (%eax)
ret

instead of code like this:

_test:
movl 4(%esp), %ecx
        xorl    $1, (%ecx)
movl 4(%ecx), %edx
movl %edx, 4(%ecx)
ret

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

16 years agoRename registers that do not need copies.
Owen Anderson [Tue, 8 Jan 2008 21:54:52 +0000 (21:54 +0000)]
Rename registers that do not need copies.

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

16 years agoCrashes llc when using Chris's new legalization logic.
Duncan Sands [Tue, 8 Jan 2008 21:51:53 +0000 (21:51 +0000)]
Crashes llc when using Chris's new legalization logic.

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

16 years agoAdded "getRoot()" to ImmutableMap.
Ted Kremenek [Tue, 8 Jan 2008 21:05:59 +0000 (21:05 +0000)]
Added "getRoot()" to ImmutableMap.
Made the ctor for ImmutableMap to construct a map from an AVL tree public.

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

16 years agoFixed 80 col. violation.
Ted Kremenek [Tue, 8 Jan 2008 19:38:55 +0000 (19:38 +0000)]
Fixed 80 col. violation.

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

16 years agoadd a mayLoad property for machine instructions, a correlary to mayStore.
Chris Lattner [Tue, 8 Jan 2008 18:05:21 +0000 (18:05 +0000)]
add a mayLoad property for machine instructions, a correlary to mayStore.
This is currently not set by anything.

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

16 years agoUse size_t to store Pos, avoid truncating value
Duncan Sands [Tue, 8 Jan 2008 10:06:15 +0000 (10:06 +0000)]
Use size_t to store Pos, avoid truncating value
on 64-bit builds.  Analysis and original patch
by Török Edwin.  Code audit found another place
with the same problem, also fixed here.

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

16 years agoImplement PR1795, an instcombine hack for forming GEPs with integer pointer arithmetic.
Chris Lattner [Tue, 8 Jan 2008 07:23:51 +0000 (07:23 +0000)]
Implement PR1795, an instcombine hack for forming GEPs with integer pointer arithmetic.

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

16 years agoadd match support for casts.
Chris Lattner [Tue, 8 Jan 2008 07:02:44 +0000 (07:02 +0000)]
add match support for casts.

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

16 years agoremove darwin/i386 t-t
Chris Lattner [Tue, 8 Jan 2008 06:52:51 +0000 (06:52 +0000)]
remove darwin/i386 t-t

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

16 years agoFinally implement correct ordered comparisons for PPC, even though
Chris Lattner [Tue, 8 Jan 2008 06:46:30 +0000 (06:46 +0000)]
Finally implement correct ordered comparisons for PPC, even though
the code generated is not wonderful.  This turns a miscompilation into
a code quality bug (noted in the ppc readme).  This fixes PR642, which
is over 2 years old (!).  Nate, please review this.

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

16 years agoTestcase for PR1721
Chris Lattner [Tue, 8 Jan 2008 05:16:29 +0000 (05:16 +0000)]
Testcase for PR1721

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

16 years agoActually insert copies now!
Owen Anderson [Tue, 8 Jan 2008 05:16:15 +0000 (05:16 +0000)]
Actually insert copies now!

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

16 years agoFix PR1797
Chris Lattner [Tue, 8 Jan 2008 04:26:20 +0000 (04:26 +0000)]
Fix PR1797

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

16 years agoMinor fix to enable x86-64 pic jit (still fails for other reasons).
Evan Cheng [Tue, 8 Jan 2008 02:07:10 +0000 (02:07 +0000)]
Minor fix to enable x86-64 pic jit (still fails for other reasons).

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

16 years agoFix a x86-64 static codegen bug. This fixes a lot of x86-64 jit failures.
Evan Cheng [Tue, 8 Jan 2008 02:06:11 +0000 (02:06 +0000)]
Fix a x86-64 static codegen bug. This fixes a lot of x86-64 jit failures.

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

16 years agoSilence warning about loss of precision.
Bill Wendling [Tue, 8 Jan 2008 00:52:29 +0000 (00:52 +0000)]
Silence warning about loss of precision.

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

16 years agoOnly mark instructions that load a single value without extension as isSimpleLoad...
Evan Cheng [Mon, 7 Jan 2008 23:56:57 +0000 (23:56 +0000)]
Only mark instructions that load a single value without extension as isSimpleLoad = 1.

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

16 years agoadd a new bit.
Chris Lattner [Mon, 7 Jan 2008 23:16:55 +0000 (23:16 +0000)]
add a new bit.

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

16 years agoUnbreak x86-64.
Evan Cheng [Mon, 7 Jan 2008 23:08:23 +0000 (23:08 +0000)]
Unbreak x86-64.

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

16 years agoadd a note that is important for some fp apps.
Chris Lattner [Mon, 7 Jan 2008 21:59:58 +0000 (21:59 +0000)]
add a note that is important for some fp apps.

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

16 years agopossible switch lowering improvement.
Chris Lattner [Mon, 7 Jan 2008 21:38:14 +0000 (21:38 +0000)]
possible switch lowering improvement.

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

16 years agoOops, missed one.
Owen Anderson [Mon, 7 Jan 2008 21:32:09 +0000 (21:32 +0000)]
Oops, missed one.

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

16 years agoMake some predicates static.
Owen Anderson [Mon, 7 Jan 2008 21:30:40 +0000 (21:30 +0000)]
Make some predicates static.

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

16 years agoI doubt the address of the Error string was intended
Duncan Sands [Mon, 7 Jan 2008 19:14:42 +0000 (19:14 +0000)]
I doubt the address of the Error string was intended
to be used for the force_interpreter parameter...
Spotted by gcc-4.2.

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

16 years agoAdd missing newline at EOF.
Duncan Sands [Mon, 7 Jan 2008 19:13:36 +0000 (19:13 +0000)]
Add missing newline at EOF.

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

16 years agoUpdate the comment on scalar to vector to be a bit more clear.
Nate Begeman [Mon, 7 Jan 2008 17:52:24 +0000 (17:52 +0000)]
Update the comment on scalar to vector to be a bit more clear.

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

16 years agoUpdate test to catch recent x86 insert regression and improvements
Nate Begeman [Mon, 7 Jan 2008 17:49:23 +0000 (17:49 +0000)]
Update test to catch recent x86 insert regression and improvements

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

16 years agoSmall cleanup for handling of type/parameter attribute
Duncan Sands [Mon, 7 Jan 2008 17:16:06 +0000 (17:16 +0000)]
Small cleanup for handling of type/parameter attribute
incompatibility.

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

16 years agoUnbreak x86-32 darwin long double!
Duncan Sands [Mon, 7 Jan 2008 16:36:38 +0000 (16:36 +0000)]
Unbreak x86-32 darwin long double!

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

16 years agoFix long double support on x86-32 linux.
Duncan Sands [Mon, 7 Jan 2008 13:44:22 +0000 (13:44 +0000)]
Fix long double support on x86-32 linux.

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

16 years agoPruning includes.
Gordon Henriksen [Mon, 7 Jan 2008 13:30:38 +0000 (13:30 +0000)]
Pruning includes.

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

16 years agoOperand 1 should be a register. We don't care if it's a preg, vreg, or 0.
Bill Wendling [Mon, 7 Jan 2008 08:05:29 +0000 (08:05 +0000)]
Operand 1 should be a register. We don't care if it's a preg, vreg, or 0.

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

16 years agoadd a note
Chris Lattner [Mon, 7 Jan 2008 07:46:23 +0000 (07:46 +0000)]
add a note

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

16 years agoremove #includage
Chris Lattner [Mon, 7 Jan 2008 07:42:25 +0000 (07:42 +0000)]
remove #includage

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

16 years agosplit TargetInstrDesc out into its own header file.
Chris Lattner [Mon, 7 Jan 2008 07:33:08 +0000 (07:33 +0000)]
split TargetInstrDesc out into its own header file.

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

16 years agorename TargetInstrDescriptor -> TargetInstrDesc.
Chris Lattner [Mon, 7 Jan 2008 07:27:27 +0000 (07:27 +0000)]
rename TargetInstrDescriptor -> TargetInstrDesc.
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.

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

16 years agoremove a dead method.
Chris Lattner [Mon, 7 Jan 2008 06:47:10 +0000 (06:47 +0000)]
remove a dead method.

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

16 years agosimplify some code.
Chris Lattner [Mon, 7 Jan 2008 06:47:00 +0000 (06:47 +0000)]
simplify some code.

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

16 years agoRename all the M_* flags to be namespace qualified enums, and switch
Chris Lattner [Mon, 7 Jan 2008 06:42:05 +0000 (06:42 +0000)]
Rename all the M_* flags to be namespace qualified enums, and switch
all clients over to using predicates instead of these flags directly.
These are now private values which are only to be used to statically
initialize the tables.

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

16 years agouse predicate.
Chris Lattner [Mon, 7 Jan 2008 06:37:29 +0000 (06:37 +0000)]
use predicate.

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

16 years agoadd more and significantly better comments to the rest of the machineinstr
Chris Lattner [Mon, 7 Jan 2008 06:21:53 +0000 (06:21 +0000)]
add more and significantly better comments to the rest of the machineinstr
flags that can be set.  Add predicates for the ones lacking it, and switch
some clients over to using the predicates instead of Flags directly.

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

16 years agosimplify some code using new predicates
Chris Lattner [Mon, 7 Jan 2008 05:40:58 +0000 (05:40 +0000)]
simplify some code using new predicates

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

16 years agoadd some mroe comments, add a isImplicitDef() method, add
Chris Lattner [Mon, 7 Jan 2008 05:38:38 +0000 (05:38 +0000)]
add some mroe comments, add a isImplicitDef() method, add
isConditionalBranch() and isUnconditionalBranch() methods.

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

16 years agorename hasVariableOperands() -> isVariadic(). Add some comments.
Chris Lattner [Mon, 7 Jan 2008 05:19:29 +0000 (05:19 +0000)]
rename hasVariableOperands() -> isVariadic().  Add some comments.
Evan, please review the comments I added to getNumDefs to make sure
that they are accurate, thx.

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

16 years agoMove M_* flags down in the file. Move SchedClass up in the
Chris Lattner [Mon, 7 Jan 2008 05:06:49 +0000 (05:06 +0000)]
Move M_* flags down in the file.  Move SchedClass up in the
TargetInstrDescriptor class and shrink to 16-bits, saving a
word in TargetInstrDescriptor.  Add some comments.

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

16 years agoremove a dead field.
Chris Lattner [Mon, 7 Jan 2008 04:57:42 +0000 (04:57 +0000)]
remove a dead field.

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

16 years agothe name field of instructions is never set to a non-empty string,
Chris Lattner [Mon, 7 Jan 2008 04:57:31 +0000 (04:57 +0000)]
the name field of instructions is never set to a non-empty string,
just unconditionally use the def name of the instruction.

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

16 years agono need to explicitly clear these fields.
Chris Lattner [Mon, 7 Jan 2008 04:55:09 +0000 (04:55 +0000)]
no need to explicitly clear these fields.

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

16 years agoRemoving a leaked file.
Gordon Henriksen [Mon, 7 Jan 2008 03:23:52 +0000 (03:23 +0000)]
Removing a leaked file.

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

16 years agoMove a bunch more accessors from TargetInstrInfo to TargetInstrDescriptor
Chris Lattner [Mon, 7 Jan 2008 03:13:06 +0000 (03:13 +0000)]
Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptor

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

16 years agoremove MachineOpCode typedef.
Chris Lattner [Mon, 7 Jan 2008 02:48:55 +0000 (02:48 +0000)]
remove MachineOpCode typedef.

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

16 years agoremove some uses of MachineOpCode, move getSchedClass
Chris Lattner [Mon, 7 Jan 2008 02:46:03 +0000 (02:46 +0000)]
remove some uses of MachineOpCode, move getSchedClass
into TargetInstrDescriptor from TargetInstrInfo.

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

16 years agoAdd predicates methods to TargetOperandInfo, and switch all clients
Chris Lattner [Mon, 7 Jan 2008 02:39:19 +0000 (02:39 +0000)]
Add predicates methods to TargetOperandInfo, and switch all clients
over to using them, instead of diddling Flags directly.  Change the
various flags from const variables to enums.

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

16 years agoSetting GlobalDirective in TargetAsmInfo by default rather than
Gordon Henriksen [Mon, 7 Jan 2008 02:31:11 +0000 (02:31 +0000)]
Setting GlobalDirective in TargetAsmInfo by default rather than
providing a misleading facility. It's used once in the MIPS backend
and hardcoded as "\t.globl\t" everywhere else.

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

16 years agoDeleting an empty file. Thanks, /usr/bin/patch!
Gordon Henriksen [Mon, 7 Jan 2008 02:29:04 +0000 (02:29 +0000)]
Deleting an empty file. Thanks, /usr/bin/patch!

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

16 years agoRename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
Chris Lattner [Mon, 7 Jan 2008 01:56:04 +0000 (01:56 +0000)]
Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
that it is cheap and efficient to get.

Move a variety of predicates from TargetInstrInfo into
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around.  Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.

Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.

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

16 years agoUpdate CodeGen for MRegisterInfo --> TargetInstrInfo changes.
Owen Anderson [Mon, 7 Jan 2008 01:35:56 +0000 (01:35 +0000)]
Update CodeGen for MRegisterInfo --> TargetInstrInfo changes.

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

16 years agoMove even more functionality from MRegisterInfo into TargetInstrInfo.
Owen Anderson [Mon, 7 Jan 2008 01:35:02 +0000 (01:35 +0000)]
Move even more functionality from MRegisterInfo into TargetInstrInfo.

Some day I'll get it all moved over...

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

16 years agoAmmending r45669 with a missing file.
Gordon Henriksen [Mon, 7 Jan 2008 01:33:09 +0000 (01:33 +0000)]
Ammending r45669 with a missing file.

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

16 years agoWith this patch, the LowerGC transformation becomes the
Gordon Henriksen [Mon, 7 Jan 2008 01:30:53 +0000 (01:30 +0000)]
With this patch, the LowerGC transformation becomes the
ShadowStackCollector, which additionally has reduced overhead with
no sacrifice in portability.

Considering a function @fun with 8 loop-local roots,
ShadowStackCollector introduces the following overhead
(x86):

; shadowstack prologue
        movl    L_llvm_gc_root_chain$non_lazy_ptr, %eax
        movl    (%eax), %ecx
        movl    $___gc_fun, 20(%esp)
        movl    $0, 24(%esp)
        movl    $0, 28(%esp)
        movl    $0, 32(%esp)
        movl    $0, 36(%esp)
        movl    $0, 40(%esp)
        movl    $0, 44(%esp)
        movl    $0, 48(%esp)
        movl    $0, 52(%esp)
        movl    %ecx, 16(%esp)
        leal    16(%esp), %ecx
        movl    %ecx, (%eax)

; shadowstack loop overhead
        (none)

; shadowstack epilogue
        movl    48(%esp), %edx
        movl    %edx, (%ecx)

; shadowstack metadata
        .align  3
___gc_fun:                              # __gc_fun
        .long   8
        .space  4

In comparison to LowerGC:

; lowergc prologue
        movl    L_llvm_gc_root_chain$non_lazy_ptr, %eax
        movl    (%eax), %ecx
        movl    %ecx, 48(%esp)
        movl    $8, 52(%esp)
        movl    $0, 60(%esp)
        movl    $0, 56(%esp)
        movl    $0, 68(%esp)
        movl    $0, 64(%esp)
        movl    $0, 76(%esp)
        movl    $0, 72(%esp)
        movl    $0, 84(%esp)
        movl    $0, 80(%esp)
        movl    $0, 92(%esp)
        movl    $0, 88(%esp)
        movl    $0, 100(%esp)
        movl    $0, 96(%esp)
        movl    $0, 108(%esp)
        movl    $0, 104(%esp)
        movl    $0, 116(%esp)
        movl    $0, 112(%esp)

; lowergc loop overhead
        leal    44(%esp), %eax
        movl    %eax, 56(%esp)
        leal    40(%esp), %eax
        movl    %eax, 64(%esp)
        leal    36(%esp), %eax
        movl    %eax, 72(%esp)
        leal    32(%esp), %eax
        movl    %eax, 80(%esp)
        leal    28(%esp), %eax
        movl    %eax, 88(%esp)
        leal    24(%esp), %eax
        movl    %eax, 96(%esp)
        leal    20(%esp), %eax
        movl    %eax, 104(%esp)
        leal    16(%esp), %eax
        movl    %eax, 112(%esp)

; lowergc epilogue
        movl    48(%esp), %edx
        movl    %edx, (%ecx)

; lowergc metadata
        (none)

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

16 years agoEnabling the target-independent garbage collection infrastructure by hooking it
Gordon Henriksen [Mon, 7 Jan 2008 01:30:38 +0000 (01:30 +0000)]
Enabling the target-independent garbage collection infrastructure by hooking it
up to the various compiler pipelines.

This doesn't actually add support for any GC algorithms, which means it
temporarily breaks a few tests. To be fixed shortly.

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

16 years agoThe pic base can't be duplicated.
Chris Lattner [Sun, 6 Jan 2008 23:49:32 +0000 (23:49 +0000)]
The pic base can't be duplicated.

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

16 years agorename isLoad -> isSimpleLoad due to evan's desire to have such a predicate.
Chris Lattner [Sun, 6 Jan 2008 23:38:27 +0000 (23:38 +0000)]
rename isLoad -> isSimpleLoad due to evan's desire to have such a predicate.

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

16 years agoModify Makefile.rules to allow makefiles to prepend to C.Flags and
Gordon Henriksen [Sun, 6 Jan 2008 21:54:35 +0000 (21:54 +0000)]
Modify Makefile.rules to allow makefiles to prepend to C.Flags and
fiends. Change Makefile.ocaml to not touch CFLAGS.

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

16 years agoimprove description of alignment, patch by Alain Frisch.
Chris Lattner [Sun, 6 Jan 2008 21:04:43 +0000 (21:04 +0000)]
improve description of alignment, patch by Alain Frisch.

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

16 years agoFix typo noticed by 'Danny' in PR1901
Chris Lattner [Sun, 6 Jan 2008 19:51:52 +0000 (19:51 +0000)]
Fix typo noticed by 'Danny' in PR1901

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

16 years agoback out accidental commit.
Chris Lattner [Sun, 6 Jan 2008 19:19:32 +0000 (19:19 +0000)]
back out accidental commit.

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

16 years agofix an accidental commit that broke all the testers :(
Chris Lattner [Sun, 6 Jan 2008 19:18:52 +0000 (19:18 +0000)]
fix an accidental commit that broke all the testers :(

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

16 years agoThe transform that tries to turn calls to bitcast functions into
Duncan Sands [Sun, 6 Jan 2008 18:27:01 +0000 (18:27 +0000)]
The transform that tries to turn calls to bitcast functions into
direct calls bails out unless caller and callee have essentially
equivalent parameter attributes.  This is illogical - the callee's
attributes should be of no relevance here.  Rework the logic, which
incidentally fixes a crash when removed arguments have attributes.

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

16 years agoWhen transforming a call to a bitcast function into
Duncan Sands [Sun, 6 Jan 2008 10:12:28 +0000 (10:12 +0000)]
When transforming a call to a bitcast function into
a direct call with cast parameters and cast return
value (if any), instcombine was prepared to cast any
non-void return value into any other, whether castable
or not.  Add a new predicate for testing whether casting
is valid, and check it both for the return value and
(as a cleanup) for the parameters.

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

16 years agorename isStore -> mayStore to more accurately reflect what it captures.
Chris Lattner [Sun, 6 Jan 2008 08:36:04 +0000 (08:36 +0000)]
rename isStore -> mayStore to more accurately reflect what it captures.

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

16 years agoRemove an unused variable.
Duncan Sands [Sun, 6 Jan 2008 07:43:13 +0000 (07:43 +0000)]
Remove an unused variable.

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

16 years agoChange the 'isStore' inferrer to look for 'SDNPMayStore'
Chris Lattner [Sun, 6 Jan 2008 06:44:58 +0000 (06:44 +0000)]
Change the 'isStore' inferrer to look for 'SDNPMayStore'
instead of "ISD::STORE".  This allows us to mark target-specific dag
nodes as storing (such as ppc byteswap stores).  This allows us to remove
more explicit isStore flags from the .td files.

Finally, add a warning for when a .td file contains an explicit
isStore and tblgen is able to infer it.

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

16 years agoremove explicit isStore flags that are now inferrable.
Chris Lattner [Sun, 6 Jan 2008 05:55:01 +0000 (05:55 +0000)]
remove explicit isStore flags that are now inferrable.

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

16 years agoremove some isStore flags that are now inferred automatically.
Chris Lattner [Sun, 6 Jan 2008 05:53:26 +0000 (05:53 +0000)]
remove some isStore flags that are now inferred automatically.

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

16 years agodescribe isStore and simplify the implementation of hasUnmodelledSideEffects.
Chris Lattner [Sun, 6 Jan 2008 05:43:21 +0000 (05:43 +0000)]
describe isStore and simplify the implementation of hasUnmodelledSideEffects.
No functionality change.

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

16 years agoset the 'isstore' flag for instructions whose pattern is an
Chris Lattner [Sun, 6 Jan 2008 05:36:50 +0000 (05:36 +0000)]
set the 'isstore' flag for instructions whose pattern is an
intrinsic that writes to memory.

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

16 years agoAccept both %y, %x and %x, %y as valid answers.
Nick Lewycky [Sun, 6 Jan 2008 03:12:44 +0000 (03:12 +0000)]
Accept both %y, %x and %x, %y as valid answers.

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

16 years agoremove some old hacky code that tried to infer whether a store
Chris Lattner [Sun, 6 Jan 2008 02:16:26 +0000 (02:16 +0000)]
remove some old hacky code that tried to infer whether a store
occured in a pattern, but failed miserably.  The new code works for
any instruction that has a store in its pattern, including all the
x86 mem op mem instructions.

The only target-independent code that uses this is branch folding,
so this won't change anything in practice.

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

16 years agorearrange some code to allow inferring instr info from the pattern of the instr,...
Chris Lattner [Sun, 6 Jan 2008 01:53:37 +0000 (01:53 +0000)]
rearrange some code to allow inferring instr info from the pattern of the instr, but don't do so yet.

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

16 years agoimprove const correctness.
Chris Lattner [Sun, 6 Jan 2008 01:52:22 +0000 (01:52 +0000)]
improve const correctness.

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

16 years agoSplit the impl of CodeGenInstruction out to its own .cpp file, add a getName() accessor.
Chris Lattner [Sun, 6 Jan 2008 01:35:39 +0000 (01:35 +0000)]
Split the impl of CodeGenInstruction out to its own .cpp file, add a getName() accessor.

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

16 years agofinal cleanups.
Chris Lattner [Sun, 6 Jan 2008 01:21:51 +0000 (01:21 +0000)]
final cleanups.

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

16 years agofurther simplifications and cleanup
Chris Lattner [Sun, 6 Jan 2008 01:20:13 +0000 (01:20 +0000)]
further simplifications and cleanup

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

16 years agosimplify some code
Chris Lattner [Sun, 6 Jan 2008 01:12:44 +0000 (01:12 +0000)]
simplify some code

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

16 years agorename CodegenDAGPatterns -> CodeGenDAGPatterns
Chris Lattner [Sun, 6 Jan 2008 01:10:31 +0000 (01:10 +0000)]
rename CodegenDAGPatterns -> CodeGenDAGPatterns

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

16 years agosplit enum emission out from InstrInfoEmitter into it's own tblgen backend.
Chris Lattner [Sun, 6 Jan 2008 00:49:05 +0000 (00:49 +0000)]
split enum emission out from InstrInfoEmitter into it's own tblgen backend.

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

16 years agofix build on case sensitive file systems.
Chris Lattner [Sat, 5 Jan 2008 23:37:52 +0000 (23:37 +0000)]
fix build on case sensitive file systems.

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

16 years agoFix comment.
Bill Wendling [Sat, 5 Jan 2008 23:30:51 +0000 (23:30 +0000)]
Fix comment.

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

16 years agomake this build with newer gcc's
Chris Lattner [Sat, 5 Jan 2008 23:29:51 +0000 (23:29 +0000)]
make this build with newer gcc's

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

16 years agonow that computing CodegenDAGPatterns doesn't implicitly print stuff
Chris Lattner [Sat, 5 Jan 2008 22:58:54 +0000 (22:58 +0000)]
now that computing CodegenDAGPatterns doesn't implicitly print stuff
out, DAGISelEmitter can compute it in its ctor, which simplifies some code.

Now we can use CodegenDAGPatterns in other parts of tblgen that want access
to dag pattern info, woo!

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