oota-llvm.git
16 years agoremove extraneous namespace qualifier, PR2142
Chris Lattner [Thu, 13 Mar 2008 05:17:59 +0000 (05:17 +0000)]
remove extraneous namespace qualifier, PR2142

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

16 years agomove a bunch of trivial methods to be inline.
Chris Lattner [Thu, 13 Mar 2008 05:00:21 +0000 (05:00 +0000)]
move a bunch of trivial methods to be inline.

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

16 years agoVarious improvements suggested by Duncan
Chris Lattner [Thu, 13 Mar 2008 04:33:03 +0000 (04:33 +0000)]
Various improvements suggested by Duncan

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

16 years agoFix an incorrect comment, PR2147.
Chris Lattner [Thu, 13 Mar 2008 03:29:42 +0000 (03:29 +0000)]
Fix an incorrect comment, PR2147.

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

16 years agoImprove VarInfo::removeKill() by using std::find instead of linear search.
Evan Cheng [Thu, 13 Mar 2008 02:42:55 +0000 (02:42 +0000)]
Improve VarInfo::removeKill() by using std::find instead of linear search.

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

16 years agoUpdate -mem2reg to use succ_iterator instead of iterating across TerminatorInst
Nick Lewycky [Thu, 13 Mar 2008 02:42:41 +0000 (02:42 +0000)]
Update -mem2reg to use succ_iterator instead of iterating across TerminatorInst
successors. This makes it support nounwind.

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

16 years agoRemove unused options.
Evan Cheng [Thu, 13 Mar 2008 02:41:34 +0000 (02:41 +0000)]
Remove unused options.

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

16 years agoEliminate a few unnecessary uses of dynamic_cast.
Dan Gohman [Thu, 13 Mar 2008 02:08:36 +0000 (02:08 +0000)]
Eliminate a few unnecessary uses of dynamic_cast.

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

16 years agoFix a typo.
Dan Gohman [Thu, 13 Mar 2008 01:58:48 +0000 (01:58 +0000)]
Fix a typo.

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

16 years agoDon't redundantly clear std::vector members in destructors.
Dan Gohman [Thu, 13 Mar 2008 01:57:34 +0000 (01:57 +0000)]
Don't redundantly clear std::vector members in destructors.

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

16 years agoChange PMTopLevelManager's PassManagers vector element type from
Dan Gohman [Thu, 13 Mar 2008 01:48:32 +0000 (01:48 +0000)]
Change PMTopLevelManager's PassManagers vector element type from
Pass* to PMDataManager*. PMDataManager is more specific than Pass,
so this more accurately describes the objects that are being stored.

This eliminates the need for several dynamic_casts to PMDataManager*.
It does introduce one dynamic_cast though, in dumpPasses(). Give
this one a comment describing why a dynamic_cast is being used.

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

16 years agoChange PMStack::push to accept a PMDataManager* instead of
Dan Gohman [Thu, 13 Mar 2008 01:21:31 +0000 (01:21 +0000)]
Change PMStack::push to accept a PMDataManager* instead of
a Pass*. PMDataManager* is what it actually holds, so this
makes it clearer.

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

16 years agoFix a typo in a comment.
Dan Gohman [Thu, 13 Mar 2008 01:08:50 +0000 (01:08 +0000)]
Fix a typo in a comment.

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

16 years agoNo need for typedefs with enums in C++.
Dan Gohman [Thu, 13 Mar 2008 01:07:53 +0000 (01:07 +0000)]
No need for typedefs with enums in C++.

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

16 years agoRefactor some code out of MachineSink into a MachineInstr query.
Evan Cheng [Thu, 13 Mar 2008 00:44:09 +0000 (00:44 +0000)]
Refactor some code out of MachineSink into a MachineInstr query.

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

16 years agoDo not promote float params to double in varargs
Dale Johannesen [Wed, 12 Mar 2008 23:40:01 +0000 (23:40 +0000)]
Do not promote float params to double in varargs
calls here.  This was done earlier for params in
the varargs part of the params; any float params
that survive to here are in the non-varargs part,
and must not be promoted.

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

16 years agoExperimental scheduler change to schedule / coalesce the copies added for function...
Evan Cheng [Wed, 12 Mar 2008 22:19:41 +0000 (22:19 +0000)]
Experimental scheduler change to schedule / coalesce the copies added for function livein's. Take 2008-03-10-RegAllocInfLoop.ll, the schedule looks like this after these copies are inserted:

entry: 0x12049d0, LLVM BB @0x1201fd0, ID#0:
Live Ins: %EAX %EDX %ECX
        %reg1031<def> = MOVPC32r 0
        %reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
        %reg1028<def> = MOV32rr %EAX
        %reg1029<def> = MOV32rr %EDX
        %reg1030<def> = MOV32rr %ECX
        %reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x1201910 + 0]
        %reg1025<def> = MOV32rr %reg1029
        %reg1026<def> = MOV32rr %reg1030
        %reg1024<def> = MOV32rr %reg1028

The copies unnecessarily increase register pressure and it will end up requiring a physical register to be spilled.

With -schedule-livein-copies:
entry: 0x12049d0, LLVM BB @0x1201fa0, ID#0:
Live Ins: %EAX %EDX %ECX
        %reg1031<def> = MOVPC32r 0
        %reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
        %reg1024<def> = MOV32rr %EAX
        %reg1025<def> = MOV32rr %EDX
        %reg1026<def> = MOV32rr %ECX
        %reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x12018e0 + 0]

Much better!

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

16 years agoInitial soft-float support for LegalizeTypes. I rewrote
Duncan Sands [Wed, 12 Mar 2008 21:27:04 +0000 (21:27 +0000)]
Initial soft-float support for LegalizeTypes.  I rewrote
the fcopysign expansion from LegalizeDAG to get rid of
what seems to be a bug: the use of sign extension means
that when copying the sign bit from an f32 to an f64,
the upper 32 bits of the f64 (now an i64) are set, not
just the top bit...  I also generalized it to work for
any sized floating point types, and removed the bogosity:
  SDOperand Mask1 = (SrcVT == MVT::f64)
    ? DAG.getConstantFP(BitsToDouble(1ULL << 63), SrcVT)
    : DAG.getConstantFP(BitsToFloat(1U << 31), SrcVT);
  Mask1 = DAG.getNode(ISD::BIT_CONVERT, SrcNVT, Mask1);
(here SrcNVT is an integer with the same size as SrcVT).
As far as I can see this takes a 1 << 63, converts to
a double, converts that to a floating point constant
then converts that to an integer constant, ending up
with... 1 << 63 as an integer constant!  So I just
generate this integer constant directly.

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

16 years agoChange VirtRegMap's dump to dump to cerr, not DOUT, so that it
Dan Gohman [Wed, 12 Mar 2008 20:52:10 +0000 (20:52 +0000)]
Change VirtRegMap's dump to dump to cerr, not DOUT, so that it
can be called from within a debuger without having -debug specified
on the command-line.

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

16 years agoFix typos in comments.
Dan Gohman [Wed, 12 Mar 2008 20:50:04 +0000 (20:50 +0000)]
Fix typos in comments.

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

16 years agoFix this test on hosts that don't have sse2.
Dan Gohman [Wed, 12 Mar 2008 20:40:51 +0000 (20:40 +0000)]
Fix this test on hosts that don't have sse2.

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

16 years agoFix typo.
Duncan Sands [Wed, 12 Mar 2008 20:35:19 +0000 (20:35 +0000)]
Fix typo.

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

16 years agoDon't try to extract an i32 from an f64. This
Duncan Sands [Wed, 12 Mar 2008 20:30:08 +0000 (20:30 +0000)]
Don't try to extract an i32 from an f64.  This
getCopyToParts problem was noticed by the new
LegalizeTypes infrastructure.  In order to avoid
this kind of thing in the future I've added a
check that EXTRACT_ELEMENT is only used with
integers.  Once LegalizeTypes is up and running
most likely BUILD_PAIR and EXTRACT_ELEMENT can
be removed, in favour of using apints instead.

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

16 years agoReimplement the parameter attributes support, phase #1. hilights:
Chris Lattner [Wed, 12 Mar 2008 17:45:29 +0000 (17:45 +0000)]
Reimplement the parameter attributes support, phase #1. hilights:

1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less
invasive changes.

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

16 years agono need to keep around this output.
Chris Lattner [Wed, 12 Mar 2008 17:14:06 +0000 (17:14 +0000)]
no need to keep around this output.

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

16 years agoDocument an implementation detail about EXTRACT_SUBREG and INSERT_SUBREG sub-register...
Evan Cheng [Wed, 12 Mar 2008 07:52:15 +0000 (07:52 +0000)]
Document an implementation detail about EXTRACT_SUBREG and INSERT_SUBREG sub-register operand.

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

16 years agoImprove the return slot optimization to be both more aggressive (not limited to sret...
Owen Anderson [Wed, 12 Mar 2008 07:37:44 +0000 (07:37 +0000)]
Improve the return slot optimization to be both more aggressive (not limited to sret parameters), and
safer (when the passed pointer might be invalid).  Thanks to Duncan and Chris for the idea behind this,
and extra thanks to Duncan for helping me work out the trap-safety.

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

16 years agoClean up my own mess.
Evan Cheng [Wed, 12 Mar 2008 07:02:50 +0000 (07:02 +0000)]
Clean up my own mess.
X86 lowering normalize vector 0 to v4i32. However DAGCombine can fold (sub x, x) -> 0 after legalization. It can create a zero vector of a type that's not expected (e.g. v8i16). We don't want to disable the optimization since leaving a (sub x, x) is really bad. Add isel patterns for other types of vector 0 to ensure correctness. It's highly unlikely to happen other than in bugpoint reduced test cases.

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

16 years agoWe also need to collect the VN IDs for the PHI instructions for later updating.
Owen Anderson [Wed, 12 Mar 2008 04:22:57 +0000 (04:22 +0000)]
We also need to collect the VN IDs for the PHI instructions for later updating.

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

16 years agoWhen we're determining what registers to coallesce, track the VNInfo IDs for the...
Owen Anderson [Wed, 12 Mar 2008 03:13:29 +0000 (03:13 +0000)]
When we're determining what registers to coallesce, track the VNInfo IDs for the definitions that
feed the PHI instructions.  We'll need these IDs in order to update LiveIntervals properly.

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

16 years agowhen the bitcode reader is referencing a paramattr, make sure to bump its refcount.
Chris Lattner [Wed, 12 Mar 2008 02:25:52 +0000 (02:25 +0000)]
when the bitcode reader is referencing a paramattr, make sure to bump its refcount.

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

16 years agoTotal brain cramp.
Evan Cheng [Wed, 12 Mar 2008 02:05:05 +0000 (02:05 +0000)]
Total brain cramp.

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

16 years agoThis is a simple fix for getting error messages from dlerror in
Chris Lattner [Wed, 12 Mar 2008 00:50:01 +0000 (00:50 +0000)]
This is a simple fix for getting error messages from dlerror in
LoadLibraryPermanently. The current code modifies the value of a pointer
that is passed by value, so the caller never gets the message.

Patch by Julien Lerouge!

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

16 years agoOne more bit of Altivec parameter passing.
Dale Johannesen [Wed, 12 Mar 2008 00:49:20 +0000 (00:49 +0000)]
One more bit of Altivec parameter passing.

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

16 years agoBe backward compatible
Anton Korobeynikov [Wed, 12 Mar 2008 00:49:19 +0000 (00:49 +0000)]
Be backward compatible

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

16 years agoCheck multiple return values.
Devang Patel [Wed, 12 Mar 2008 00:32:32 +0000 (00:32 +0000)]
Check multiple return values.

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

16 years agoMake this test x86-specific for now; targets that don't use
Dan Gohman [Wed, 12 Mar 2008 00:25:14 +0000 (00:25 +0000)]
Make this test x86-specific for now; targets that don't use
the automated CallingConv code to handle return values typically
don't support multiple return values.

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

16 years agoImplement Altivec passing to varargs functions on ppc.
Dale Johannesen [Wed, 12 Mar 2008 00:22:17 +0000 (00:22 +0000)]
Implement Altivec passing to varargs functions on ppc.

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

16 years agoSet NextMII after issuing a physical register spill.
Evan Cheng [Wed, 12 Mar 2008 00:14:07 +0000 (00:14 +0000)]
Set NextMII after issuing a physical register spill.

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

16 years agoFix attribute handling.
Devang Patel [Wed, 12 Mar 2008 00:07:03 +0000 (00:07 +0000)]
Fix attribute handling.

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

16 years agoMinor debug output bug.
Evan Cheng [Wed, 12 Mar 2008 00:02:46 +0000 (00:02 +0000)]
Minor debug output bug.

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

16 years agoBasic feature test for multiple return values in codegen.
Dan Gohman [Tue, 11 Mar 2008 23:53:16 +0000 (23:53 +0000)]
Basic feature test for multiple return values in codegen.

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

16 years agoUltimately resolve aliases during linking, if possible
Anton Korobeynikov [Tue, 11 Mar 2008 22:51:09 +0000 (22:51 +0000)]
Ultimately resolve aliases during linking, if possible

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

16 years agoTestcase for PR2137
Anton Korobeynikov [Tue, 11 Mar 2008 22:43:42 +0000 (22:43 +0000)]
Testcase for PR2137

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

16 years agoCorrectly propagate thread-local flag from aliasee to alias. This fixes PR2137
Anton Korobeynikov [Tue, 11 Mar 2008 22:38:53 +0000 (22:38 +0000)]
Correctly propagate thread-local flag from aliasee to alias. This fixes PR2137

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

16 years agoUse PassManagerBase instead of FunctionPassManager for functions
Dan Gohman [Tue, 11 Mar 2008 22:29:46 +0000 (22:29 +0000)]
Use PassManagerBase instead of FunctionPassManager for functions
that merely add passes. This allows them to be used with either
FunctionPassManager or PassManager, or even with a custom new
kind of pass manager.

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

16 years agoAdd helper for ultimate aliasee resoltion
Anton Korobeynikov [Tue, 11 Mar 2008 22:28:56 +0000 (22:28 +0000)]
Add helper for ultimate aliasee resoltion

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

16 years agoHandle multiple ret values.
Devang Patel [Tue, 11 Mar 2008 22:24:29 +0000 (22:24 +0000)]
Handle multiple ret values.

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

16 years agoInitialize.
Devang Patel [Tue, 11 Mar 2008 22:08:21 +0000 (22:08 +0000)]
Initialize.

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

16 years agoCheck to see if a two-entry PHI block can be simplified
Dan Gohman [Tue, 11 Mar 2008 21:53:06 +0000 (21:53 +0000)]
Check to see if a two-entry PHI block can be simplified
before trying to merge the block into its predecessors.
This allows two-entry-phi-return.ll to be simplified
into a single basic block.

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

16 years agoMake this test more challenging to help it avoid being
Dan Gohman [Tue, 11 Mar 2008 21:47:57 +0000 (21:47 +0000)]
Make this test more challenging to help it avoid being
optimized away before it tests what it is intended to test.

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

16 years agoUpdate testcase for recent aliases change
Anton Korobeynikov [Tue, 11 Mar 2008 21:42:20 +0000 (21:42 +0000)]
Update testcase for recent aliases change

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

16 years agoHonour aliases visibility during asm emission
Anton Korobeynikov [Tue, 11 Mar 2008 21:41:14 +0000 (21:41 +0000)]
Honour aliases visibility during asm emission

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

16 years agoHonour aliases visibility when reading from/writing to bitcode
Anton Korobeynikov [Tue, 11 Mar 2008 21:40:17 +0000 (21:40 +0000)]
Honour aliases visibility when reading from/writing to bitcode

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

16 years agoAdd a test to ensure that all-ones vectors are materialized with pcmpeqd.
Dan Gohman [Tue, 11 Mar 2008 21:37:00 +0000 (21:37 +0000)]
Add a test to ensure that all-ones vectors are materialized with pcmpeqd.

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

16 years agoTransfer physical register spill info when load / store folding happens.
Evan Cheng [Tue, 11 Mar 2008 21:34:46 +0000 (21:34 +0000)]
Transfer physical register spill info when load / store folding happens.

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

16 years agoUse the correct value for InSignBit.
Dan Gohman [Tue, 11 Mar 2008 21:29:43 +0000 (21:29 +0000)]
Use the correct value for InSignBit.

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

16 years agoInitial codegen support for functions and calls with multiple return values.
Dan Gohman [Tue, 11 Mar 2008 21:11:25 +0000 (21:11 +0000)]
Initial codegen support for functions and calls with multiple return values.

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

16 years agoImplement basic support for the 'f' register class constraint. This basically
Chris Lattner [Tue, 11 Mar 2008 19:50:13 +0000 (19:50 +0000)]
Implement basic support for the 'f' register class constraint.  This basically
works, but probably won't if you mix it with 't' or 'u' yet.

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

16 years agocoalesce away 80-bit floating point copies.
Chris Lattner [Tue, 11 Mar 2008 19:30:09 +0000 (19:30 +0000)]
coalesce away 80-bit floating point copies.

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

16 years agoconvert a massive if statement to a switch.
Chris Lattner [Tue, 11 Mar 2008 19:28:17 +0000 (19:28 +0000)]
convert a massive if statement to a switch.

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

16 years agostart handling the 'f' x87 constraint.
Chris Lattner [Tue, 11 Mar 2008 19:06:29 +0000 (19:06 +0000)]
start handling the 'f' x87 constraint.

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

16 years agoSkip functions that return multiple values.
Devang Patel [Tue, 11 Mar 2008 18:04:06 +0000 (18:04 +0000)]
Skip functions that return multiple values.

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

16 years agoThe feature this is testing did not work in the general case,
Dale Johannesen [Tue, 11 Mar 2008 17:48:26 +0000 (17:48 +0000)]
The feature this is testing did not work in the general case,
and has been removed.

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

16 years agoFix getOperand() for ReturnInst.
Devang Patel [Tue, 11 Mar 2008 17:35:03 +0000 (17:35 +0000)]
Fix getOperand() for ReturnInst.

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

16 years agoBecome multiple return value aware.
Devang Patel [Tue, 11 Mar 2008 17:33:32 +0000 (17:33 +0000)]
Become multiple return value aware.
Right now, the pass does not optimize tail recursions
involving multiple return values.

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

16 years agoAdd TODO reminder.
Devang Patel [Tue, 11 Mar 2008 17:32:05 +0000 (17:32 +0000)]
Add TODO reminder.

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

16 years agoGive PassManager and FunctionPassManager a common base class, with
Dan Gohman [Tue, 11 Mar 2008 16:41:42 +0000 (16:41 +0000)]
Give PassManager and FunctionPassManager a common base class, with
add(Pass *) as a pure virtual member function. This will allow all
the various addPassesTo* functions in LLVM to avoid hard-coding what
type of PassManager is used.

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

16 years agoFix typos in comments.
Dan Gohman [Tue, 11 Mar 2008 16:18:48 +0000 (16:18 +0000)]
Fix typos in comments.

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

16 years agoMissed part of recommit.
Christopher Lamb [Tue, 11 Mar 2008 10:27:36 +0000 (10:27 +0000)]
Missed part of recommit.

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

16 years agoRecommitting parts of r48130. These do not appear to cause the observed failures.
Christopher Lamb [Tue, 11 Mar 2008 10:09:17 +0000 (10:09 +0000)]
Recommitting parts of r48130. These do not appear to cause the observed failures.

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

16 years agoRecommitting changes after more testing. These appear to cause no problems.
Christopher Lamb [Tue, 11 Mar 2008 09:33:47 +0000 (09:33 +0000)]
Recommitting changes after more testing. These appear to cause no problems.

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

16 years agoUse TargetRegisterInfo::getPhysicalRegisterRegClass. Remove duplicated code.
Evan Cheng [Tue, 11 Mar 2008 07:55:13 +0000 (07:55 +0000)]
Use TargetRegisterInfo::getPhysicalRegisterRegClass. Remove duplicated code.

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

16 years agoIf there are multiple register classes that a register belongs to, return the super...
Evan Cheng [Tue, 11 Mar 2008 07:54:14 +0000 (07:54 +0000)]
If there are multiple register classes that a register belongs to, return the super-class (e.g. on x86, returns GR32, not GR32_).

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

16 years agoLearn how to xfail a test.
Evan Cheng [Tue, 11 Mar 2008 07:51:31 +0000 (07:51 +0000)]
Learn how to xfail a test.

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

16 years agoWhen the register allocator runs out of registers, spill a physical register around...
Evan Cheng [Tue, 11 Mar 2008 07:19:34 +0000 (07:19 +0000)]
When the register allocator runs out of registers, spill a physical register around the def's and use's of the interval being allocated to make it possible for the interval to target a register and spill it right away and restore a register for uses. This likely generates terrible code but is before than aborting.

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

16 years agoIn 32-bit mode, mark 64-bit GPR's as unallocatable.
Evan Cheng [Tue, 11 Mar 2008 07:16:00 +0000 (07:16 +0000)]
In 32-bit mode, mark 64-bit GPR's as unallocatable.

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

16 years agoXFAIL due to Dale's change.
Evan Cheng [Tue, 11 Mar 2008 07:15:44 +0000 (07:15 +0000)]
XFAIL due to Dale's change.

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

16 years agoSome LegalizeTypes code factorization and minor
Duncan Sands [Tue, 11 Mar 2008 06:41:14 +0000 (06:41 +0000)]
Some LegalizeTypes code factorization and minor
enhancements.

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

16 years agocompile: double test() {}
Chris Lattner [Tue, 11 Mar 2008 06:21:08 +0000 (06:21 +0000)]
compile: double test() {}

into:

_test:
fldz
ret

instead of:

_test:
subl $12, %esp
#IMPLICIT_DEF %xmm0
movsd %xmm0, (%esp)
fldl (%esp)
addl $12, %esp
ret

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

16 years agoFix the build on gcc 4.2.
Nick Lewycky [Tue, 11 Mar 2008 05:56:09 +0000 (05:56 +0000)]
Fix the build on gcc 4.2.

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

16 years agofix grammer
Devang Patel [Tue, 11 Mar 2008 05:51:59 +0000 (05:51 +0000)]
fix grammer

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

16 years agoInitial multiple return values support.
Devang Patel [Tue, 11 Mar 2008 05:46:42 +0000 (05:46 +0000)]
Initial multiple return values support.

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

16 years agoChange the model for FP Stack return to use fp operands on the
Chris Lattner [Tue, 11 Mar 2008 03:23:40 +0000 (03:23 +0000)]
Change the model for FP Stack return to use fp operands on the
RET instruction instead of using FpSET_ST0_32.  This also generalizes
the code to handling returning of multiple FP results.

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

16 years agovariadic instructions don't have operand info for variadic arguments.
Chris Lattner [Tue, 11 Mar 2008 03:14:42 +0000 (03:14 +0000)]
variadic instructions don't have operand info for variadic arguments.

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

16 years agoUpgrade this test.
Dan Gohman [Tue, 11 Mar 2008 02:19:59 +0000 (02:19 +0000)]
Upgrade this test.

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

16 years agoGeneralize ExpandIntToFP to handle the case where the operand is legal
Dan Gohman [Tue, 11 Mar 2008 01:59:03 +0000 (01:59 +0000)]
Generalize ExpandIntToFP to handle the case where the operand is legal
and it's the result that requires expansion. This code is a little confusing
because the TargetLoweringInfo tables for [US]INT_TO_FP use the operand type
(the integer type) rather than the result type.

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

16 years agoIf a register operand comes from the variadic part of a node, don't
Chris Lattner [Tue, 11 Mar 2008 00:59:28 +0000 (00:59 +0000)]
If a register operand comes from the variadic part of a node, don't
verify the register constraint matches what the instruction expects.

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

16 years agoTemporarily revert 48175.
Evan Cheng [Tue, 11 Mar 2008 00:27:34 +0000 (00:27 +0000)]
Temporarily revert 48175.

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

16 years agoFix thinko: alias always defines new symbol. Even is aliasee itself is undefined.
Anton Korobeynikov [Tue, 11 Mar 2008 00:24:53 +0000 (00:24 +0000)]
Fix thinko: alias always defines new symbol. Even is aliasee itself is undefined.

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

16 years agoMore APInt-ification.
Dan Gohman [Tue, 11 Mar 2008 00:11:06 +0000 (00:11 +0000)]
More APInt-ification.

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

16 years agoemit an ID # for each regclass ID. Chris doesn't like to have to count.
Chris Lattner [Tue, 11 Mar 2008 00:00:23 +0000 (00:00 +0000)]
emit an ID # for each regclass ID.  Chris doesn't like to have to count.

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

16 years agoabort with an assert instead of a cerr to get line#
Chris Lattner [Mon, 10 Mar 2008 23:56:08 +0000 (23:56 +0000)]
abort with an assert instead of a cerr to get line#

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

16 years agoUse utostr instead of a stringstream.
Dan Gohman [Mon, 10 Mar 2008 23:55:07 +0000 (23:55 +0000)]
Use utostr instead of a stringstream.

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

16 years ago- Style cleanup in IA64ISelLowering.h: add 'virtual' keyword for consistency.
Scott Michel [Mon, 10 Mar 2008 23:49:09 +0000 (23:49 +0000)]
- Style cleanup in IA64ISelLowering.h: add 'virtual' keyword for consistency.
- Add test pattern matching in CellSPU's icmp32.ll test harness
- Fix CellSPU fcmp.ll-generated assert.

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

16 years agoCorrectly clone FlaggedNodes.
Dan Gohman [Mon, 10 Mar 2008 23:48:14 +0000 (23:48 +0000)]
Correctly clone FlaggedNodes.

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

16 years agoInitialize ArgTypes directly instead of manually copying in the elements.
Dan Gohman [Mon, 10 Mar 2008 23:41:23 +0000 (23:41 +0000)]
Initialize ArgTypes directly instead of manually copying in the elements.

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

16 years agoAPInt-ify this.
Dan Gohman [Mon, 10 Mar 2008 23:38:17 +0000 (23:38 +0000)]
APInt-ify this.

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

16 years agoRemove an unnecessary #include
Dan Gohman [Mon, 10 Mar 2008 23:37:12 +0000 (23:37 +0000)]
Remove an unnecessary #include

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

16 years agoDon't emit FP_REG_KILL into a block that just returns. Nothing
Chris Lattner [Mon, 10 Mar 2008 23:34:12 +0000 (23:34 +0000)]
Don't emit FP_REG_KILL into a block that just returns.  Nothing
can be live out of the block anyway, so it isn't needed.

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