oota-llvm.git
13 years agoDiagnostic for undefined assembler local symbols.
Jim Grosbach [Wed, 15 Jun 2011 18:33:28 +0000 (18:33 +0000)]
Diagnostic for undefined assembler local symbols.

Re-apply 133010, with fixes for inline assembler.

Original commit message:
"When an assembler local symbol is used but not defined in a module, a
Darwin assembler wants to issue a diagnostic to that effect."

Added fix to only perform the check when finalizing, as otherwise we're not
done and undefined symbols may simply not have been encountered yet.

Passes "make check" and a self-host check on Darwin.

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

13 years agoDisabling this test until I can figure out the right lit flags.
Andrew Trick [Wed, 15 Jun 2011 18:25:38 +0000 (18:25 +0000)]
Disabling this test until I can figure out the right lit flags.

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

13 years agoRemove custom allocation orders in SystemZ.
Jakob Stoklund Olesen [Wed, 15 Jun 2011 18:02:56 +0000 (18:02 +0000)]
Remove custom allocation orders in SystemZ.

Note that this actually changes code generation, and someone who
understands this target better should check the changes.

- R12Q is now allocatable. I think it was omitted from the allocation
  order by mistake since it isn't reserved. It as apparently used as a
  GOT pointer sometimes, and it should probably be reserved if that is
  the case.

- The GR64 registers are allocated in a different order now. The
  register allocator will automatically put the CSRs last. There were
  other changes to the order that may have been significant.

The test fix is because r0 and r1 swapped places in the allocation order.

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

13 years agoAnother revsh pattern. rdar://9609059
Evan Cheng [Wed, 15 Jun 2011 17:17:48 +0000 (17:17 +0000)]
Another revsh pattern. rdar://9609059

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

13 years agoAdded -stress-sched flag in the Asserts build.
Andrew Trick [Wed, 15 Jun 2011 17:16:12 +0000 (17:16 +0000)]
Added -stress-sched flag in the Asserts build.
Added a test case for handling physreg aliases during pre-RA-sched.

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

13 years agoTargetLoweringOpt is a struct used by DAGCombine, not a pass.
Chad Rosier [Wed, 15 Jun 2011 16:48:02 +0000 (16:48 +0000)]
TargetLoweringOpt is a struct used by DAGCombine, not a pass.

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

13 years agoMake PPC64CompilationCallback compilable no non-darwin platforms.
Roman Divacky [Wed, 15 Jun 2011 15:29:47 +0000 (15:29 +0000)]
Make PPC64CompilationCallback compilable no non-darwin platforms.

Patch by Nathan Whitehorn!

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

13 years agogetZeroExtendInReg needs to get a scalar type
Nadav Rotem [Wed, 15 Jun 2011 14:37:18 +0000 (14:37 +0000)]
getZeroExtendInReg needs to get a scalar type

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

13 years agoThis test was failing on X86 machines which do not have SSE4. Fixed the test by
Nadav Rotem [Wed, 15 Jun 2011 12:26:53 +0000 (12:26 +0000)]
This test was failing on X86 machines which do not have SSE4. Fixed the test by
specifying that the target CPU is corei7.

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

13 years agoEnable the simplification of truncating-store after fixing the usage of
Nadav Rotem [Wed, 15 Jun 2011 11:19:12 +0000 (11:19 +0000)]
Enable the simplification of truncating-store after fixing the usage of
GetDemandBits (which must operate on the vector element type).

Fix the a usage of getZeroExtendInReg which must also be done on scalar types.

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

13 years agoReplace the statically generated hashtables for checking register relationships with...
Owen Anderson [Wed, 15 Jun 2011 06:53:50 +0000 (06:53 +0000)]
Replace the statically generated hashtables for checking register relationships with just scanning the (typically tiny) static lists.

At the time I wrote this code (circa 2007), TargetRegisterInfo was using a std::set to perform these queries.  Switching to the static hashtables was an obvious improvement, but in reality there's no reason to do anything other than scan.
With this change, total LLC time on a whole-program 403.gcc is reduced by approximately 1.5%, almost all of which comes from a 15% reduction in LiveVariables time.  It also reduces the binary size of LLC by 86KB, thanks to eliminating a bunch of very large static tables.

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

13 years agoTeach the .ll parser to handle named metadata with non-simple names.
Nick Lewycky [Wed, 15 Jun 2011 06:37:58 +0000 (06:37 +0000)]
Teach the .ll parser to handle named metadata with non-simple names.
Unfortunately we can't follow what the rest of the language does (wrapping it
in double-quotes) because that would cause an ambiguity with metadata strings,
so instead we escape any unusual characters with \xx escaping.

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

13 years agoA minor simplification: no functional change.
Bob Wilson [Wed, 15 Jun 2011 06:04:34 +0000 (06:04 +0000)]
A minor simplification: no functional change.

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

13 years agoUse a SetTheory instance to expand register lists in register classes.
Jakob Stoklund Olesen [Wed, 15 Jun 2011 05:09:20 +0000 (05:09 +0000)]
Use a SetTheory instance to expand register lists in register classes.

This prepares tablegen to compute register lists from set theoretic dag
expressions. This doesn't really make any difference as long as
Target.td still declares RegisterClass::MemberList as [Register].

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

13 years agoRemove the LTO stuff from the profile_rt library's Makefile.
Bill Wendling [Wed, 15 Jun 2011 04:56:13 +0000 (04:56 +0000)]
Remove the LTO stuff from the profile_rt library's Makefile.

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

13 years agoGive CodeGenRegisterClass a real sorted member set.
Jakob Stoklund Olesen [Wed, 15 Jun 2011 04:50:36 +0000 (04:50 +0000)]
Give CodeGenRegisterClass a real sorted member set.

Make the Elements vector private and expose an ArrayRef through
getOrder() instead. getOrder will eventually provide multiple
user-specified allocation orders.

Use the sorted member set for member and subclass tests. Clean up a lot
of ad hoc searches.

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

13 years agoImprove the heuristic to emit the alias if the number of hard-coded registers
Bill Wendling [Wed, 15 Jun 2011 04:31:19 +0000 (04:31 +0000)]
Improve the heuristic to emit the alias if the number of hard-coded registers
are also greater than the alias.

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

13 years agoStop using memdep for a check that didn't really make sense with memdep. In terms...
Eli Friedman [Wed, 15 Jun 2011 01:25:56 +0000 (01:25 +0000)]
Stop using memdep for a check that didn't really make sense with memdep. In terms of specific issues, using memdep here checks irrelevant instructions and won't work properly once we start returning "unknown" more aggressively from memdep.

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

13 years agoPerformBFICombine - (bfi A, (and B, Mask1), Mask2) -> (bfi A, B, Mask2) iff
Evan Cheng [Wed, 15 Jun 2011 01:12:31 +0000 (01:12 +0000)]
PerformBFICombine - (bfi A, (and B, Mask1), Mask2) -> (bfi A, B, Mask2) iff
the bits being cleared by the AND are not demanded by the BFI.

The previous BFI dag combine rule was actually incorrect (or used to be
correct until BFI representation changed).

rdar://9609030

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

13 years agoadd option for literal formatting to APInt::toString()
Ted Kremenek [Wed, 15 Jun 2011 00:51:55 +0000 (00:51 +0000)]
add option for literal formatting to APInt::toString()

toString() now takes an optional bool argument that,
depending on the radix, adds the appropriate prefix
to the integer's string representation that makes it into a
meaningful C literal, e.g.:

hexademical: '-f' becomes '-0xf'
octal: '77' becomes '077'
binary: '110' becomes '0b110'

Patch by nobled@dreamwidth.org!

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

13 years agoAdd "unknown" results for memdep, which mean "I don't know whether a dependence for...
Eli Friedman [Wed, 15 Jun 2011 00:47:34 +0000 (00:47 +0000)]
Add "unknown" results for memdep, which mean "I don't know whether a dependence for the given instruction exists in the given block".  This cleans up all the existing hacks in memdep which represent this concept by returning clobber with various unrelated instructions.

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

13 years agoMove the list of register classes into CodeGenRegBank as well.
Jakob Stoklund Olesen [Wed, 15 Jun 2011 00:20:40 +0000 (00:20 +0000)]
Move the list of register classes into CodeGenRegBank as well.

No functional change intended.

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

13 years agoAdd an optimization that looks for a specific pair-wise add pattern and generates...
Tanya Lattner [Tue, 14 Jun 2011 23:48:48 +0000 (23:48 +0000)]
Add an optimization that looks for a specific pair-wise add pattern and generates a vpaddl instruction instead of scalarizing the add.
Includes a test case.

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

13 years agoAdd triple.
Rafael Espindola [Tue, 14 Jun 2011 23:47:36 +0000 (23:47 +0000)]
Add triple.

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

13 years agoAnna's test commit (#2).
Anna Zaks [Tue, 14 Jun 2011 22:40:29 +0000 (22:40 +0000)]
Anna's test commit (#2).

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

13 years agoWhen pattern matching during instruction selection make sure shl x,1 is not
Chad Rosier [Tue, 14 Jun 2011 22:29:10 +0000 (22:29 +0000)]
When pattern matching during instruction selection make sure shl x,1 is not
converted to add x,x if x is a undef.  add undef, undef does not guarantee
that the resulting low order bit is zero.
Fixes <rdar://problem/9453156> and <rdar://problem/9487392>.

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

13 years agoCheck the llc output.
Rafael Espindola [Tue, 14 Jun 2011 22:24:32 +0000 (22:24 +0000)]
Check the llc output.

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

13 years agoPR10136: fix PPCTargetLowering::LowerCall_SVR4 so that a necessary CopyToReg doesn...
Eli Friedman [Tue, 14 Jun 2011 22:16:20 +0000 (22:16 +0000)]
PR10136: fix PPCTargetLowering::LowerCall_SVR4 so that a necessary CopyToReg doesn't appear to be dead.

Roman, since you're writing tests for other PPC-SVR4 vararg-related stuff, would you mind writing a test for this?

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

13 years agoAnna's test commit.
Anna Zaks [Tue, 14 Jun 2011 22:10:12 +0000 (22:10 +0000)]
Anna's test commit.

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

13 years agoTest case for x86 MMX inline asm. rdar://problem/8886707
Stuart Hastings [Tue, 14 Jun 2011 21:51:38 +0000 (21:51 +0000)]
Test case for x86 MMX inline asm.  rdar://problem/8886707

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

13 years agoRevert 133010. Self-hosted buildbot unhappy.
Jim Grosbach [Tue, 14 Jun 2011 21:51:20 +0000 (21:51 +0000)]
Revert 133010. Self-hosted buildbot unhappy.

Apparently llvm itself generates undefined assembler local labels, causing
self-hosting problems with this patch. Reverting until that's sorted out.

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

13 years agoDiagnostic for undefined assembler local symbols.
Jim Grosbach [Tue, 14 Jun 2011 21:13:25 +0000 (21:13 +0000)]
Diagnostic for undefined assembler local symbols.

When an assembler local symbol is used but not defined in a module, a
Darwin assembler wants to issue a diagnostic to that effect.

rdar://9559714

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

13 years agoAdd a test for the recent regression.
Rafael Espindola [Tue, 14 Jun 2011 20:38:50 +0000 (20:38 +0000)]
Add a test for the recent regression.

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

13 years agoRevert r133004 ; it's breaking nightly tests.
Eli Friedman [Tue, 14 Jun 2011 19:30:33 +0000 (19:30 +0000)]
Revert r133004 ; it's breaking nightly tests.

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

13 years agoPartial revert of 132882.
Rafael Espindola [Tue, 14 Jun 2011 18:12:31 +0000 (18:12 +0000)]
Partial revert of 132882.
Dan noted that this would work on the case shown on the commit message. I think
the case that was failing was a bb ending with a redundant conditional jump:

...
jne foo

foo:
...

I was unable to find any such case in the tests or in a debug build of clang,
so I will revert this part of the patch and watch the bots.

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

13 years agoAlso recognize ARM v4t and v5e variants.
Evan Cheng [Tue, 14 Jun 2011 18:08:33 +0000 (18:08 +0000)]
Also recognize ARM v4t and v5e variants.

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

13 years agoThis test is still failing. Delete the rest of it.
Dan Gohman [Tue, 14 Jun 2011 18:07:36 +0000 (18:07 +0000)]
This test is still failing. Delete the rest of it.

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

13 years agoRevert r132991. This test is failing on the
Dan Gohman [Tue, 14 Jun 2011 18:03:11 +0000 (18:03 +0000)]
Revert r132991. This test is failing on the
llvm-gcc-x86_64-linux-selfhost buildbot and others.

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

13 years agoFix a compile time regression caused by too small hash tables.
Jakob Stoklund Olesen [Tue, 14 Jun 2011 16:58:16 +0000 (16:58 +0000)]
Fix a compile time regression caused by too small hash tables.

Measure the worst case number of probes for a miss instead of the less
conservative number of probes required for an insertion.

Lower the limit to < 6 probes worst case.

This doubles the size of the ARM and X86 hash tables, other targets are
unaffected. LiveVariables runs 12% faster with this change.

<rdar://problem/9598545>

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

13 years agoAdd 132986 back, but avoid non-determinism if a bb address gets reused.
Rafael Espindola [Tue, 14 Jun 2011 15:31:54 +0000 (15:31 +0000)]
Add 132986 back, but avoid non-determinism if a bb address gets reused.

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

13 years agoAdd a testcase for #9623
Nadav Rotem [Tue, 14 Jun 2011 13:23:10 +0000 (13:23 +0000)]
Add a testcase for #9623

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

13 years agorevert 132986 to see if the bots go green.
Rafael Espindola [Tue, 14 Jun 2011 12:48:26 +0000 (12:48 +0000)]
revert 132986 to see if the bots go green.

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

13 years agoThis testcase cause a failure on some bots. Remove the failing test until
Nadav Rotem [Tue, 14 Jun 2011 09:10:37 +0000 (09:10 +0000)]
This testcase cause a failure on some bots. Remove the failing test until
further investigation.

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

13 years agoAdd a testcase for checking the integer-promotion of many different vector
Nadav Rotem [Tue, 14 Jun 2011 08:11:52 +0000 (08:11 +0000)]
Add a testcase for checking the integer-promotion of many different vector
types (with power of two types such as 8,16,32 .. 512).

Fix a bug in the integer promotion of bitcast nodes. Enable integer expanding
only if the target of the conversion is an integer (when the type action is
scalarize).

Add handling to the legalization of vector load/store in cases where the saved
vector is integer-promoted.

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

13 years agoDisable trunc-store simplification on vectors.
Nadav Rotem [Tue, 14 Jun 2011 07:18:26 +0000 (07:18 +0000)]
Disable trunc-store simplification on vectors.

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

13 years agoBe more obvious about what is being tested.
Cameron Zwarich [Tue, 14 Jun 2011 06:33:51 +0000 (06:33 +0000)]
Be more obvious about what is being tested.

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

13 years agoImplement Jakob's suggestion on how to detect fall thought without calling
Rafael Espindola [Tue, 14 Jun 2011 06:08:32 +0000 (06:08 +0000)]
Implement Jakob's suggestion on how to detect fall thought without calling
AnalyzeBranch.

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

13 years agoSince ARM's prefetch implementation predicted the presence of a instruction
Bruno Cardoso Lopes [Tue, 14 Jun 2011 05:11:46 +0000 (05:11 +0000)]
Since ARM's prefetch implementation predicted the presence of a instruction
cache prefetch and now that the info from "prefetch" to "ARMPreload" is present,
only add a testcase for PLI.

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

13 years agoAdd one more argument to the prefetch intrinsic to indicate whether it's a data
Bruno Cardoso Lopes [Tue, 14 Jun 2011 04:58:37 +0000 (04:58 +0000)]
Add one more argument to the prefetch intrinsic to indicate whether it's a data
or instruction cache access. Update the targets to match it and also teach
autoupgrade.

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

13 years agoMake the threshold used by branch folding softer. Before we would get a
Rafael Espindola [Tue, 14 Jun 2011 04:41:17 +0000 (04:41 +0000)]
Make the threshold used by branch folding softer. Before we would get a
sharp all or nothing transition when one extra predecessor was added. Now
we still test first ones for merging.

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

13 years agoFit banner in 80-col and adjust whitespace. No functionality changes.
Nick Lewycky [Tue, 14 Jun 2011 03:23:52 +0000 (03:23 +0000)]
Fit banner in 80-col and adjust whitespace. No functionality changes.

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

13 years agoHeuristic: If the number of operands in the alias are more than the number of
Bill Wendling [Tue, 14 Jun 2011 03:17:20 +0000 (03:17 +0000)]
Heuristic: If the number of operands in the alias are more than the number of
operands in the aliasee, don't print the alias.

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

13 years agoTest case for r132797.
John McCall [Tue, 14 Jun 2011 03:02:05 +0000 (03:02 +0000)]
Test case for r132797.

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

13 years agoUse IRBuilder to make our intrinsic calls in the inliner so that we pick up
John McCall [Tue, 14 Jun 2011 02:51:53 +0000 (02:51 +0000)]
Use IRBuilder to make our intrinsic calls in the inliner so that we pick up
line info correctly.

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

13 years agoUpdate BitcodeWriter to match recent Triple changes. rdar://9603399
Evan Cheng [Tue, 14 Jun 2011 01:51:33 +0000 (01:51 +0000)]
Update BitcodeWriter to match recent Triple changes. rdar://9603399

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

13 years agoUse Value::stripPointerCasts instead of reinventing part of the wheel.
Nick Lewycky [Tue, 14 Jun 2011 00:59:24 +0000 (00:59 +0000)]
Use Value::stripPointerCasts instead of reinventing part of the wheel.

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

13 years agoFix grammar.
Cameron Zwarich [Mon, 13 Jun 2011 23:39:23 +0000 (23:39 +0000)]
Fix grammar.

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

13 years agoClean up a few 80 column violations.
Jim Grosbach [Mon, 13 Jun 2011 22:54:22 +0000 (22:54 +0000)]
Clean up a few 80 column violations.

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

13 years agoRename MergeInType to MergeInTypeForLoadOrStore.
Cameron Zwarich [Mon, 13 Jun 2011 21:44:43 +0000 (21:44 +0000)]
Rename MergeInType to MergeInTypeForLoadOrStore.

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

13 years agoRemove the HadAVector instance variable and replace it with a use of ScalarKind.
Cameron Zwarich [Mon, 13 Jun 2011 21:44:40 +0000 (21:44 +0000)]
Remove the HadAVector instance variable and replace it with a use of ScalarKind.

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

13 years agoRemove a vacuous check.
Cameron Zwarich [Mon, 13 Jun 2011 21:44:38 +0000 (21:44 +0000)]
Remove a vacuous check.

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

13 years agoHave SRoA explicitly track the kind of scalar it is promoting. This is pretty
Cameron Zwarich [Mon, 13 Jun 2011 21:44:35 +0000 (21:44 +0000)]
Have SRoA explicitly track the kind of scalar it is promoting. This is pretty
spartan right now, but I plan to encode more information in this enum to improve
the correctness and reliability of SRoA. At least this first pass makes it
possible to make VectorTy an actual VectorType.

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

13 years agoRemove an argument that is always true.
Cameron Zwarich [Mon, 13 Jun 2011 21:44:31 +0000 (21:44 +0000)]
Remove an argument that is always true.

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

13 years agoFix coordination for using R4 in Thumb1 as a scratch for SP restore.
Jim Grosbach [Mon, 13 Jun 2011 21:18:25 +0000 (21:18 +0000)]
Fix coordination for using R4 in Thumb1 as a scratch for SP restore.

The logic for reserving R4 for use as a scratch needs to match that for
actually using it. Also, it's not necessary for immediate <=508, so adjust
the value checked.

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

13 years agoAliased flag options should be directed to stdout, not stderr to be consistent. Patch...
Evan Cheng [Mon, 13 Jun 2011 20:45:54 +0000 (20:45 +0000)]
Aliased flag options should be directed to stdout, not stderr to be consistent. Patch by Julien Lerouge.

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

13 years agoAdd compatibility version when compiling the Apple way.
Bill Wendling [Mon, 13 Jun 2011 20:14:37 +0000 (20:14 +0000)]
Add compatibility version when compiling the Apple way.
<rdar://problem/9600408>

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

13 years agoAvoid fusing bitcasts with dynamic allocas if the amount-to-allocate
Stuart Hastings [Mon, 13 Jun 2011 18:48:49 +0000 (18:48 +0000)]
Avoid fusing bitcasts with dynamic allocas if the amount-to-allocate
might overflow.  Re-typing the alloca to a larger type (e.g. double)
hoists a shift into the alloca, potentially exposing overflow in the
expression.  rdar://problem/9265821

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

13 years agoMove class into an anonymous namespace.
Benjamin Kramer [Mon, 13 Jun 2011 18:38:56 +0000 (18:38 +0000)]
Move class into an anonymous namespace.

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

13 years agoFix a bug in FindMemType. When widening vector loads, use a wider memory type
Nadav Rotem [Mon, 13 Jun 2011 18:13:24 +0000 (18:13 +0000)]
Fix a bug in FindMemType. When widening vector loads, use a wider memory type
only if the number of packed elements is a power of two.
Bug found in Duncan's testcase.

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

13 years agomention graph vis isn't available in Release builds.
Chris Lattner [Mon, 13 Jun 2011 15:59:35 +0000 (15:59 +0000)]
mention graph vis isn't available in Release builds.

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

13 years agoInstCombine: Fold A-b == C --> b == A-C if A and C are constants.
Benjamin Kramer [Mon, 13 Jun 2011 15:24:24 +0000 (15:24 +0000)]
InstCombine: Fold A-b == C --> b == A-C if A and C are constants.

The backend already knew this trick.

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

13 years agoRevert r132910 and r132909 on behalf of Michael. They didn't build with clang.
Benjamin Kramer [Mon, 13 Jun 2011 12:56:51 +0000 (12:56 +0000)]
Revert r132910 and r132909 on behalf of Michael. They didn't build with clang.

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

13 years agoRevert the last two commits in the series. r132911, r132912.
Michael J. Spencer [Mon, 13 Jun 2011 11:53:31 +0000 (11:53 +0000)]
Revert the last two commits in the series. r132911, r132912.

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

13 years agoModify llvm-nm to use new Binary creation method.
Michael J. Spencer [Mon, 13 Jun 2011 11:12:42 +0000 (11:12 +0000)]
Modify llvm-nm to use new Binary creation method.

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

13 years agoMake Binary the parent of ObjectFile and update children to new interface.
Michael J. Spencer [Mon, 13 Jun 2011 11:12:33 +0000 (11:12 +0000)]
Make Binary the parent of ObjectFile and update children to new interface.

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

13 years agoAdd Binary class. This is a cleaner parent than ObjectFile.
Michael J. Spencer [Mon, 13 Jun 2011 11:12:12 +0000 (11:12 +0000)]
Add Binary class. This is a cleaner parent than ObjectFile.

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

13 years agoAdd Object/Error.
Michael J. Spencer [Mon, 13 Jun 2011 11:11:59 +0000 (11:11 +0000)]
Add Object/Error.

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

13 years agoFix spelling and sort CMakeLists.txt.
Michael J. Spencer [Mon, 13 Jun 2011 11:11:39 +0000 (11:11 +0000)]
Fix spelling and sort CMakeLists.txt.

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

13 years agoIt's possible that an all-zero GEP may be used as the argument to lifetime
Nick Lewycky [Mon, 13 Jun 2011 07:52:46 +0000 (07:52 +0000)]
It's possible that an all-zero GEP may be used as the argument to lifetime
intrinsics. In fact, we'll optimize a bitcast to that when possible. Detect it
when looking for the lifetime intrinsics.

No test case, noticed by inspection.

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

13 years agoBe less aggressive about hinting in RAFast.
Jakob Stoklund Olesen [Mon, 13 Jun 2011 03:26:46 +0000 (03:26 +0000)]
Be less aggressive about hinting in RAFast.

In particular, don't spill dirty registers only to satisfy a hint. It is
not worth it.

The attached test case provides an example where the fast allocator
would spill a register when other registers are available.

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

13 years agoInclude callee-saved registers in debug output.
Jakob Stoklund Olesen [Mon, 13 Jun 2011 03:26:42 +0000 (03:26 +0000)]
Include callee-saved registers in debug output.

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

13 years agoFix invalid uses of Twine. Hopefully this fixes the problem that Takumi is
Rafael Espindola [Mon, 13 Jun 2011 03:09:13 +0000 (03:09 +0000)]
Fix invalid uses of Twine. Hopefully this fixes the problem that Takumi is
having.

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

13 years agoInstCombine: Shrink ((zext X) & C1) == C2 to fold away the cast if the "zext" and...
Benjamin Kramer [Sun, 12 Jun 2011 22:48:00 +0000 (22:48 +0000)]
InstCombine: Shrink ((zext X) & C1) == C2 to fold away the cast if the "zext" and the "and" have one use.

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

13 years agoSimplify code. No functionality changes, name changes aside.
Benjamin Kramer [Sun, 12 Jun 2011 22:47:53 +0000 (22:47 +0000)]
Simplify code. No functionality changes, name changes aside.

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

13 years agoHappy new year.
Benjamin Kramer [Sun, 12 Jun 2011 15:26:54 +0000 (15:26 +0000)]
Happy new year.

Only 163 days late!

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

13 years agoFix a bug in the calculation of the vectorTypeBreakdown into registers. Odd
Nadav Rotem [Sun, 12 Jun 2011 14:56:55 +0000 (14:56 +0000)]
Fix a bug in the calculation of the vectorTypeBreakdown into registers. Odd
types such as i33 were rounded to i32. Originated from Duncan's testcase.

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

13 years agoImprove the generated code by getCopyFromPartsVector for promoted integer types.
Nadav Rotem [Sun, 12 Jun 2011 14:49:38 +0000 (14:49 +0000)]
Improve the generated code by getCopyFromPartsVector for promoted integer types.
Instead of scalarizing, and doing an element-by-element truncat, use vector
truncate.
Add support for scalarization of vectors:  i8 -> <1 x i1> (from Duncan's
testcase).

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

13 years agoBugfix: When looking for a legal vector type, stop looking when a non-simple
Nadav Rotem [Sun, 12 Jun 2011 14:40:30 +0000 (14:40 +0000)]
Bugfix: When looking for a legal vector type, stop looking when a non-simple
element type is found.
This fix addresses some of the tests in Duncan's testcase (forthcoming).

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

13 years agoTweak hash function and compress hash tables.
Jakob Stoklund Olesen [Sun, 12 Jun 2011 07:04:32 +0000 (07:04 +0000)]
Tweak hash function and compress hash tables.

Make the hash tables as small as possible while ensuring that all
lookups can be done in less than 8 probes.

Cut the aliases hash table in half by only storing a < b pairs - it
is a symmetric relation.

Use larger multipliers on the initial hash function to ensure that it
properly covers the whole table, and to resolve some clustering in the
very regular ARM register bank.

This reduces the size of most of these tables by 4x - 8x. For instance,
the ARM tables shrink from 48 KB to 8 KB.

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

13 years agoRemove now dead code.
Jakob Stoklund Olesen [Sun, 12 Jun 2011 07:04:28 +0000 (07:04 +0000)]
Remove now dead code.

These computations have been moved to CodeGenRegisters.cpp.

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

13 years agoExtract the generateHashTable function.
Jakob Stoklund Olesen [Sun, 12 Jun 2011 07:04:26 +0000 (07:04 +0000)]
Extract the generateHashTable function.

The constant hash tables for sub-registers and overlaps are generated
the same way, so extract a function to generate and print the hash
table.

Also use the information computed by CodeGenRegisters.cpp instead of the
locally data.

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

13 years agoReally fix the fall-through logic.
Rafael Espindola [Sun, 12 Jun 2011 05:57:01 +0000 (05:57 +0000)]
Really fix the fall-through logic.
Add a triple to the tests.

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

13 years agoTest for the previous commit.
Rafael Espindola [Sun, 12 Jun 2011 05:35:39 +0000 (05:35 +0000)]
Test for the previous commit.

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

13 years agoFix silly bug I introduce in the previous commit. Fixes debug builds.
Rafael Espindola [Sun, 12 Jun 2011 05:26:32 +0000 (05:26 +0000)]
Fix silly bug I introduce in the previous commit. Fixes debug builds.

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

13 years agoAnalyzeBranch doesn't change which successors a bb has, just the order
Rafael Espindola [Sun, 12 Jun 2011 03:20:32 +0000 (03:20 +0000)]
AnalyzeBranch doesn't change which successors a bb has, just the order
we try to branch to them.

Before we were creating successor lists with duplicated entries. Fixing that
found a bug in isBlockOnlyReachableByFallthrough that would causes it to
return the wrong answer for

-----------
...
jne foo
jmp bar

foo:
----------

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

13 years agoCompute lists of sub-regs, super-regs, and overlapping regs.
Jakob Stoklund Olesen [Sun, 12 Jun 2011 03:05:52 +0000 (03:05 +0000)]
Compute lists of sub-regs, super-regs, and overlapping regs.

Besides moving structural computations to CodeGenRegisters.cpp, this
also well-defines the order of these lists:

- Sub-register lists come from a pre-order traversal of the graph
  defined by the SubRegs lists in the .td files.

- Super-register lists are topologically ordered so no register comes
  before any of its sub-registers. When the sub-register graph is not a
  tree, independent super-registers appear in numerical order.

- Lists of overlapping registers are ordered according to register
  number.

This reverses the order of the super-regs lists, but nobody was
depending on that. The previous order of the overlaps lists was odd, and
it may have depended on the precise behavior of std::stable_sort.

The old computations are still there, but will be removed shortly.

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

13 years agoPut FrameSetup flag on x86 instructions that set up the call frame. No
Charles Davis [Sun, 12 Jun 2011 01:45:54 +0000 (01:45 +0000)]
Put FrameSetup flag on x86 instructions that set up the call frame. No
functionality change.

Later on, we'll use the flag to emit SEH pseudo-ops that describe how the
call frame was built.

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

13 years agoReformatting. Moving class definitions to more natural places. No functionalogical...
Bill Wendling [Sat, 11 Jun 2011 11:37:49 +0000 (11:37 +0000)]
Reformatting. Moving class definitions to more natural places. No functionalogical changes.

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

13 years agoRevert r132871.
Chad Rosier [Sat, 11 Jun 2011 02:27:46 +0000 (02:27 +0000)]
Revert r132871.

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

13 years agoTypo.
Chad Rosier [Sat, 11 Jun 2011 02:16:36 +0000 (02:16 +0000)]
Typo.

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