oota-llvm.git
14 years agoCareful with reg_sequence coalescing to not to overwrite sub-register indices.
Evan Cheng [Mon, 17 May 2010 20:57:12 +0000 (20:57 +0000)]
Careful with reg_sequence coalescing to not to overwrite sub-register indices.

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

14 years agoFix a regression in 464.h264 for thumb1 and thumb2 nightly tests.
Bob Wilson [Mon, 17 May 2010 20:31:13 +0000 (20:31 +0000)]
Fix a regression in 464.h264 for thumb1 and thumb2 nightly tests.
Obvious in retrospect but not fun to debug.

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

14 years agoMC/Mach-O: Fix some differences in symbol flag handling.
Daniel Dunbar [Mon, 17 May 2010 20:12:31 +0000 (20:12 +0000)]
MC/Mach-O: Fix some differences in symbol flag handling.
 - Don't clear weak reference flag, 'as' was only "trying" to do this, it wasn't
   actually succeeding.
 - Clear the "lazy bound" bit when we mark something external. This corresponds
   roughly to the lazy clearing of the bit that 'as' implements in
   symbol_table_lookup.
 - The exact meaning of these flags appears pretty loose, since 'as' isn't very
   consistent. For now we just try to match 'as', we will clean this up one day
   hopefully.

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

14 years agoOptimize empty DenseMap iteration.
Jakob Stoklund Olesen [Mon, 17 May 2010 20:01:24 +0000 (20:01 +0000)]
Optimize empty DenseMap iteration.

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

14 years agoRemove debug option. Add comment on spill order determinism.
Jakob Stoklund Olesen [Mon, 17 May 2010 20:01:22 +0000 (20:01 +0000)]
Remove debug option. Add comment on spill order determinism.

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

14 years agoTurn on -neon-reg-sequence by default.
Evan Cheng [Mon, 17 May 2010 19:51:20 +0000 (19:51 +0000)]
Turn on -neon-reg-sequence by default.

Using NEON load / store multiple instructions will no longer create gobs of vmov of D registers!

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

14 years agollvm-mc: Support reassignment of variables in one special case, when the
Daniel Dunbar [Mon, 17 May 2010 17:46:23 +0000 (17:46 +0000)]
llvm-mc: Support reassignment of variables in one special case, when the
variable has not yet been used in an expression. This allows us to support a few
cases that show up in real code (mostly because gcc generates it for Objective-C
on Darwin), without giving up a reasonable semantic model for assignment.

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

14 years agoAvoid allocating the same physreg to multiple virtregs in one instruction.
Jakob Stoklund Olesen [Mon, 17 May 2010 17:18:59 +0000 (17:18 +0000)]
Avoid allocating the same physreg to multiple virtregs in one instruction.

While that approach works wonders for register pressure, it tends to break
everything.

This should unbreak the arm-linux builder and fix a number of miscompilations.

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

14 years agoMinor optimizations. DenseMap::begin() is surprisingly slow on an empty map.
Jakob Stoklund Olesen [Mon, 17 May 2010 15:30:37 +0000 (15:30 +0000)]
Minor optimizations. DenseMap::begin() is surprisingly slow on an empty map.

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

14 years agoExtract spill cost calculation to a new method, and use definePhysReg() to clear
Jakob Stoklund Olesen [Mon, 17 May 2010 15:30:32 +0000 (15:30 +0000)]
Extract spill cost calculation to a new method, and use definePhysReg() to clear
out aliases when allocating. Clean up allocVirtReg().

Use calcSpillCost() to allow more aggressive hinting. Now the hint is always
taken unless blocked by a reserved register. This leads to more coalescing,
lower register pressure, and less spilling.

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

14 years agoRemove unused member variable.
Zhongxing Xu [Mon, 17 May 2010 09:47:55 +0000 (09:47 +0000)]
Remove unused member variable.

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

14 years agoOnly use clairvoyance when defining a register, and then only if it has one use.
Jakob Stoklund Olesen [Mon, 17 May 2010 04:50:57 +0000 (04:50 +0000)]
Only use clairvoyance when defining a register, and then only if it has one use.
This makes allocation independent on the ordering of use-def chains.

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

14 years agoEliminate a hash table probe when killing virtual registers.
Jakob Stoklund Olesen [Mon, 17 May 2010 03:26:09 +0000 (03:26 +0000)]
Eliminate a hash table probe when killing virtual registers.

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

14 years agoExecute virtreg kills immediately instead of after processing all uses.
Jakob Stoklund Olesen [Mon, 17 May 2010 03:26:06 +0000 (03:26 +0000)]
Execute virtreg kills immediately instead of after processing all uses.

This is safe to do because the physreg has been marked UsedInInstr and the kill flag will be set on the last operand using the virtreg if there are more then one.

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

14 years agoSprinkle superregister <imp-def> and <imp-kill> operands when dealing with subregiste...
Jakob Stoklund Olesen [Mon, 17 May 2010 02:49:21 +0000 (02:49 +0000)]
Sprinkle superregister <imp-def> and <imp-kill> operands when dealing with subregister indices.

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

14 years agoNow that we don't keep live registers across calls, there is not reason to go
Jakob Stoklund Olesen [Mon, 17 May 2010 02:49:18 +0000 (02:49 +0000)]
Now that we don't keep live registers across calls, there is not reason to go
through the very long list of call-clobbered registers. We just assume all
registers are clobbered.

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

14 years agoBoldly attempt consistent capitalization. Functional changes unintended.
Jakob Stoklund Olesen [Mon, 17 May 2010 02:49:15 +0000 (02:49 +0000)]
Boldly attempt consistent capitalization. Functional changes unintended.

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

14 years agoAssume that we'll handle mangling the symbols earlier and just put the
Eric Christopher [Mon, 17 May 2010 02:13:02 +0000 (02:13 +0000)]
Assume that we'll handle mangling the symbols earlier and just put the
symbol to the file as we have it.  Simplifies out tbss handling.

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

14 years agoSpill and kill all virtual registers across a call.
Jakob Stoklund Olesen [Mon, 17 May 2010 02:07:32 +0000 (02:07 +0000)]
Spill and kill all virtual registers across a call.

Debug code doesn't use callee saved registers anyway, and the code is simpler this way. Now spillVirtReg always kills, and the isKill parameter is not needed.

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

14 years agoReduce hashtable probes by using DenseMap::insert() for lookup.
Jakob Stoklund Olesen [Mon, 17 May 2010 02:07:29 +0000 (02:07 +0000)]
Reduce hashtable probes by using DenseMap::insert() for lookup.

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

14 years agoMake MBB a class member instead of passing it around everywhere.
Jakob Stoklund Olesen [Mon, 17 May 2010 02:07:22 +0000 (02:07 +0000)]
Make MBB a class member instead of passing it around everywhere.

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

14 years agoYes, if the redef is a copy, update the old val# with the copy. But make sure to...
Evan Cheng [Mon, 17 May 2010 01:47:47 +0000 (01:47 +0000)]
Yes, if the redef is a copy, update the old val# with the copy. But make sure to clear the copy field if the redef is not a copy.

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

14 years agoNo reason not to run the NEON domain croassing fix up pass in thumb2 mode.
Evan Cheng [Mon, 17 May 2010 01:11:46 +0000 (01:11 +0000)]
No reason not to run the NEON domain croassing fix up pass in thumb2 mode.

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

14 years agoRemoving as part of previous reversion.
Dale Johannesen [Sun, 16 May 2010 20:19:40 +0000 (20:19 +0000)]
Removing as part of previous reversion.

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

14 years agoRevert 103911; it broke a test that expects bitconvert
Dale Johannesen [Sun, 16 May 2010 20:19:04 +0000 (20:19 +0000)]
Revert 103911; it broke a test that expects bitconvert
<1xi64> -> i64 to work in MMX registers on hosts where -no-sse
is the default (not mine).  The right thing is
to accept this and make i64->f64 conversions go through memory,
but I don't have time right now.

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

14 years agoMake x86-64 64-bit bitconvert work when SSE is not available.
Dale Johannesen [Sun, 16 May 2010 18:22:38 +0000 (18:22 +0000)]
Make x86-64 64-bit bitconvert work when SSE is not available.
(This worked as of about 6 months ago and I didn't track down
exactly what broke it; I think this fix is appropriate.)

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

14 years agoChris said that the comment char should be escaped. Fix all the occurences of "@...
Anton Korobeynikov [Sun, 16 May 2010 09:15:36 +0000 (09:15 +0000)]
Chris said that the comment char should be escaped. Fix all the occurences of "@" in *.td

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

14 years agoAdd support for thiscall calling convention.
Anton Korobeynikov [Sun, 16 May 2010 09:08:45 +0000 (09:08 +0000)]
Add support for thiscall calling convention.
Patch by Charles Davis and Steven Watanabe!

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

14 years agoGeneralize the ARM DAG combiner of mul with constants to all power-of-two cases.
Anton Korobeynikov [Sun, 16 May 2010 08:54:20 +0000 (08:54 +0000)]
Generalize the ARM DAG combiner of mul with constants to all power-of-two cases.

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

14 years agoModel vst lane instructions with REG_SEQUENCE.
Evan Cheng [Sun, 16 May 2010 03:27:48 +0000 (03:27 +0000)]
Model vst lane instructions with REG_SEQUENCE.

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

14 years agoAvoid renaming loadable modules at install time. Now the gold plugin is named
Rafael Espindola [Sun, 16 May 2010 03:13:23 +0000 (03:13 +0000)]
Avoid renaming loadable modules at install time. Now the gold plugin is named
LLVMgold.so both in both the build and install directories.

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

14 years agoUse $ORIGIN in the rpath of libraries.
Rafael Espindola [Sun, 16 May 2010 03:05:14 +0000 (03:05 +0000)]
Use $ORIGIN in the rpath of libraries.

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

14 years agoFix uint64->{float, double} conversion to do rounding correctly in 32-bit.
Dale Johannesen [Sat, 15 May 2010 18:51:12 +0000 (18:51 +0000)]
Fix uint64->{float, double} conversion to do rounding correctly in 32-bit.

The implementation in LegalizeIntegerTypes to handle this as
sint64->float + appropriate power of 2 is subject to double rounding,
considered incorrect by numerics people.  Use this implementation only
when it is safe.  This leads to using library calls in some cases
that produced inline code before, but it's correct now.
(EVTToAPFloatSemantics belongs somewhere else, any suggestions?)

Add a correctly rounding (though not particularly fast) conversion
that uses X87 80-bit computations for x86-32.

78853995901940.  This shows up in gcc.c-torture/execute/ieee/rbug.c
in the gcc testsuite on some platforms.

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

14 years agoImprove assertion messages.
Dale Johannesen [Sat, 15 May 2010 18:38:02 +0000 (18:38 +0000)]
Improve assertion messages.

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

14 years agoSome cheap DAG combine goodness for multiplication with a particular constant.
Anton Korobeynikov [Sat, 15 May 2010 18:16:59 +0000 (18:16 +0000)]
Some cheap DAG combine goodness for multiplication with a particular constant.
This can be extended later on to handle more "complex" constants.

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

14 years ago"trap" pseudo-op turned out to be apple-local.
Anton Korobeynikov [Sat, 15 May 2010 17:19:20 +0000 (17:19 +0000)]
"trap" pseudo-op turned out to be apple-local.
Temporary emit it as raw bytes until it will be added to binutils as well.

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

14 years agoimprove portability to systems that don't have round, patch by
Chris Lattner [Sat, 15 May 2010 17:11:55 +0000 (17:11 +0000)]
improve portability to systems that don't have round, patch by
Evzen Muller!

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

14 years agoimprove portability to systems that don't have powf/modf (e.g. solaris 9)
Chris Lattner [Sat, 15 May 2010 17:10:24 +0000 (17:10 +0000)]
improve portability to systems that don't have powf/modf (e.g. solaris 9)
patch by Evzen Muller!

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

14 years agoFix an GCC warning that seems to have actually caught a bug (!!!) in
Chandler Carruth [Sat, 15 May 2010 10:23:23 +0000 (10:23 +0000)]
Fix an GCC warning that seems to have actually caught a bug (!!!) in
a condition's grouping. Every other use of Allocatable.test(Hint) groups it the
same way as it is indented, so move the parentheses to agree with that
grouping.

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

14 years agoModel 128-bit vld lane with REG_SEQUENCE.
Evan Cheng [Sat, 15 May 2010 07:53:37 +0000 (07:53 +0000)]
Model 128-bit vld lane with REG_SEQUENCE.

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

14 years agoCalculate liveness on the fly for local registers.
Jakob Stoklund Olesen [Sat, 15 May 2010 06:09:08 +0000 (06:09 +0000)]
Calculate liveness on the fly for local registers.

When working top-down in a basic block, substituting physregs for virtregs, the use-def chains are kept up to date. That means we can recognize a virtreg kill by the use-def chain becoming empty.

This makes the fast allocator independent of incoming kill flags.

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

14 years agoTeach the always inliner to release its inline cost estimates, like the basic
Nick Lewycky [Sat, 15 May 2010 04:26:25 +0000 (04:26 +0000)]
Teach the always inliner to release its inline cost estimates, like the basic
inliner did in r103653. Why does the always inliner even bother with cost
estimates anyways?

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

14 years agoClean up, no functional change.
Nick Lewycky [Sat, 15 May 2010 03:41:58 +0000 (03:41 +0000)]
Clean up, no functional change.

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

14 years agoAdd reg_nodbg_iterator
Jakob Stoklund Olesen [Sat, 15 May 2010 02:52:58 +0000 (02:52 +0000)]
Add reg_nodbg_iterator

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

14 years agov4i64 and v8i64 are only synthesizable when NEON is available.
Evan Cheng [Sat, 15 May 2010 02:20:21 +0000 (02:20 +0000)]
v4i64 and v8i64 are only synthesizable when NEON is available.

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

14 years agoAllow TargetLowering::getRegClassFor() to be called on illegal types. Also
Evan Cheng [Sat, 15 May 2010 02:18:07 +0000 (02:18 +0000)]
Allow TargetLowering::getRegClassFor() to be called on illegal types. Also
allow target to override it in order to map register classes to illegal
but synthesizable types. e.g. v4i64, v8i64 for ARM / NEON.

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

14 years agoModel 64-bit lane vld with REG_SEQUENCE.
Evan Cheng [Sat, 15 May 2010 01:36:29 +0000 (01:36 +0000)]
Model 64-bit lane vld with REG_SEQUENCE.

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

14 years agoA partial re-def instruction may be a copy.
Evan Cheng [Sat, 15 May 2010 01:35:44 +0000 (01:35 +0000)]
A partial re-def instruction may be a copy.

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

14 years agoTeach two-address pass to do some coalescing while eliminating REG_SEQUENCE
Evan Cheng [Fri, 14 May 2010 23:21:14 +0000 (23:21 +0000)]
Teach two-address pass to do some coalescing while eliminating REG_SEQUENCE
instructions.

e.g.
%reg1026<def> = VLDMQ %reg1025<kill>, 260, pred:14, pred:%reg0
%reg1027<def> = EXTRACT_SUBREG %reg1026, 6
%reg1028<def> = EXTRACT_SUBREG %reg1026<kill>, 5
...
%reg1029<def> = REG_SEQUENCE %reg1028<kill>, 5, %reg1027<kill>, 6, %reg1028, 7, %reg1027, 8, %reg1028, 9, %reg1027, 10, %reg1030<kill>, 11, %reg1032<kill>, 12

After REG_SEQUENCE is eliminated, we are left with:

%reg1026<def> = VLDMQ %reg1025<kill>, 260, pred:14, pred:%reg0
%reg1029:6<def> = EXTRACT_SUBREG %reg1026, 6
%reg1029:5<def> = EXTRACT_SUBREG %reg1026<kill>, 5

The regular coalescer will not be able to coalesce reg1026 and reg1029 because it doesn't
know how to combine sub-register indices 5 and 6. Now 2-address pass will consult the
target whether sub-registers 5 and 6 of reg1026 can be combined to into a larger
sub-register (or combined to be reg1026 itself as is the case here). If it is possible,
it will be able to replace references of reg1026 with reg1029 + the larger sub-register
index.

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

14 years agoAdd some comments about undef.
Dan Gohman [Fri, 14 May 2010 23:01:02 +0000 (23:01 +0000)]
Add some comments about undef.

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

14 years agoModel VST*_UPD and VST*oddUPD pair with REG_SEQUENCE.
Evan Cheng [Fri, 14 May 2010 22:54:52 +0000 (22:54 +0000)]
Model VST*_UPD and VST*oddUPD pair with REG_SEQUENCE.

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

14 years agoFast ISel trivially coalesces away no-op casts, so check for this when
Dan Gohman [Fri, 14 May 2010 22:53:18 +0000 (22:53 +0000)]
Fast ISel trivially coalesces away no-op casts, so check for this when
setting kill flags.

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

14 years agoDon't bother spilling before a return
Jakob Stoklund Olesen [Fri, 14 May 2010 22:40:43 +0000 (22:40 +0000)]
Don't bother spilling before a return

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

14 years agoRegAllocLocal can count copies too
Jakob Stoklund Olesen [Fri, 14 May 2010 22:40:40 +0000 (22:40 +0000)]
RegAllocLocal can count copies too

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

14 years agoSystemZ really does mean "has calls" and not just "adjusts stack." Go ahead and
Bill Wendling [Fri, 14 May 2010 22:17:42 +0000 (22:17 +0000)]
SystemZ really does mean "has calls" and not just "adjusts stack." Go ahead and
replace the check with the appropriate predicate. Modify the testcase to reflect
the correct code. (It should be saving callee-saved registers on the stack
allocated by the calling fuction.)

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

14 years agoTrack allocatable instead of reserved regs, and never take an unallocatable hint.
Jakob Stoklund Olesen [Fri, 14 May 2010 22:02:56 +0000 (22:02 +0000)]
Track allocatable instead of reserved regs, and never take an unallocatable hint.

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

14 years agoDon't set kill flags for instructions which the scheduler has cloned.
Dan Gohman [Fri, 14 May 2010 22:01:14 +0000 (22:01 +0000)]
Don't set kill flags for instructions which the scheduler has cloned.

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

14 years agoBR is a barrier.
Dan Gohman [Fri, 14 May 2010 22:00:27 +0000 (22:00 +0000)]
BR is a barrier.

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

14 years agoSeveral tail call tests apparently rely upon this being "adjusts stack" instead
Bill Wendling [Fri, 14 May 2010 21:58:35 +0000 (21:58 +0000)]
Several tail call tests apparently rely upon this being "adjusts stack" instead
of "has calls". That's probably wrong, but it needs further
investigation. Revert to the original behavior until this is settled.

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

14 years agoAvoid scanning the long tail of physreg operands on calls
Jakob Stoklund Olesen [Fri, 14 May 2010 21:55:52 +0000 (21:55 +0000)]
Avoid scanning the long tail of physreg operands on calls

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

14 years agoDo not forget to mark prcessed arguments.
Devang Patel [Fri, 14 May 2010 21:55:50 +0000 (21:55 +0000)]
Do not forget to mark prcessed arguments.

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

14 years agoCount coalesced copies
Jakob Stoklund Olesen [Fri, 14 May 2010 21:55:50 +0000 (21:55 +0000)]
Count coalesced copies

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

14 years agoAllow virtreg redefines when verifying for RegAllocFast
Jakob Stoklund Olesen [Fri, 14 May 2010 21:55:44 +0000 (21:55 +0000)]
Allow virtreg redefines when verifying for RegAllocFast

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

14 years agoThis should happen if there are no calls, not if it just doesn't adjust the
Bill Wendling [Fri, 14 May 2010 21:38:44 +0000 (21:38 +0000)]
This should happen if there are no calls, not if it just doesn't adjust the
stack.

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

14 years agoRevert r103804. The comment is correct.
Bill Wendling [Fri, 14 May 2010 21:28:24 +0000 (21:28 +0000)]
Revert r103804. The comment is correct.

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

14 years agoRemove trailing whitespace
Jim Grosbach [Fri, 14 May 2010 21:20:46 +0000 (21:20 +0000)]
Remove trailing whitespace

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

14 years ago80 column and trailing whitespace cleanup
Jim Grosbach [Fri, 14 May 2010 21:19:48 +0000 (21:19 +0000)]
80 column and trailing whitespace cleanup

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

14 years agoadd cmd line option to leave dbgvalues in during post-RA sceduling. Useful
Jim Grosbach [Fri, 14 May 2010 21:18:04 +0000 (21:18 +0000)]
add cmd line option to leave dbgvalues in during post-RA sceduling. Useful
while debugging what's mishandled about them in the post-RA pass.

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

14 years agoFix comment.
Bill Wendling [Fri, 14 May 2010 21:17:29 +0000 (21:17 +0000)]
Fix comment.

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

14 years agoRename "HasCalls" in MachineFrameInfo to "AdjustsStack" to better describe what
Bill Wendling [Fri, 14 May 2010 21:14:32 +0000 (21:14 +0000)]
Rename "HasCalls" in MachineFrameInfo to "AdjustsStack" to better describe what
the variable actually tracks.

N.B., several back-ends are using "HasCalls" as being synonymous for something
that adjusts the stack. This isn't 100% correct and should be looked into.

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

14 years agoTest case for r103800.
Devang Patel [Fri, 14 May 2010 21:04:45 +0000 (21:04 +0000)]
Test case for r103800.

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

14 years agoLowering of atomic instructions can result in operands being
Dan Gohman [Fri, 14 May 2010 21:01:44 +0000 (21:01 +0000)]
Lowering of atomic instructions can result in operands being
used more than once. If ISel had put a kill flag on one of them,
it's not valid to transfer the kill flag to each new instance.

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

14 years agoAdd support to preserve type info for the variables that are removed by the optimizer.
Devang Patel [Fri, 14 May 2010 21:01:35 +0000 (21:01 +0000)]
Add support to preserve type info for the variables that are removed by the optimizer.

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

14 years agoWhen verifying two-address instructions, check the following:
Jakob Stoklund Olesen [Fri, 14 May 2010 20:28:32 +0000 (20:28 +0000)]
When verifying two-address instructions, check the following:

- Kill is implicit when use and def registers are identical.
- Only virtual registers can differ.

Add a -verify-fast-regalloc to run the verifier before the fast allocator.

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

14 years agoFix so "int3" is correctly accepted, added "into" and fixed "int" with an
Kevin Enderby [Fri, 14 May 2010 19:16:02 +0000 (19:16 +0000)]
Fix so "int3" is correctly accepted, added "into" and fixed "int" with an
argument, like "int $4", to not get an Assertion error.

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

14 years agoModel VLD*_UPD and VLD*odd_UPD pair with REG_SEQUENCE.
Evan Cheng [Fri, 14 May 2010 18:54:59 +0000 (18:54 +0000)]
Model VLD*_UPD and VLD*odd_UPD pair with REG_SEQUENCE.

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

14 years agoMC/Mach-O/x86_64: Darwin's special "signed_N" relocation types should only be
Daniel Dunbar [Fri, 14 May 2010 18:53:40 +0000 (18:53 +0000)]
MC/Mach-O/x86_64: Darwin's special "signed_N" relocation types should only be
used to replace a normal relocation, not a reference to a GOT entry.

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

14 years agoSimplify the handling of physreg defs and uses in RegAllocFast.
Jakob Stoklund Olesen [Fri, 14 May 2010 18:03:25 +0000 (18:03 +0000)]
Simplify the handling of physreg defs and uses in RegAllocFast.

This adds extra security against using clobbered physregs, and it adds kill
markers to physreg uses.

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

14 years agoSet isTerminator on TRAP instructions.
Dan Gohman [Fri, 14 May 2010 16:46:02 +0000 (16:46 +0000)]
Set isTerminator on TRAP instructions.

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

14 years agoDon't use isBarrier for the PowerPC sync instruction. isBarrier is for
Dan Gohman [Fri, 14 May 2010 16:42:16 +0000 (16:42 +0000)]
Don't use isBarrier for the PowerPC sync instruction. isBarrier is for
control barriers, not memory ordering barriers.

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

14 years agoAdd mayLoad and mayStore flags to instructions which missed them.
Dan Gohman [Fri, 14 May 2010 16:34:55 +0000 (16:34 +0000)]
Add mayLoad and mayStore flags to instructions which missed them.

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

14 years agoUse regular PassManager instead of FunctionPassManager in opt, since it
Dan Gohman [Fri, 14 May 2010 15:36:54 +0000 (15:36 +0000)]
Use regular PassManager instead of FunctionPassManager in opt, since it
isn't doing lazy streaming. This also fixes a missing doFinalization call.

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

14 years agoUse PassManagerBase, to give clients the option of using either
Dan Gohman [Fri, 14 May 2010 15:35:10 +0000 (15:35 +0000)]
Use PassManagerBase, to give clients the option of using either
FunctionPassManager or regular PassManager.

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

14 years agoAdd an isNodeHidden to the graph traits, to support definition of
Dan Gohman [Fri, 14 May 2010 15:29:31 +0000 (15:29 +0000)]
Add an isNodeHidden to the graph traits, to support definition of
subgraph views.

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

14 years agoXFAIL the test I added with vg_leak, apparently it is the first and only llc
Daniel Dunbar [Fri, 14 May 2010 07:47:51 +0000 (07:47 +0000)]
XFAIL the test I added with vg_leak, apparently it is the first and only llc
-filetype=obj test, and -filetype=obj leaks a few objects. Added a FIXME, we
need to sort out the ownership model for the various MC objects.

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

14 years agoGet rid of the bit twiddling to read / set OpActions and ValueTypeActions. The small...
Evan Cheng [Fri, 14 May 2010 07:37:40 +0000 (07:37 +0000)]
Get rid of the bit twiddling to read / set OpActions and ValueTypeActions. The small saving in memory isn't worth the increase in runtime and code complexity in my opinion.

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

14 years agoInline Asm: Ensure buffer is newline terminated to match how the text is printed.
Daniel Dunbar [Fri, 14 May 2010 04:31:50 +0000 (04:31 +0000)]
Inline Asm: Ensure buffer is newline terminated to match how the text is printed.
 - This is a hack, but I can't decide the best place to handle this. Chris?

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

14 years agoEnable opportunistic coalescing
Jakob Stoklund Olesen [Fri, 14 May 2010 04:30:51 +0000 (04:30 +0000)]
Enable opportunistic coalescing

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

14 years agoAdded a QQQQ register file to model 4-consecutive Q registers.
Evan Cheng [Fri, 14 May 2010 02:13:41 +0000 (02:13 +0000)]
Added a QQQQ register file to model 4-consecutive Q registers.

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

14 years agoAdd AsmParser support for darwin tbss directive.
Eric Christopher [Fri, 14 May 2010 01:50:28 +0000 (01:50 +0000)]
Add AsmParser support for darwin tbss directive.

Nothing uses this yet.

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

14 years agoFix a couple of typos.
Eric Christopher [Fri, 14 May 2010 01:38:54 +0000 (01:38 +0000)]
Fix a couple of typos.

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

14 years agoFix typo.
Nick Lewycky [Fri, 14 May 2010 01:02:48 +0000 (01:02 +0000)]
Fix typo.

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

14 years agoMC: Switch to completely lazy layout.
Daniel Dunbar [Fri, 14 May 2010 00:51:14 +0000 (00:51 +0000)]
MC: Switch to completely lazy layout.
 - The eliminates the last major algorithmic problem with MC.

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

14 years agoMC: Extend MCAsmLayout to explicitly track which fragments have been layed out, and...
Daniel Dunbar [Fri, 14 May 2010 00:37:21 +0000 (00:37 +0000)]
MC: Extend MCAsmLayout to explicitly track which fragments have been layed out, and enforce several invariants to LayoutFragment to ensure we only do layout in a sensible order.

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

14 years agoMC: Implicitly assign section addresses when the previous fragment is layed out.
Daniel Dunbar [Fri, 14 May 2010 00:37:17 +0000 (00:37 +0000)]
MC: Implicitly assign section addresses when the previous fragment is layed out.

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

14 years agoMC: Switch MCFragment to storing the layout order index, not its index in the file.
Daniel Dunbar [Fri, 14 May 2010 00:37:14 +0000 (00:37 +0000)]
MC: Switch MCFragment to storing the layout order index, not its index in the file.

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

14 years agoMC: Change LayoutSection() to only do the section initializiation.
Daniel Dunbar [Fri, 14 May 2010 00:37:11 +0000 (00:37 +0000)]
MC: Change LayoutSection() to only do the section initializiation.

Also, elimminate MCAsmLayout::set*, which are no longer needed.

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

14 years agoFix comments.
Evan Cheng [Fri, 14 May 2010 00:21:45 +0000 (00:21 +0000)]
Fix comments.

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

14 years agoTrust kill flags from isel and later passes.
Jakob Stoklund Olesen [Fri, 14 May 2010 00:02:23 +0000 (00:02 +0000)]
Trust kill flags from isel and later passes.

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

14 years agoFix an embarrassing runtime regression for RegAllocFast.
Jakob Stoklund Olesen [Fri, 14 May 2010 00:02:20 +0000 (00:02 +0000)]
Fix an embarrassing runtime regression for RegAllocFast.

This loop is quadratic in the capacity for a DenseMap:

  while(!map.empty())
    map.erase(map.begin());

Instead we now do a normal begin() - end() iteration followed by map.clear().
That also has the nice sideeffect of shrinking the map capacity on demand.

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