oota-llvm.git
13 years agoARM estimateStackSize() needs to account for simplified call frames.
Jim Grosbach [Tue, 5 Jul 2011 16:05:50 +0000 (16:05 +0000)]
ARM estimateStackSize() needs to account for simplified call frames.

If the function allocates reserved stack space for callee argument frames,
estimateStackSize() needs to account for that, as it doesn't show up as
ordinary frame objects. Otherwise, a callee with a large argument list will
throw off the calculations for whether to allocate an emergency spill slot
and we get assert() failures in the register scavenger.

rdar://9715469

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

13 years agoFix PR10277.
Jakob Stoklund Olesen [Tue, 5 Jul 2011 15:38:41 +0000 (15:38 +0000)]
Fix PR10277.

Remat during spilling triggers dead code elimination. If a phi-def
becomes unused, that may also cause live ranges to split into separate
connected components.

This type of splitting is different from normal live range splitting. In
particular, there may not be a common original interval.

When the split range is its own original, make sure that the new
siblings are also their own originals. The range being split cannot be
used as an original since it doesn't cover the new siblings.

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

13 years agoTweak comment and debug output.
Jakob Stoklund Olesen [Tue, 5 Jul 2011 15:38:37 +0000 (15:38 +0000)]
Tweak comment and debug output.

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

13 years agoFix 80-col.
Michael J. Spencer [Tue, 5 Jul 2011 14:49:08 +0000 (14:49 +0000)]
Fix 80-col.

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

13 years agoFix warnings.
Michael J. Spencer [Tue, 5 Jul 2011 14:48:59 +0000 (14:48 +0000)]
Fix warnings.

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

13 years agoSuccIterator on bbs without terminator insts
Tobias Grosser [Mon, 4 Jul 2011 23:09:02 +0000 (23:09 +0000)]
SuccIterator on bbs without terminator insts

Remove the assert that triggers if SuccIterator is constructed for a basic block
without a terminator instruction. Instead of triggering an assert a succ_end()
iterator is returned. This models a basic block with zero successors and allows
us to use F->viewCFG() on incompletely constructed functions.

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

13 years agoPR10267: Don't combine an equality compare with an AND into an inequality compare...
Benjamin Kramer [Mon, 4 Jul 2011 20:16:36 +0000 (20:16 +0000)]
PR10267: Don't combine an equality compare with an AND into an inequality compare when the AND has more than one use.

This can pessimize code, inequalities are generally more expensive.

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

13 years agoRemove accidentaly left node from previous iteration of the patch.
Roman Divacky [Mon, 4 Jul 2011 15:42:45 +0000 (15:42 +0000)]
Remove accidentaly left node from previous iteration of the patch.

Noticed by Benjamin Kramer!

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

13 years agoMove early tail duplication earlier.
Rafael Espindola [Mon, 4 Jul 2011 04:54:22 +0000 (04:54 +0000)]
Move early tail duplication earlier.

This fixes the issue noted in PR10251 where early tail dup of bbs with
indirectbr would cause a bb to be duplicated into a loop preheader
and then into its predecessors, creating phi nodes with identical
operands just before register allocation.

This helps with jsinterp.o size (__TEXT goes from 163568 to 126656)
and a bit with performance 1.005x faster on sunspider (jits still enabled).

The result on webkit with the jit disabled is more significant: 1.021x faster.

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

13 years agoMove most of the pre BB code to TailDuplicateAndUpdate. Change the
Rafael Espindola [Mon, 4 Jul 2011 01:21:42 +0000 (01:21 +0000)]
Move most of the pre BB code to TailDuplicateAndUpdate. Change the
HasIndirectbr variable to be just that. No functionality change.

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

13 years agoReduce indentation and fix the count of how many PHIs we have inserted.
Rafael Espindola [Mon, 4 Jul 2011 00:13:36 +0000 (00:13 +0000)]
Reduce indentation and fix the count of how many PHIs we have inserted.

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

13 years agoFix PR10244.
Jakob Stoklund Olesen [Mon, 4 Jul 2011 00:05:28 +0000 (00:05 +0000)]
Fix PR10244.

A split point inserted in a block with a landing pad successor may be
hoisted above the call to ensure that it dominates all successors. The
code that handles the rest of the basic block must take this into
account.

I am not including a test case, it would be very fragile. PR10244 comes
from building clang with exceptions enabled.

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

13 years agoMake the i64 and f64 be 64bit ABI aligned in the target description.
Roman Divacky [Sun, 3 Jul 2011 16:24:07 +0000 (16:24 +0000)]
Make the i64 and f64 be 64bit ABI aligned in the target description.
This is what both the ABI and clang says.

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

13 years agotest/CodeGen/X86/lsr-nonaffine.ll: Relax expressions for Win64 CC to appease Win32...
NAKAMURA Takumi [Sun, 3 Jul 2011 09:26:14 +0000 (09:26 +0000)]
test/CodeGen/X86/lsr-nonaffine.ll: Relax expressions for Win64 CC to appease Win32 hosts.

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

13 years agoFix an easy fixme.
Rafael Espindola [Sun, 3 Jul 2011 05:26:42 +0000 (05:26 +0000)]
Fix an easy fixme.

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

13 years agoFileCheck-ize another test. Reduces the llc invocations from 8 to 1, and
Chandler Carruth [Sat, 2 Jul 2011 21:34:52 +0000 (21:34 +0000)]
FileCheck-ize another test. Reduces the llc invocations from 8 to 1, and
makes one of the tests actually mean something (as the string 'add' will
always appear in the output of this file).

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

13 years agoAvoid writing to an arbitrary filename during the test run by writing to
Chandler Carruth [Sat, 2 Jul 2011 20:43:18 +0000 (20:43 +0000)]
Avoid writing to an arbitrary filename during the test run by writing to
a file descriptor.

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

13 years agoFileCheck-ize another X86 test, making it more precisely verify the
Chandler Carruth [Sat, 2 Jul 2011 20:43:16 +0000 (20:43 +0000)]
FileCheck-ize another X86 test, making it more precisely verify the
desired result based on the comments in the file.

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

13 years agoQuote two greps which contain parentheses.
Chandler Carruth [Sat, 2 Jul 2011 20:43:13 +0000 (20:43 +0000)]
Quote two greps which contain parentheses.

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

13 years agoFileCheck-ize and simplify RUN lines.
Chandler Carruth [Sat, 2 Jul 2011 20:43:11 +0000 (20:43 +0000)]
FileCheck-ize and simplify RUN lines.

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

13 years agoFileCheck-ize
Chandler Carruth [Sat, 2 Jul 2011 20:43:08 +0000 (20:43 +0000)]
FileCheck-ize

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

13 years agoFileCheck-ize and tighten up assertions to only check the relevant sections.
Chandler Carruth [Sat, 2 Jul 2011 20:43:04 +0000 (20:43 +0000)]
FileCheck-ize and tighten up assertions to only check the relevant sections.

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

13 years agoFileCheck-ize and cleanup IR.
Chandler Carruth [Sat, 2 Jul 2011 20:43:01 +0000 (20:43 +0000)]
FileCheck-ize and cleanup IR.

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

13 years agoFileCheck-ize
Chandler Carruth [Sat, 2 Jul 2011 20:42:59 +0000 (20:42 +0000)]
FileCheck-ize

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

13 years agoRemove a grep that is already checked with FileCheck.
Chandler Carruth [Sat, 2 Jul 2011 20:42:56 +0000 (20:42 +0000)]
Remove a grep that is already checked with FileCheck.

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

13 years agoFileCheck-ize
Chandler Carruth [Sat, 2 Jul 2011 20:42:53 +0000 (20:42 +0000)]
FileCheck-ize

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

13 years agoFileCheck-ize and modernize IR.
Chandler Carruth [Sat, 2 Jul 2011 20:42:50 +0000 (20:42 +0000)]
FileCheck-ize and modernize IR.

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

13 years agoFileCheck-ize and simplify RUNs.
Chandler Carruth [Sat, 2 Jul 2011 20:42:48 +0000 (20:42 +0000)]
FileCheck-ize and simplify RUNs.

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

13 years agoFileCheck-ize and modernize the RUN line.
Chandler Carruth [Sat, 2 Jul 2011 20:42:44 +0000 (20:42 +0000)]
FileCheck-ize and modernize the RUN line.

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

13 years agoFileCheck-ize, tightening checks and avoiding a temporary file.
Chandler Carruth [Sat, 2 Jul 2011 20:42:42 +0000 (20:42 +0000)]
FileCheck-ize, tightening checks and avoiding a temporary file.

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

13 years agoFileCheck-ize, tightening checks and avoiding a temporary file.
Chandler Carruth [Sat, 2 Jul 2011 20:42:39 +0000 (20:42 +0000)]
FileCheck-ize, tightening checks and avoiding a temporary file.

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

13 years agoFileCheck-ize
Chandler Carruth [Sat, 2 Jul 2011 20:42:36 +0000 (20:42 +0000)]
FileCheck-ize

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

13 years agoFileCheck-ize
Chandler Carruth [Sat, 2 Jul 2011 20:42:33 +0000 (20:42 +0000)]
FileCheck-ize

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

13 years agoFileCheck-ize a test, avoiding a temporary file.
Chandler Carruth [Sat, 2 Jul 2011 20:42:31 +0000 (20:42 +0000)]
FileCheck-ize a test, avoiding a temporary file.

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

13 years agoFileCheck-ize and simplify this test.
Chandler Carruth [Sat, 2 Jul 2011 20:42:28 +0000 (20:42 +0000)]
FileCheck-ize and simplify this test.

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

13 years agoFileCheck-ize
Chandler Carruth [Sat, 2 Jul 2011 20:42:25 +0000 (20:42 +0000)]
FileCheck-ize

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

13 years agoFileCheck-ize another codegen test.
Chandler Carruth [Sat, 2 Jul 2011 20:42:22 +0000 (20:42 +0000)]
FileCheck-ize another codegen test.

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

13 years agoPartially FileCheck-ize a test to remove a weird quoting situation.
Chandler Carruth [Sat, 2 Jul 2011 20:42:20 +0000 (20:42 +0000)]
Partially FileCheck-ize a test to remove a weird quoting situation.

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

13 years agoFileCheck-ize another test, and upgrade its syntax a bit.
Chandler Carruth [Sat, 2 Jul 2011 20:42:17 +0000 (20:42 +0000)]
FileCheck-ize another test, and upgrade its syntax a bit.

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

13 years agoFileCheck-ize another codegen test, tightening it up.
Chandler Carruth [Sat, 2 Jul 2011 20:42:14 +0000 (20:42 +0000)]
FileCheck-ize another codegen test, tightening it up.

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

13 years agoFileCheck-ize another test, making it much more precise for testing the
Chandler Carruth [Sat, 2 Jul 2011 20:42:11 +0000 (20:42 +0000)]
FileCheck-ize another test, making it much more precise for testing the
individual cases, while hard coding less about registers in use.

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

13 years agoFileCheck-ize another test. This one is more clear and runs fewer
Chandler Carruth [Sat, 2 Jul 2011 20:42:08 +0000 (20:42 +0000)]
FileCheck-ize another test. This one is more clear and runs fewer
commands as a result.

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

13 years agoFileCheck-ize a test, no functionality changed.
Chandler Carruth [Sat, 2 Jul 2011 20:42:06 +0000 (20:42 +0000)]
FileCheck-ize a test, no functionality changed.

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

13 years agoUse subprocess.Popen instead of popen2 to stop a deprecation warning when running...
Jordy Rose [Sat, 2 Jul 2011 17:28:55 +0000 (17:28 +0000)]
Use subprocess.Popen instead of popen2 to stop a deprecation warning when running lit on OS X

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

13 years agoRemove unused array.
Duncan Sands [Sat, 2 Jul 2011 16:36:24 +0000 (16:36 +0000)]
Remove unused array.

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

13 years agoRevert previous commit. It seems that whether casting to void
Duncan Sands [Sat, 2 Jul 2011 13:14:22 +0000 (13:14 +0000)]
Revert previous commit.  It seems that whether casting to void
is valid or not depends on which system you build.

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

13 years agoSupress gcc-4.5 warning about the result not being used.
Duncan Sands [Sat, 2 Jul 2011 13:06:23 +0000 (13:06 +0000)]
Supress gcc-4.5 warning about the result not being used.

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

13 years agoRemove unused constant.
Duncan Sands [Sat, 2 Jul 2011 13:05:02 +0000 (13:05 +0000)]
Remove unused constant.

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

13 years agoUse getVNInfoAt.
Rafael Espindola [Sat, 2 Jul 2011 07:50:27 +0000 (07:50 +0000)]
Use getVNInfoAt.

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

13 years agoConsistent diagnostic capitalization and redundant context elimination.
Jakob Stoklund Olesen [Sat, 2 Jul 2011 07:23:40 +0000 (07:23 +0000)]
Consistent diagnostic capitalization and redundant context elimination.

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

13 years agoBetter diagnostics when inline asm fails to allocate.
Jakob Stoklund Olesen [Sat, 2 Jul 2011 07:17:37 +0000 (07:17 +0000)]
Better diagnostics when inline asm fails to allocate.

asm.c:2:7: error: ran out of registers during register allocation
  asm(""::"r"(0), "r"(1), "r"(2), "r"(3), "r"(4), "r"(5), "r"(6), "r"(7), "r"(8), "r"(9));
        ^

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

13 years agoCheck the VN of the src register at the two copies, not just the
Rafael Espindola [Sat, 2 Jul 2011 05:34:02 +0000 (05:34 +0000)]
Check the VN of the src register at the two copies, not just the
register number.

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

13 years agoBe less specific about register allocation ordering.
Eric Christopher [Sat, 2 Jul 2011 04:06:41 +0000 (04:06 +0000)]
Be less specific about register allocation ordering.

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

13 years agoInclude a source location when complaining about bad inline assembly.
Jakob Stoklund Olesen [Sat, 2 Jul 2011 03:53:34 +0000 (03:53 +0000)]
Include a source location when complaining about bad inline assembly.

Add a MI->emitError() method that the backend can use to report errors
related to inline assembly. Call it from X86FloatingPoint.cpp when the
constraints are wrong.

This enables proper clang diagnostics from the backend:

$ clang -c pr30848.c
pr30848.c:5:12: error: Inline asm output regs must be last on the x87 stack
  __asm__ ("" : "=u" (d));  /* { dg-error "output regs" } */
           ^
1 error generated.

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

13 years agoindvars -disable-iv-rewrite: bug fix involving weird geps and related cleanup.
Andrew Trick [Sat, 2 Jul 2011 02:34:25 +0000 (02:34 +0000)]
indvars -disable-iv-rewrite: bug fix involving weird geps and related cleanup.

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

13 years agoUse a new strategy for preventing eviction loops in RAGreedy.
Jakob Stoklund Olesen [Sat, 2 Jul 2011 01:37:09 +0000 (01:37 +0000)]
Use a new strategy for preventing eviction loops in RAGreedy.

Every live range is assigned a cascade number the first time it is
involved in an eviction. As the evictor, it gets a new cascade number.
Every evictee is assigned the same cascade number as the evictor.

Eviction is prohibited if the evictor has a lower assigned cascade
number than the evictee.

This means that assigned cascade numbers are monotonically increasing
with every eviction, yet they are bounded by NextCascade which can only
be incremented by new live ranges. Thus, infinite loops cannot happen,
but eviction cascades can still be triggered by new live ranges as we
want.

Thanks to Andy for explaining this to me.

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

13 years agoAdd getFeatureBits to extract feature bits for a given CPU.
Evan Cheng [Sat, 2 Jul 2011 00:43:44 +0000 (00:43 +0000)]
Add getFeatureBits to extract feature bits for a given CPU.

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

13 years agoRemove the confusing getDarwinNumber() api and friends.
Eric Christopher [Sat, 2 Jul 2011 00:19:55 +0000 (00:19 +0000)]
Remove the confusing getDarwinNumber() api and friends.

Part of rdar://9714064

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

13 years agoTake a stab at fixing the llvm-x86_64-linux-checks failure.
Cameron Zwarich [Fri, 1 Jul 2011 23:45:21 +0000 (23:45 +0000)]
Take a stab at fixing the llvm-x86_64-linux-checks failure.

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

13 years agoTargetConstant immediates won't be placed into registers so tighten
Eric Christopher [Fri, 1 Jul 2011 23:04:38 +0000 (23:04 +0000)]
TargetConstant immediates won't be placed into registers so tighten
up the valid constant check earlier.

rdar://9692967

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

13 years agoAdd initial *-*-rtems* target, from Joel Sherrill
Douglas Gregor [Fri, 1 Jul 2011 22:41:06 +0000 (22:41 +0000)]
Add initial *-*-rtems* target, from Joel Sherrill

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

13 years agoRename XXXGenSubtarget.inc to XXXGenSubtargetInfo.inc for consistency.
Evan Cheng [Fri, 1 Jul 2011 22:36:09 +0000 (22:36 +0000)]
Rename XXXGenSubtarget.inc to XXXGenSubtargetInfo.inc for consistency.

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

13 years agoAdd MCSubtargetInfo target registry stuff.
Evan Cheng [Fri, 1 Jul 2011 22:25:04 +0000 (22:25 +0000)]
Add MCSubtargetInfo target registry stuff.

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

13 years agoTeach IVUsers to stop at non-affine expressions unless they are both
Dan Gohman [Fri, 1 Jul 2011 22:05:19 +0000 (22:05 +0000)]
Teach IVUsers to stop at non-affine expressions unless they are both
outside the loop and reducible.

This more completely hides them from LSR, which isn't usually able to
do anything meaningful with non-affine expressions anyway, and this
consequently hides them from SCEVExpander, which is acutely unprepared
for non-affine expressions.

Replace test/CodeGen/X86/lsr-nonaffine.ll with a new test that tests
the new behavior.

This works around the bug in PR10117 / rdar://problem/9633149, and is
generally an improvement besides.

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

13 years agoGeneralize @llvm.ctlz, @llvm.cttz, and @llvm.ctpop to work on vectors of integers...
Owen Anderson [Fri, 1 Jul 2011 21:52:38 +0000 (21:52 +0000)]
Generalize @llvm.ctlz, @llvm.cttz, and @llvm.ctpop to work on vectors of integers, and fix the one optimization pass that I'm aware of that needs updating for this.  At least one current target, ARM NEON, can implement these operations on vectors directly.

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

13 years agoCalling-convention specifications for illegal types are no-ops. Simplify based on...
Eli Friedman [Fri, 1 Jul 2011 21:33:28 +0000 (21:33 +0000)]
Calling-convention specifications for illegal types are no-ops.  Simplify based on this.

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

13 years agoARMv7M vs. ARMv7E-M support.
Jim Grosbach [Fri, 1 Jul 2011 21:12:19 +0000 (21:12 +0000)]
ARMv7M vs. ARMv7E-M support.

The DSP instructions in the Thumb2 instruction set are an optional extension
in the Cortex-M* archtitecture. When present, the implementation is considered
an "ARMv7E-M implementation," and when not, an "ARMv7-M implementation."

Add a subtarget feature hook for the v7e-m instructions and hook it up. The
cortex-m3 cpu is an example of a v7m implementation, while the cortex-m4 is
a v7e-m implementation.

rdar://9572992

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

13 years agoRename TargetSubtarget to TargetSubtargetInfo for consistency.
Evan Cheng [Fri, 1 Jul 2011 21:01:15 +0000 (21:01 +0000)]
Rename TargetSubtarget to TargetSubtargetInfo for consistency.

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

13 years ago- Added MCSubtargetInfo to capture subtarget features and scheduling
Evan Cheng [Fri, 1 Jul 2011 20:45:01 +0000 (20:45 +0000)]
- Added MCSubtargetInfo to capture subtarget features and scheduling
  itineraries.
- Refactor TargetSubtarget to be based on MCSubtargetInfo.
- Change tablegen generated subtarget info to initialize MCSubtargetInfo
  and hide more details from targets.

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

13 years agoFix off-by-one error.
Jim Grosbach [Fri, 1 Jul 2011 19:07:09 +0000 (19:07 +0000)]
Fix off-by-one error.

(low two bits always zero, so off by one bit of encoded value).

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

13 years agoHide the call to InitMCInstrInfo into tblgen generated ctor.
Evan Cheng [Fri, 1 Jul 2011 17:57:27 +0000 (17:57 +0000)]
Hide the call to InitMCInstrInfo into tblgen generated ctor.

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

13 years agoPseudo-ize t2MOVCC[ri].
Jim Grosbach [Fri, 1 Jul 2011 17:14:11 +0000 (17:14 +0000)]
Pseudo-ize t2MOVCC[ri].

t2MOVCC[ri] are just t2MOV[ri] instructions, so properly pseudo-ize them.
The Thumb1 versions, tMOVCC[ri] were only present for use by the size-
reduction pass, so they're no longer necessary at all and can be deleted.

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

13 years agoEliminate one extra conversion.
Evan Cheng [Fri, 1 Jul 2011 16:59:30 +0000 (16:59 +0000)]
Eliminate one extra conversion.

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

13 years agoDisable commit 134216 ("Add 134199 back, but disable the optimization when the second
Duncan Sands [Fri, 1 Jul 2011 12:01:00 +0000 (12:01 +0000)]
Disable commit 134216 ("Add 134199 back, but disable the optimization when the second
copy is a kill") to see if it fixes the i386 dragonegg buildbot, which is timing out
because gcc built with dragonegg is going into an infinite loop.

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

13 years agoAnother misuse of StringRef. MSVC is very sensitive to that kind of error.
Francois Pichet [Fri, 1 Jul 2011 09:23:41 +0000 (09:23 +0000)]
Another misuse of StringRef. MSVC is very sensitive to that kind of error.

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

13 years agoFix likely typo, reduce number of instruction name collisions.
Nick Lewycky [Fri, 1 Jul 2011 06:27:03 +0000 (06:27 +0000)]
Fix likely typo, reduce number of instruction name collisions.

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

13 years agoFix use after free.
Rafael Espindola [Fri, 1 Jul 2011 04:40:50 +0000 (04:40 +0000)]
Fix use after free.

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

13 years agoAvoid DenseMap lookup.
Rafael Espindola [Fri, 1 Jul 2011 04:15:02 +0000 (04:15 +0000)]
Avoid DenseMap lookup.

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

13 years agoFix off by one error. I misunderstood the comment about killedAt.
Rafael Espindola [Fri, 1 Jul 2011 03:31:29 +0000 (03:31 +0000)]
Fix off by one error. I misunderstood the comment about killedAt.

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

13 years agoCheck the liveinterval, not the kill flag.
Rafael Espindola [Fri, 1 Jul 2011 02:35:06 +0000 (02:35 +0000)]
Check the liveinterval, not the kill flag.

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

13 years agoDon't inflate register classes used by inline asm.
Jakob Stoklund Olesen [Fri, 1 Jul 2011 01:24:25 +0000 (01:24 +0000)]
Don't inflate register classes used by inline asm.

The constraints are represented by the register class of the original
virtual register created for the inline asm. If the register class were
included in the operand descriptor, we might be able to do this.

For now, just give up on regclass inflation when inline asm is involved.

No test case, this bug hasn't happened yet.

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

13 years agoImprove Mips back-end's handling of DBG_VALUE.
Akira Hatanaka [Fri, 1 Jul 2011 01:04:43 +0000 (01:04 +0000)]
Improve Mips back-end's handling of DBG_VALUE.

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

13 years agoImprove constant folding of undef for cmp and select operators.
Dan Gohman [Fri, 1 Jul 2011 01:03:43 +0000 (01:03 +0000)]
Improve constant folding of undef for cmp and select operators.

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

13 years agoAdd support for the 'j' immediate constraint. This is conditionalized on
Eric Christopher [Fri, 1 Jul 2011 01:00:07 +0000 (01:00 +0000)]
Add support for the 'j' immediate constraint. This is conditionalized on
supporting the instruction that the constraint is for 'movw'.

Part of rdar://9119939

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

13 years agoImprove constant folding of undef for binary operators.
Dan Gohman [Fri, 1 Jul 2011 00:42:17 +0000 (00:42 +0000)]
Improve constant folding of undef for binary operators.

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

13 years agoAdd support for the ARM 't' register constraint. And another testcase
Eric Christopher [Fri, 1 Jul 2011 00:30:46 +0000 (00:30 +0000)]
Add support for the ARM 't' register constraint. And another testcase
for the 'x' register constraint.

Part of rdar://9119939

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

13 years agoSwitch SubtargetFeatures from std::string to StringRef.
Evan Cheng [Fri, 1 Jul 2011 00:23:10 +0000 (00:23 +0000)]
Switch SubtargetFeatures from std::string to StringRef.

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

13 years agoWe'll return a null RC by default if we can't match.
Eric Christopher [Fri, 1 Jul 2011 00:19:27 +0000 (00:19 +0000)]
We'll return a null RC by default if we can't match.

Part of rdar://9119939

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

13 years agoAdd 134199 back, but disable the optimization when the second copy is a kill.
Rafael Espindola [Fri, 1 Jul 2011 00:16:54 +0000 (00:16 +0000)]
Add 134199 back, but disable the optimization when the second copy is a kill.

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

13 years agoAdd support for the 'x' constraint.
Eric Christopher [Fri, 1 Jul 2011 00:14:47 +0000 (00:14 +0000)]
Add support for the 'x' constraint.

Part of rdar://9307836 and rdar://9119939

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

13 years agoRemove tabs.
Bill Wendling [Thu, 30 Jun 2011 23:59:38 +0000 (23:59 +0000)]
Remove tabs.

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

13 years agoCapitalize the unsigned part of the initializer.
Eric Christopher [Thu, 30 Jun 2011 23:59:16 +0000 (23:59 +0000)]
Capitalize the unsigned part of the initializer.

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

13 years agoRename Pair to RCPair lacking any better naming ideas.
Eric Christopher [Thu, 30 Jun 2011 23:50:52 +0000 (23:50 +0000)]
Rename Pair to RCPair lacking any better naming ideas.

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

13 years agoImprove comment: Show the register the DWARF label is added to.
Bill Wendling [Thu, 30 Jun 2011 23:47:40 +0000 (23:47 +0000)]
Improve comment: Show the register the DWARF label is added to.

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

13 years agoUse the correct registers on X86_64.
Bill Wendling [Thu, 30 Jun 2011 23:47:14 +0000 (23:47 +0000)]
Use the correct registers on X86_64.

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

13 years agoFix a problem with fast-isel return values introduced in r134018.
Jakob Stoklund Olesen [Thu, 30 Jun 2011 23:42:18 +0000 (23:42 +0000)]
Fix a problem with fast-isel return values introduced in r134018.

We would put the return value from long double functions in the wrong
register.

This fixes gcc.c-torture/execute/conversion.c

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

13 years agoRefact ARM Thumb1 tMOVr instruction family.
Jim Grosbach [Thu, 30 Jun 2011 23:38:17 +0000 (23:38 +0000)]
Refact ARM Thumb1 tMOVr instruction family.

Merge the tMOVr, tMOVgpr2tgpr, tMOVtgpr2gpr, and tMOVgpr2gpr instructions
into tMOVr. There's no need to keep them separate. Giving the tMOVr
instruction the proper GPR register class for its operands is sufficient
to give the register allocator enough information to do the right thing
directly.

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

13 years agoAdd support for the 'h' constraint.
Eric Christopher [Thu, 30 Jun 2011 23:23:01 +0000 (23:23 +0000)]
Add support for the 'h' constraint.

Part of rdar://9119939

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

13 years agoAdd target a target hook to get the register number used by the compact unwind
Bill Wendling [Thu, 30 Jun 2011 23:20:32 +0000 (23:20 +0000)]
Add target a target hook to get the register number used by the compact unwind
encoding for the registers it knows about. Return -1 if it can't handle that
register.

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

13 years agoRevert my previous patch while I debug llvm-gcc bootstrap.
Rafael Espindola [Thu, 30 Jun 2011 22:58:17 +0000 (22:58 +0000)]
Revert my previous patch while I debug llvm-gcc bootstrap.

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