oota-llvm.git
12 years agoCast unused parameter to void.
Hans Wennborg [Sat, 4 Jun 2011 16:00:19 +0000 (16:00 +0000)]
Cast unused parameter to void.

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

12 years agoIf the block that we're threading through is jumped to by an indirect branch,
Bill Wendling [Sat, 4 Jun 2011 09:42:04 +0000 (09:42 +0000)]
If the block that we're threading through is jumped to by an indirect branch,
then we don't want to set the destination in the indirect branch to the
destination. This is because the indirect branch needs its destinations to have
had their block addresses taken. This isn't so of the new critical edge that's
split during this process. If it turns out that the destination block has only
one predecessor, and that being a BB with an indirect branch, then it won't be
marked as 'used' and may be removed.
PR10072

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

12 years agoDrop a RecordKeeper reference that wasn't necessary.
Jakob Stoklund Olesen [Sat, 4 Jun 2011 07:49:55 +0000 (07:49 +0000)]
Drop a RecordKeeper reference that wasn't necessary.

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

12 years agoAdd a testcase to demonstrate the problem where phi translation is
Dan Gohman [Sat, 4 Jun 2011 07:05:05 +0000 (07:05 +0000)]
Add a testcase to demonstrate the problem where phi translation is
ignored for clobbering partial-alias loads.

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

12 years agoReapply r131781, now that the GVN bug with partially-aliasing loads
Dan Gohman [Sat, 4 Jun 2011 06:50:18 +0000 (06:50 +0000)]
Reapply r131781, now that the GVN bug with partially-aliasing loads
is disabled.

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

12 years agoDisable the main feature of 130180, the elimination of loads that are
Dan Gohman [Sat, 4 Jun 2011 06:48:50 +0000 (06:48 +0000)]
Disable the main feature of 130180, the elimination of loads that are
redundant with partially-aliasing loads.

When computing what portion of a clobbering load value is needed,
it doesn't consider phi-translation which may have occurred
between the clobbing load and the redundant load.

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

12 years agoRemove this test, which should have been reverted along with r131781.
Dan Gohman [Sat, 4 Jun 2011 06:21:23 +0000 (06:21 +0000)]
Remove this test, which should have been reverted along with r131781.

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

12 years agoUse processor name in the target triple. This fixes PowerPC64 to generate
Roman Divacky [Sat, 4 Jun 2011 06:15:42 +0000 (06:15 +0000)]
Use processor name in the target triple. This fixes PowerPC64 to generate
64bit code for example.

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

12 years agoRevert r131781 again. Apparently there is more going on here.
Dan Gohman [Sat, 4 Jun 2011 05:11:22 +0000 (05:11 +0000)]
Revert r131781 again. Apparently there is more going on here.

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

12 years agoSilence compiler warnings.
Jakob Stoklund Olesen [Sat, 4 Jun 2011 05:09:36 +0000 (05:09 +0000)]
Silence compiler warnings.

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

12 years agoTeach TableGen to evaluate DAG expressions as set operations.
Jakob Stoklund Olesen [Sat, 4 Jun 2011 04:11:37 +0000 (04:11 +0000)]
Teach TableGen to evaluate DAG expressions as set operations.

A TableGen backend can define how certain classes can be expanded into
ordered sets of defs, typically by evaluating a specific field in the
record. The SetTheory class can then evaluate DAG expressions that refer
to these named sets.

A number of standard set and list operations are predefined, and the
backend can add more specialized operators if needed. The -print-sets
backend is used by SetTheory.td to provide examples.

This is intended to simplify how register classes are defined:

  def GR32_NOSP : RegisterClass<"X86", [i32], 32, (sub GR32, ESP)>;

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

12 years agoFold assert-only-used variable into the assert.
Nick Lewycky [Sat, 4 Jun 2011 02:07:10 +0000 (02:07 +0000)]
Fold assert-only-used variable into the assert.

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

12 years agoMissing include of climits in the new BranchProbability pass.
Andrew Trick [Sat, 4 Jun 2011 01:30:52 +0000 (01:30 +0000)]
Missing include of climits in the new BranchProbability pass.

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

12 years agoNew BranchProbabilityInfo analysis. Patch by Jakub Staszak!
Andrew Trick [Sat, 4 Jun 2011 01:16:30 +0000 (01:16 +0000)]
New BranchProbabilityInfo analysis. Patch by Jakub Staszak!

BranchProbabilityInfo provides an interface for IR passes to query the
likelihood that control follows a CFG edge. This patch provides an
initial implementation of static branch predication that will populate
BranchProbabilityInfo for branches with no external profile
information using very simple heuristics. It currently isn't hooked up
to any external profile data, so static prediction does all the work.

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

12 years agoReapply r131781 (revert r131809), now that some BasicAA shortcomings
Dan Gohman [Sat, 4 Jun 2011 00:46:31 +0000 (00:46 +0000)]
Reapply r131781 (revert r131809), now that some BasicAA shortcomings
it exposed are fixed.

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

12 years agoFix BasicAA's recursion detection so that it doesn't pessimize
Dan Gohman [Sat, 4 Jun 2011 00:31:50 +0000 (00:31 +0000)]
Fix BasicAA's recursion detection so that it doesn't pessimize
queries in the case of a DAG, where a query reaches a node
visited earlier, but it's not on a cycle. This avoids
MayAlias results in cases where BasicAA is expected to
return MustAlias or PartialAlias in order to protect TBAA.

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

12 years agoReapply 132424 with fixes. This fixes PR10068.
Stuart Hastings [Fri, 3 Jun 2011 23:53:54 +0000 (23:53 +0000)]
Reapply 132424 with fixes.  This fixes PR10068.
rdar://problem/5993888

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

12 years agoFix some tests that depend on register allocation.
Jakob Stoklund Olesen [Fri, 3 Jun 2011 22:45:21 +0000 (22:45 +0000)]
Fix some tests that depend on register allocation.

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

12 years agoBlackfin always uses a reserved call frame.
Jakob Stoklund Olesen [Fri, 3 Jun 2011 22:45:18 +0000 (22:45 +0000)]
Blackfin always uses a reserved call frame.

Materializing the stack pointer update before a call requires a scratch
register that may not be available.

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

12 years agoAnother possible bug. Stopgap until we can autogenerate tables and
Eric Christopher [Fri, 3 Jun 2011 22:09:12 +0000 (22:09 +0000)]
Another possible bug. Stopgap until we can autogenerate tables and
constraint lengths.

Part of rdar://9037836 and rdar://9119939

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

12 years agoTestcase for llvm-gcc commit r132591.
Eric Christopher [Fri, 3 Jun 2011 20:56:31 +0000 (20:56 +0000)]
Testcase for llvm-gcc commit r132591.

Part of rdar://9037836 and rdar://9119939

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

12 years agoFix an off by one error.
Eric Christopher [Fri, 3 Jun 2011 20:44:52 +0000 (20:44 +0000)]
Fix an off by one error.

Part of rdar://9037836 and rdar://9119939

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

12 years agoRemove testcase. It's problematic for the buildbots.
Bill Wendling [Fri, 3 Jun 2011 20:43:58 +0000 (20:43 +0000)]
Remove testcase. It's problematic for the buildbots.

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

12 years agoSwitch AllocationOrder to using RegisterClassInfo instead of a BitVector
Jakob Stoklund Olesen [Fri, 3 Jun 2011 20:34:53 +0000 (20:34 +0000)]
Switch AllocationOrder to using RegisterClassInfo instead of a BitVector
of reserved registers.

Use RegisterClassInfo in RABasic as well. This slightly changes som
allocation orders because RegisterClassInfo puts CSR aliases last.

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

12 years agoPreserve the original ordering when a CSR has multiple aliases.
Jakob Stoklund Olesen [Fri, 3 Jun 2011 20:34:50 +0000 (20:34 +0000)]
Preserve the original ordering when a CSR has multiple aliases.

Previously, these aliases would be ordered alphabetically. (BH, BL)

Print out the computed allocation orders.

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

12 years agoWhen merging MustAlias and PartialAlias, chose PartialAlias instead
Dan Gohman [Fri, 3 Jun 2011 20:17:36 +0000 (20:17 +0000)]
When merging MustAlias and PartialAlias, chose PartialAlias instead
of conservatively choosing MayAlias.

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

12 years agoUse IRBuilder, preserve line numbers.
Devang Patel [Fri, 3 Jun 2011 19:46:19 +0000 (19:46 +0000)]
Use IRBuilder, preserve line numbers.

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

12 years agoAccomodate front-ends which use private instead of internal here.
Bill Wendling [Fri, 3 Jun 2011 19:21:05 +0000 (19:21 +0000)]
Accomodate front-ends which use private instead of internal here.

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

12 years agoMake the Uv constraint a memory operand. This doesn't solve the
Eric Christopher [Fri, 3 Jun 2011 17:24:37 +0000 (17:24 +0000)]
Make the Uv constraint a memory operand. This doesn't solve the
addressing mode problem mentioned in r132559.

Backend part of rdar://9037836 and part of rdar://9119939

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

12 years agoAdd a TODO about memory operands.
Eric Christopher [Fri, 3 Jun 2011 17:21:23 +0000 (17:21 +0000)]
Add a TODO about memory operands.

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

12 years agoTest commit.
Hans Wennborg [Fri, 3 Jun 2011 17:15:37 +0000 (17:15 +0000)]
Test commit.

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

12 years agoA typedef's context is not the same as type's context. It is the context of typedef...
Devang Patel [Fri, 3 Jun 2011 17:04:51 +0000 (17:04 +0000)]
A typedef's context is not the same as type's context. It is the context of typedef decl itself. Use extra parameter to communicate this to DIBuilder.

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

12 years agoRevert name change from r132533. Lower case naming was intended per style guidelines.
Chad Rosier [Fri, 3 Jun 2011 17:02:19 +0000 (17:02 +0000)]
Revert name change from r132533.  Lower case naming was intended per style guidelines.

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

12 years agoFix wrong usages of CTR/MCTR where CTR8/MCTR8 was meant.
Roman Divacky [Fri, 3 Jun 2011 15:47:49 +0000 (15:47 +0000)]
Fix wrong usages of CTR/MCTR where CTR8/MCTR8 was meant.

- Check for MTCTR8 in addition to MTCTR when looking up a hazard.

- When lowering an indirect call use CTR8 when targeting 64bit.

- Introduce BCTR8 that uses CTR8 and use it on 64bit when expanding ISD::BRIND.

The last change fixes PR8487. With those changes, we are able to compile a
running "ls" and "sh" on FreeBSD/PowerPC64.

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

12 years agosinged int causes signed extension, which contradicts the intention to pick up
Zhongxing Xu [Fri, 3 Jun 2011 08:29:51 +0000 (08:29 +0000)]
singed int causes signed extension, which contradicts the intention to pick up
integers with high 32 bits being zero.

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

12 years agoRework the logic to not rely on undefined behaviour (1LL << 64). Also simplify.
Nick Lewycky [Fri, 3 Jun 2011 08:25:39 +0000 (08:25 +0000)]
Rework the logic to not rely on undefined behaviour (1LL << 64). Also simplify.

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

12 years agoBail on unswitching a switch statement for a case with a critical edge. We name
Nick Lewycky [Fri, 3 Jun 2011 06:27:15 +0000 (06:27 +0000)]
Bail on unswitching a switch statement for a case with a critical edge. We name
which edge to split by pred/succ pair, which means that we can end up splitting
the wrong edge (by case value) in the switch statement entirely. Fixes PR10031!

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

12 years agoWhitespace and other cleanup. Functionallity unchanged.
Chad Rosier [Fri, 3 Jun 2011 05:09:12 +0000 (05:09 +0000)]
Whitespace and other cleanup.  Functionallity unchanged.

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

12 years agoTreat Win64 EH as a DWARF EH scheme. For GCC-style exceptions, the layout of
Charles Davis [Fri, 3 Jun 2011 05:09:12 +0000 (05:09 +0000)]
Treat Win64 EH as a DWARF EH scheme. For GCC-style exceptions, the layout of
the handler's data area is similar to a DWARF-format LSDA. (It is, in fact,
a 32-bit pointer to the personality routine followed by the DWARF LSDA.)

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

12 years agoCorrections and additional information for "Creating and LLVM Project"
Andrew Trick [Fri, 3 Jun 2011 02:20:48 +0000 (02:20 +0000)]
Corrections and additional information for "Creating and LLVM Project"
documentation. This should now reflect the current state of LLVM Makefiles.

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

12 years agowhitespace
Andrew Trick [Fri, 3 Jun 2011 02:16:53 +0000 (02:16 +0000)]
whitespace

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

12 years agoAdd ARM fast-isel support for materializing the address of a global in cases where...
Eli Friedman [Fri, 3 Jun 2011 01:13:19 +0000 (01:13 +0000)]
Add ARM fast-isel support for materializing the address of a global in cases where the global uses an indirect symbol.

rdar://9431157

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

12 years agoBasic PassManager diagnostics.
Andrew Trick [Fri, 3 Jun 2011 00:48:58 +0000 (00:48 +0000)]
Basic PassManager diagnostics.

Added asserts whenever attempting to use a potentially
uninitialized pass. This helps people trying to develop a new pass and
people trying to understand the bug reports filed by the former people.

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

12 years agowhitespace
Andrew Trick [Fri, 3 Jun 2011 00:44:32 +0000 (00:44 +0000)]
whitespace

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

12 years agoTest case pasto (failed when run with IR verifier).
Andrew Trick [Thu, 2 Jun 2011 23:57:27 +0000 (23:57 +0000)]
Test case pasto (failed when run with IR verifier).

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

12 years agoAvoid calling TRI->getAllocatableSet in RAFast.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 23:41:40 +0000 (23:41 +0000)]
Avoid calling TRI->getAllocatableSet in RAFast.

When compiling a program with lots of small functions like
483.xalancbmk, this makes RAFast 11% faster.

Add some comments to clarify the difference between unallocatable and
reserved registers. It's quite subtle.

The fast register allocator depends on EFLAGS' not being allocatable on
x86. That way it can completely avoid tracking liveness, and it won't
mind when there are multiple uses of a single def.

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

12 years agoHave LowerOperandForConstraint handle multiple character constraints.
Eric Christopher [Thu, 2 Jun 2011 23:16:42 +0000 (23:16 +0000)]
Have LowerOperandForConstraint handle multiple character constraints.

Part of rdar://9119939

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

12 years agoFlag unallocatable register classes instead of giving them empty
Jakob Stoklund Olesen [Thu, 2 Jun 2011 23:07:24 +0000 (23:07 +0000)]
Flag unallocatable register classes instead of giving them empty
allocation orders.

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

12 years agoMake it possible to have unallocatable register classes.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 23:07:20 +0000 (23:07 +0000)]
Make it possible to have unallocatable register classes.

Some register classes are only used for instruction operand constraints.
They should never be used for virtual registers. Previously, those
register classes were given an empty allocation order, but now you can
say 'let isAllocatable=0' in the register class definition.

TableGen calculates if a register is part of any allocatable register
class, and makes that information available in TargetRegisterDesc::inAllocatableClass.

The goal here is to eliminate use cases for overriding allocation_order_*
methods.

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

12 years agoPreserve line number information while converting Invoke into a Call.
Devang Patel [Thu, 2 Jun 2011 22:46:58 +0000 (22:46 +0000)]
Preserve line number information while converting Invoke into a Call.

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

12 years agoThis should have been a C++ testcase.
Bill Wendling [Thu, 2 Jun 2011 22:26:15 +0000 (22:26 +0000)]
This should have been a C++ testcase.

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

12 years agoJust use a SmallVector.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 22:22:43 +0000 (22:22 +0000)]
Just use a SmallVector.

I was confused whether new uint8_t[] would zero-initialize the returned
array, and it seems that so is gcc-4.0.

This should fix the test failures on darwin 9.

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

12 years agoTestcase for r132493.
Bill Wendling [Thu, 2 Jun 2011 22:12:42 +0000 (22:12 +0000)]
Testcase for r132493.

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

12 years agoUpdate for r132493 change.
Bill Wendling [Thu, 2 Jun 2011 22:11:49 +0000 (22:11 +0000)]
Update for r132493 change.

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

12 years agoRemove dead code.
Devang Patel [Thu, 2 Jun 2011 21:31:00 +0000 (21:31 +0000)]
Remove dead code.

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

12 years agoUpdate DBG_VALUEs while breaking anti dependencies.
Devang Patel [Thu, 2 Jun 2011 21:26:52 +0000 (21:26 +0000)]
Update DBG_VALUEs while breaking anti dependencies.

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

12 years agoFix encoding for VEXTdf.
Tanya Lattner [Thu, 2 Jun 2011 21:25:24 +0000 (21:25 +0000)]
Fix encoding for VEXTdf.

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

12 years agoPR10067: Add missing safety check to call return transformation in MemCpyOpt::process...
Eli Friedman [Thu, 2 Jun 2011 21:24:42 +0000 (21:24 +0000)]
PR10067: Add missing safety check to call return transformation in MemCpyOpt::processStore.  If something accesses the dest of the "copy" between the call and the copy, the performCallSlotOptzn transformation is not valid.

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

12 years agoDuring post RA scheduling, do not try to chase reg defs. to preserve DBG_VALUEs....
Devang Patel [Thu, 2 Jun 2011 20:07:12 +0000 (20:07 +0000)]
During post RA scheduling, do not try to chase reg defs. to preserve DBG_VALUEs. This approach has several downsides, for example, it does not work when dbg value is a constant integer, it does not work if reg is defined more than once, it places end of debug value range markers in the wrong place. It even causes misleading incorrect debug info when duplicate DBG_VALUE instructions point to same reg def.

Instead, use simpler approach and let DBG_VALUE follow its predecessor instruction. After live debug value analysis pass, all DBG_VALUE instruction are placed at the right place. Thanks Jakob for the hint!

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

12 years agoAdd test for PR10068.
Rafael Espindola [Thu, 2 Jun 2011 20:02:48 +0000 (20:02 +0000)]
Add test for PR10068.

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

12 years agoRevert 132424 to fix PR10068.
Rafael Espindola [Thu, 2 Jun 2011 19:57:47 +0000 (19:57 +0000)]
Revert 132424 to fix PR10068.

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

12 years agoAndy pointed out a dumb omission in this test case. Thanks Andy!
Stuart Hastings [Thu, 2 Jun 2011 19:26:49 +0000 (19:26 +0000)]
Andy pointed out a dumb omission in this test case.  Thanks Andy!

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

12 years agoAdd a new parse hint for multi-letter constraints in inline asm.
Eric Christopher [Thu, 2 Jun 2011 19:26:37 +0000 (19:26 +0000)]
Add a new parse hint for multi-letter constraints in inline asm.

Testcase will come when we use it.

Part of rdar://9119939

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

12 years agoJakob pointed out a dumb omission in this test case. Thanks Jakob!
Stuart Hastings [Thu, 2 Jun 2011 18:44:05 +0000 (18:44 +0000)]
Jakob pointed out a dumb omission in this test case.  Thanks Jakob!

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

12 years agoUse RegisterClassInfo::getOrder in RAFast.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 18:35:30 +0000 (18:35 +0000)]
Use RegisterClassInfo::getOrder in RAFast.

This saves two virtual function calls and an Allocatable BitVector test,
making RAFast run 2% faster.

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

12 years ago.cfi directive register parsing flexibility.
Jim Grosbach [Thu, 2 Jun 2011 17:14:04 +0000 (17:14 +0000)]
.cfi directive register parsing flexibility.

Parsing a register name/number for .cfi directives can't assume that a
register name starts with a '%' token. Be more flexible and check for a
register number instead. Still unlikely to be perfect, but it allows us
to parse both plain identifiers as register names and integers as register
numbers, which is what we're wanting to support at this point.

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

12 years agoOmit unnecessary stack copy when x87 input is a load.
Stuart Hastings [Thu, 2 Jun 2011 15:57:11 +0000 (15:57 +0000)]
Omit unnecessary stack copy when x87 input is a load.
rdar://problem/6373334

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

12 years agoStart with a zeroed CSRNum map.
Benjamin Kramer [Thu, 2 Jun 2011 12:07:44 +0000 (12:07 +0000)]
Start with a zeroed CSRNum map.

Found by valgrind.

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

12 years agoInitialize members to fix problem found by valgrind.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 05:43:49 +0000 (05:43 +0000)]
Initialize members to fix problem found by valgrind.

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

12 years agoUse TRI::has{Sub,Super}ClassEq() where possible.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 05:43:46 +0000 (05:43 +0000)]
Use TRI::has{Sub,Super}ClassEq() where possible.

No functional change.

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

12 years agoTweak testcase for ARM bot. rdar://problem/5993888
Stuart Hastings [Thu, 2 Jun 2011 05:05:39 +0000 (05:05 +0000)]
Tweak testcase for ARM bot.  rdar://problem/5993888

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

12 years agoDon't hardcode the %reg format in the streamer.
Rafael Espindola [Thu, 2 Jun 2011 02:34:55 +0000 (02:34 +0000)]
Don't hardcode the %reg format in the streamer.

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

12 years agoAdd a RegisterClassInfo class that lazily caches information about
Jakob Stoklund Olesen [Thu, 2 Jun 2011 02:19:35 +0000 (02:19 +0000)]
Add a RegisterClassInfo class that lazily caches information about
register classes.

It provides information for each register class that cannot be
determined statically, like:

- The number of allocatable registers in a class after filtering out the
  reserved and invalid registers.

- The preferred allocation order with registers that overlap callee-saved
  registers last.

- The last callee-saved register that overlaps a given physical register.

This information usually doesn't change between functions, so it is
reused for compiling multiple functions when possible.  The many
possible combinations of reserved and callee saves registers makes it
unfeasible to compute this information statically in TableGen.

Use RegisterClassInfo to count available registers in various heuristics
in SimpleRegisterCoalescing, making the pass run 4% faster.

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

12 years agoDetect FI|cst pattern in MipsDAGToDAGISel::SelectAddr. Patch by Sasa Stankovic.
Akira Hatanaka [Thu, 2 Jun 2011 01:03:14 +0000 (01:03 +0000)]
Detect FI|cst pattern in MipsDAGToDAGISel::SelectAddr. Patch by Sasa Stankovic.

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

12 years agoTest case for r132444.
Akira Hatanaka [Thu, 2 Jun 2011 00:25:53 +0000 (00:25 +0000)]
Test case for r132444.

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

12 years agoCustom-lower FRAMEADDR. Patch by Sasa Stankovic.
Akira Hatanaka [Thu, 2 Jun 2011 00:24:44 +0000 (00:24 +0000)]
Custom-lower FRAMEADDR. Patch by Sasa Stankovic.

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

12 years agoWhen marking a block as being unanalyzable, use "Clobber" on the terminator instead...
Eli Friedman [Thu, 2 Jun 2011 00:08:52 +0000 (00:08 +0000)]
When marking a block as being unanalyzable, use "Clobber" on the terminator instead of the first instruction in the block.  This is a bit of a hack; "Clobber" isn't really the right marking in the first place.  memdep doesn't really have any way of properly expressing "unanalyzable" at the moment.  Using it on the terminator is much less ambiguous than using it on an arbitrary instruction, though.

In the given testcase, the "Clobber" was pointing to a load, and GVN was incorrectly assuming that meant that the "Clobber" load overlapped the load being analyzed (when they are actually unrelated).

The included testcase tests both this commit and r132434.

Part two of rdar://9429882.  (r132434 was mislabeled.)

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

12 years agoTypos.
Chad Rosier [Wed, 1 Jun 2011 23:32:40 +0000 (23:32 +0000)]
Typos.

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

12 years agoIn MemoryDependenceAnalysis::getNonLocalPointerDepFromBB, if a given block is is...
Eli Friedman [Wed, 1 Jun 2011 23:16:53 +0000 (23:16 +0000)]
In MemoryDependenceAnalysis::getNonLocalPointerDepFromBB, if a given block is is deemed unanalyzable (and we execute one of the "goto PredTranslationFailure" statements), make sure we don't put information about the predecessors of that block into the returned data structures; this can lead to, among other things, extraneous results (which will confuse passes using memdep).  Fixes an assert in GVN compiling ruby. Part of rdar://problem/9521954 .

Testcase coming up soon.

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

12 years agoA DBG_VALUE that truncates a range does not start another dbg value range.
Devang Patel [Wed, 1 Jun 2011 23:00:17 +0000 (23:00 +0000)]
A DBG_VALUE that truncates a range does not start another dbg value range.

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

12 years agoDo not drop constant values when a variable's content is described using .debug_loc...
Devang Patel [Wed, 1 Jun 2011 22:03:25 +0000 (22:03 +0000)]
Do not drop constant values when a variable's content is described using .debug_loc entries.

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

12 years agoRecommit 132404 with fixes. rdar://problem/5993888
Stuart Hastings [Wed, 1 Jun 2011 21:33:14 +0000 (21:33 +0000)]
Recommit 132404 with fixes.  rdar://problem/5993888

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

12 years agoAllow bitcasts between valid types of the same size and vector
Eric Christopher [Wed, 1 Jun 2011 19:55:10 +0000 (19:55 +0000)]
Allow bitcasts between valid types of the same size and vector
types if the vector type is legal.

Fixes rdar://9306086

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

12 years agoRevert 132404 to appease a buildbot. rdar://problem/5993888
Stuart Hastings [Wed, 1 Jun 2011 19:52:20 +0000 (19:52 +0000)]
Revert 132404 to appease a buildbot.  rdar://problem/5993888

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

12 years agoRefactor LegalizeTypes: Erase LegalizeAction and make the type legalizer use
Nadav Rotem [Wed, 1 Jun 2011 19:47:10 +0000 (19:47 +0000)]
Refactor LegalizeTypes: Erase LegalizeAction and make the type legalizer use
the TargetLowering enum.

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

12 years agoSCEV: missing null check fix for r132360, dragonegg crash.
Andrew Trick [Wed, 1 Jun 2011 19:14:56 +0000 (19:14 +0000)]
SCEV: missing null check fix for r132360, dragonegg crash.

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

12 years agoRevert r132358 "Simplify the eviction policy by making the failsafe explicit."
Jakob Stoklund Olesen [Wed, 1 Jun 2011 18:45:02 +0000 (18:45 +0000)]
Revert r132358 "Simplify the eviction policy by making the failsafe explicit."

This commit caused regressions in i386 flops-[568], matrix, salsa20,
256.bzip2, and enc-md5.

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

12 years agoFix double FGETSIGN to work on x86_32; followup to 132396.
Stuart Hastings [Wed, 1 Jun 2011 18:32:25 +0000 (18:32 +0000)]
Fix double FGETSIGN to work on x86_32; followup to 132396.
rdar://problem/5660695

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

12 years agoAdd a testcase, enabled only on arm, for llvm-gcc r132366.
Eric Christopher [Wed, 1 Jun 2011 18:23:56 +0000 (18:23 +0000)]
Add a testcase, enabled only on arm, for llvm-gcc r132366.

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

12 years agoCleanup test case. rdar://problem/5660695
Stuart Hastings [Wed, 1 Jun 2011 18:23:14 +0000 (18:23 +0000)]
Cleanup test case.  rdar://problem/5660695

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

12 years agoInitialize IssueWidth to zero.
Benjamin Kramer [Wed, 1 Jun 2011 17:19:08 +0000 (17:19 +0000)]
Initialize IssueWidth to zero.

Fixes valgrind errors in the CellSPU backend.

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

12 years agoAdd support for x86 CMPEQSS and friends. These instructions do a
Stuart Hastings [Wed, 1 Jun 2011 17:17:45 +0000 (17:17 +0000)]
Add support for x86 CMPEQSS and friends.  These instructions do a
floating-point comparison, generate a mask of 0s or 1s, and generally
DTRT with NaNs.  Only profitable when the user wants a materialized 0
or 1 at runtime.  rdar://problem/5993888

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

12 years agoReapply 132348 with fixes. rdar://problem/6501862
Stuart Hastings [Wed, 1 Jun 2011 16:42:47 +0000 (16:42 +0000)]
Reapply 132348 with fixes.  rdar://problem/6501862

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

12 years agoA forthcoming SSE patch will break this test; since the test is also
Stuart Hastings [Wed, 1 Jun 2011 16:13:09 +0000 (16:13 +0000)]
A forthcoming SSE patch will break this test; since the test is also
valid for x87, re-target to x87.  rdar://problem/5993888

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

12 years agoTest case for 132396. rdar://problem/5660695
Stuart Hastings [Wed, 1 Jun 2011 15:50:29 +0000 (15:50 +0000)]
Test case for 132396.  rdar://problem/5660695

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

12 years agoFix PR10059 and future variations by handling all register subclasses.
Jakob Stoklund Olesen [Wed, 1 Jun 2011 15:32:10 +0000 (15:32 +0000)]
Fix PR10059 and future variations by handling all register subclasses.

Add TargetRegisterInfo::hasSubClassEq and use it to check for compatible
register classes instead of trying to list all register classes in
X86's getLoadStoreRegOpcode.

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

12 years agoTurn on FGETSIGN for x86. Followup to 132388. rdar://problem/5660695
Stuart Hastings [Wed, 1 Jun 2011 14:04:17 +0000 (14:04 +0000)]
Turn on FGETSIGN for x86.  Followup to 132388. rdar://problem/5660695

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

12 years agoAdd new -d option to tblgen. It writes a make(1)-style dependency file.
Joerg Sonnenberger [Wed, 1 Jun 2011 13:10:15 +0000 (13:10 +0000)]
Add new -d option to tblgen. It writes a make(1)-style dependency file.

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

12 years agoThis patch is another step in the direction of adding vector select. In this
Nadav Rotem [Wed, 1 Jun 2011 12:51:46 +0000 (12:51 +0000)]
This patch is another step in the direction of adding vector select. In this
patch we add a flag to enable a new type legalization decision - to promote
integer elements in vectors. Currently, the rest of the codegen does not support
this kind of legalization.  This flag will be removed when the transition is
complete.

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

12 years agoFGETSIGN support for x86, using movmskps/pd. Will be enabled with a
Stuart Hastings [Wed, 1 Jun 2011 04:39:42 +0000 (04:39 +0000)]
FGETSIGN support for x86, using movmskps/pd.  Will be enabled with a
patch to TargetLowering.cpp.  rdar://problem/5660695

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