oota-llvm.git
12 years agoEnsure timestamps are not embedded into files when doing a release build.
Duncan Sands [Fri, 21 Oct 2011 09:47:14 +0000 (09:47 +0000)]
Ensure timestamps are not embedded into files when doing a release build.

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

12 years agoFix build on mingw-w64.
Anton Korobeynikov [Fri, 21 Oct 2011 09:38:50 +0000 (09:38 +0000)]
Fix build on mingw-w64.
Patch by Ruben Van Boxem!

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

12 years agoAdd loop aligning to MachineBlockPlacement based on review discussion so
Chandler Carruth [Fri, 21 Oct 2011 08:57:37 +0000 (08:57 +0000)]
Add loop aligning to MachineBlockPlacement based on review discussion so
it's a bit more plausible to use this instead of CodePlacementOpt. The
code for this was shamelessly stolen from CodePlacementOpt, and then
trimmed down a bit. There doesn't seem to be much utility in returning
true/false from this pass as we may or may not have rewritten all of the
blocks. Also, the statistic of counting how many loops were aligned
doesn't seem terribly important so I removed it. If folks would like it
to be included, I'm happy to add it back.

This was probably the most egregious of the missing features, and now
I'm going to start gathering some performance numbers and looking at
specific loop structures that have different layout between the two.

Test is updated to include both basic loop alignment and nested loop
alignment.

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

12 years agoAdd a very basic test for MachineBlockPlacement. This is essentially the
Chandler Carruth [Fri, 21 Oct 2011 08:01:56 +0000 (08:01 +0000)]
Add a very basic test for MachineBlockPlacement. This is essentially the
canonical example I used when developing it, and is one of the primary
motivating real-world use cases for __builtin_expect (when burried under
a macro).

I'm working on more test cases here, but I'm trying to make sure both
that the pass is doing the right thing with the test cases and that they
aren't too brittle to changes elsewhere in the code generation pipeline.

Feedback and/or suggestions on how to test this are very welcome.
Especially feedback on whether testing the block comments is a good
strategy; I couldn't find any good examples to steal from but all the
other ideas I had were a lot uglier or more fragile.

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

12 years agoModify the script to output the regressions and passes into categories. My Python...
Bill Wendling [Fri, 21 Oct 2011 06:58:01 +0000 (06:58 +0000)]
Modify the script to output the regressions and passes into categories. My Python-fu could use some improving...

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

12 years agoRemove intrinsics for X86 BLSI, BLSMSK, and BLSR intrinsics and replace with custom...
Craig Topper [Fri, 21 Oct 2011 06:55:01 +0000 (06:55 +0000)]
Remove intrinsics for X86 BLSI, BLSMSK, and BLSR intrinsics and replace with custom isel lowering code.

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

12 years agoImplement a block placement pass based on the branch probability and
Chandler Carruth [Fri, 21 Oct 2011 06:46:38 +0000 (06:46 +0000)]
Implement a block placement pass based on the branch probability and
block frequency analyses. This differs substantially from the existing
block-placement pass in LLVM:

1) It operates on the Machine-IR in the CodeGen layer. This exposes much
   more (and more precise) information and opportunities. Also, the
   results are more stable due to fewer transforms ocurring after the
   pass runs.
2) It uses the generalized probability and frequency analyses. These can
   model static heuristics, code annotation derived heuristics as well
   as eventual profile loading. By basing the optimization on the
   analysis interface it can work from any (or a combination) of these
   inputs.
3) It uses a more aggressive algorithm, both building chains from tho
   bottom up to maximize benefit, and using an SCC-based walk to layout
   chains of blocks in a profitable ordering without O(N^2) iterations
   which the old pass involves.

The pass is currently gated behind a flag, and not enabled by default
because it still needs to grow some important features. Most notably, it
needs to support loop aligning and careful layout of loop structures
much as done by hand currently in CodePlacementOpt. Once it supports
these, and has sufficient testing and quality tuning, it should replace
both of these passes.

Thanks to Nick Lewycky and Richard Smith for help authoring & debugging
this, and to Jakob, Andy, Eric, Jim, and probably a few others I'm
forgetting for reviewing and answering all my questions. Writing
a backend pass is *sooo* much better now than it used to be. =D

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

12 years agoCheck for divide by zero.
Bill Wendling [Fri, 21 Oct 2011 06:26:01 +0000 (06:26 +0000)]
Check for divide by zero.

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

12 years agoRemove a now dead function, fixing -Wunused-function warnings from
Chandler Carruth [Fri, 21 Oct 2011 01:23:41 +0000 (01:23 +0000)]
Remove a now dead function, fixing -Wunused-function warnings from
Clang.

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

12 years agoFix unused variable warning.
Richard Smith [Fri, 21 Oct 2011 01:22:04 +0000 (01:22 +0000)]
Fix unused variable warning.

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

12 years agoRevert r142618, r142622, and r142624, which were based on an incorrect reading of...
Owen Anderson [Thu, 20 Oct 2011 22:23:58 +0000 (22:23 +0000)]
Revert r142618, r142622, and r142624, which were based on an incorrect reading of the ARMv7 docs.

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

12 years agoFix decoding tests for fixed MSR encodings.
Owen Anderson [Thu, 20 Oct 2011 22:01:48 +0000 (22:01 +0000)]
Fix decoding tests for fixed MSR encodings.

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

12 years agoRemove unused include of sys/uio.h in MemoryBuffer.cpp. It was not correctly protecte...
David Meyer [Thu, 20 Oct 2011 21:57:46 +0000 (21:57 +0000)]
Remove unused include of sys/uio.h in MemoryBuffer.cpp. It was not correctly protected by ifdef either.

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

12 years agoFix tests for corrected MSR encodings.
Owen Anderson [Thu, 20 Oct 2011 21:53:19 +0000 (21:53 +0000)]
Fix tests for corrected MSR encodings.

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

12 years agoDisable the PPC hazard recognizer. It currently only supports
Dan Gohman [Thu, 20 Oct 2011 21:45:36 +0000 (21:45 +0000)]
Disable the PPC hazard recognizer. It currently only supports
top-down scheduling and top-down scheduling is going away.

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

12 years agoDelete the list-tdrr scheduler. Top-down schedulers are going away
Dan Gohman [Thu, 20 Oct 2011 21:44:34 +0000 (21:44 +0000)]
Delete the list-tdrr scheduler. Top-down schedulers are going away
because they don't support physical register dependencies.

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

12 years agoSeparate out ARM MSR instructions into M-class versions and AR-class versions. This...
Owen Anderson [Thu, 20 Oct 2011 21:24:38 +0000 (21:24 +0000)]
Separate out ARM MSR instructions into M-class versions and AR-class versions.  This fixes some roundtripping failures.

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

12 years agoAdd missing operand. <rdar://problem/10313323>
Bill Wendling [Thu, 20 Oct 2011 20:37:11 +0000 (20:37 +0000)]
Add missing operand. <rdar://problem/10313323>

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

12 years agoAlso compare the built dragonegg objects between phases 2 and 3.
Duncan Sands [Thu, 20 Oct 2011 20:14:18 +0000 (20:14 +0000)]
Also compare the built dragonegg objects between phases 2 and 3.

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

12 years agoReset the system compiler each time we start a new flavour. Otherwise
Duncan Sands [Thu, 20 Oct 2011 20:10:58 +0000 (20:10 +0000)]
Reset the system compiler each time we start a new flavour.  Otherwise
the last compiler built for the previous flavour is used for the next,
for example the Debug clang compiler was being used for the initial build
of the Release LLVM.  Flavors should be independent of each other.  This
especially matters if the compiler built for the previous flavour doesn't
actually work!

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

12 years agoHaven't yet found a nice way to handle TargetData verification in the
Lang Hames [Thu, 20 Oct 2011 19:24:44 +0000 (19:24 +0000)]
Haven't yet found a nice way to handle TargetData verification in the
AsmParser. This patch adds validation for target data layout strings upon
construction of TargetData objects. An attempt to construct a TargetData object
from a malformed string will trigger an assertion.

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

12 years agoRevert r142579, "Fix a type in the legalization of CONCAT_VECTORS". This is
Chad Rosier [Thu, 20 Oct 2011 19:19:10 +0000 (19:19 +0000)]
Revert r142579, "Fix a type in the legalization of CONCAT_VECTORS". This is
causing one of the unit tests to infinitely loop, which resulted in the
buildbots stalling.

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

12 years agoAs Evan suggested, loads from constant pool are safe to speculate.
Devang Patel [Thu, 20 Oct 2011 17:42:23 +0000 (17:42 +0000)]
As Evan suggested, loads from constant pool are safe to speculate.

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

12 years agoAdd a comment.
Devang Patel [Thu, 20 Oct 2011 17:31:18 +0000 (17:31 +0000)]
Add a comment.

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

12 years agoTidy up. Trailing whitespace.
Jim Grosbach [Thu, 20 Oct 2011 17:28:20 +0000 (17:28 +0000)]
Tidy up. Trailing whitespace.

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

12 years agoARM VLD1/VST1 (one register, no writeback) assembly parsing and encoding.
Jim Grosbach [Thu, 20 Oct 2011 15:04:25 +0000 (15:04 +0000)]
ARM VLD1/VST1 (one register, no writeback) assembly parsing and encoding.

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

12 years agoTidy up formatting.
Jim Grosbach [Thu, 20 Oct 2011 14:57:47 +0000 (14:57 +0000)]
Tidy up formatting.

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

12 years agoARM VTBX (one register) assembly parsing and encoding.
Jim Grosbach [Thu, 20 Oct 2011 14:48:50 +0000 (14:48 +0000)]
ARM VTBX (one register) assembly parsing and encoding.

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

12 years agoFix a type in the legalization of CONCAT_VECTORS.
Nadav Rotem [Thu, 20 Oct 2011 13:38:16 +0000 (13:38 +0000)]
Fix a type in the legalization of CONCAT_VECTORS.

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

12 years agoAdd support for testing dragonegg. This is disabled by default.
Duncan Sands [Thu, 20 Oct 2011 11:13:04 +0000 (11:13 +0000)]
Add support for testing dragonegg.  This is disabled by default.
In fact this commit is not intended to change anything unless you
use one of the new command line flags.

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

12 years agoComment out or remove unused parameter names so as to avoid a slew of
Duncan Sands [Thu, 20 Oct 2011 08:57:54 +0000 (08:57 +0000)]
Comment out or remove unused parameter names so as to avoid a slew of
compiler warnings.

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

12 years agoAvoid warnings about the parameter G being unused.
Duncan Sands [Thu, 20 Oct 2011 08:56:41 +0000 (08:56 +0000)]
Avoid warnings about the parameter G being unused.

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

12 years agoRefactor code from inlining and globalopt that checks whether a function definition...
Eli Friedman [Thu, 20 Oct 2011 05:23:42 +0000 (05:23 +0000)]
Refactor code from inlining and globalopt that checks whether a function definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead.  This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress.  (GlobalDCE can also handle the given tescase, but we only run that at -O3.)  Found while looking at PR11180.

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

12 years agoRemove useless code.
Eli Friedman [Thu, 20 Oct 2011 04:33:44 +0000 (04:33 +0000)]
Remove useless code.

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

12 years agoA FIXME about block addresses and indirectbr.
Eli Friedman [Thu, 20 Oct 2011 04:05:33 +0000 (04:05 +0000)]
A FIXME about block addresses and indirectbr.

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

12 years agoSimplify; no intended functional change.
Eli Friedman [Thu, 20 Oct 2011 03:23:14 +0000 (03:23 +0000)]
Simplify; no intended functional change.

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

12 years agoRevamp the script to handle the 'TEST=simple' output.
Bill Wendling [Thu, 20 Oct 2011 00:45:46 +0000 (00:45 +0000)]
Revamp the script to handle the 'TEST=simple' output.

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

12 years ago"@string = constant i8 0" is a value i8* string of length zero. Analyze that
Nick Lewycky [Thu, 20 Oct 2011 00:34:35 +0000 (00:34 +0000)]
"@string = constant i8 0" is a value i8* string of length zero. Analyze that
correctly in GetStringLength, fixing PR11181!

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

12 years agoRevert 142337. Thumb1 still doesn't support dynamic stack realignment. :(
Chad Rosier [Thu, 20 Oct 2011 00:07:12 +0000 (00:07 +0000)]
Revert 142337.  Thumb1 still doesn't support dynamic stack realignment. :(

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

12 years agoInitialze ScalarEvalution dependency.
Devang Patel [Wed, 19 Oct 2011 23:56:07 +0000 (23:56 +0000)]
Initialze ScalarEvalution dependency.
Patch by Pranav Bhandarkar!

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

12 years agoFix TLS lowering bug. The CopyFromReg must be glued to the TLSCALL. rdar://10291355
Evan Cheng [Wed, 19 Oct 2011 22:22:54 +0000 (22:22 +0000)]
Fix TLS lowering bug. The CopyFromReg must be glued to the TLSCALL. rdar://10291355

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

12 years agoImprove code generation for vselect on SSE2:
Nadav Rotem [Wed, 19 Oct 2011 20:43:16 +0000 (20:43 +0000)]
Improve code generation for vselect on SSE2:
When checking the availability of instructions using the TLI, a 'promoted'
instruction IS available. It means that the value is bitcasted to another type
for which there is an operation. The correct check for the availablity of an
instruction is to check if it should be expanded.

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

12 years agoFix parsing of a line with only a # in it.
Rafael Espindola [Wed, 19 Oct 2011 18:48:52 +0000 (18:48 +0000)]
Fix parsing of a line with only a # in it.

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

12 years agoUpdating 'update' target to handle svn 1.7 'info' output. Patch by Jean-Danial Dupas!
David Blaikie [Wed, 19 Oct 2011 18:35:30 +0000 (18:35 +0000)]
Updating 'update' target to handle svn 1.7 'info' output. Patch by Jean-Danial Dupas!

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

12 years agoUse literal pool loads instead of MOVW/MOVT for materializing global addresses when...
James Molloy [Wed, 19 Oct 2011 14:11:07 +0000 (14:11 +0000)]
Use literal pool loads instead of MOVW/MOVT for materializing global addresses when optimizing for size.

On spec/gcc, this caused a codesize improvement of ~1.9% for ARM mode and ~4.9% for Thumb(2) mode. This is
codesize including literal pools.

The pools themselves doubled in size for ARM mode and quintupled for Thumb mode, leaving suggestion that there
is still perhaps redundancy in LLVM's use of constant pools that could be decreased by sharing entries.

Fixes PR11087.

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

12 years agoDocument Paste
David Greene [Wed, 19 Oct 2011 13:04:59 +0000 (13:04 +0000)]
Document Paste

Document paste as a shorthand for !strconcat.

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

12 years agoDocument NAME
David Greene [Wed, 19 Oct 2011 13:04:56 +0000 (13:04 +0000)]
Document NAME

Document NAME as a special member of def records that should
not be defined anywhere else.

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

12 years agoAdd Paste Test
David Greene [Wed, 19 Oct 2011 13:04:50 +0000 (13:04 +0000)]
Add Paste Test

This tests TableGen's paste functionality.

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

12 years agoImplement Paste
David Greene [Wed, 19 Oct 2011 13:04:43 +0000 (13:04 +0000)]
Implement Paste

Add a paste operator '#' to take two identifier-like strings and joint
them.  Internally paste gets represented as a !strconcat() with any
necessary casts to string added.

This will be used to implement basic for loop functionality as in:

for i = [0, 1, 2, 3, 4, 5, 6, 7] {
  def R#i : Register<...>
}

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

12 years agoProcess NAME
David Greene [Wed, 19 Oct 2011 13:04:35 +0000 (13:04 +0000)]
Process NAME

During multiclass def instantiation, replace NAME in any expressions
with the value of the def or defm ID.

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

12 years agoProcess Defm Prefix as Init
David Greene [Wed, 19 Oct 2011 13:04:31 +0000 (13:04 +0000)]
Process Defm Prefix as Init

Parse and process a defm prefix as an Init expression.  This allows
paste operations to create defm prefixes.

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

12 years agoParse Def ID as Value
David Greene [Wed, 19 Oct 2011 13:04:29 +0000 (13:04 +0000)]
Parse Def ID as Value

Allow def and defm IDs to be general values.  We need this for paste
functionality.

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

12 years agoDon't Parse Object Body as a Name
David Greene [Wed, 19 Oct 2011 13:04:26 +0000 (13:04 +0000)]
Don't Parse Object Body as a Name

Stop parsing a value if we are in name parsing mode and we see a left
brace.  A left brace indicates the start of an object body when we are
parsing a name.

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

12 years agoUse Parse Mode
David Greene [Wed, 19 Oct 2011 13:04:21 +0000 (13:04 +0000)]
Use Parse Mode

Augment the value parser to respect the parse mode and not error if an
ID doesn't map to an object and we are in name parsing mode.

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

12 years agoMake ID Parsing More Flexible
David Greene [Wed, 19 Oct 2011 13:04:20 +0000 (13:04 +0000)]
Make ID Parsing More Flexible

Add a mode control to value and ID parsers.  The two modes are:

- Parse a value.  Expect the parsed ID to map to an existing object.

- Parse a name.  Expect the parsed ID to not map to any existing object.

The first is used when parsing an identifier to be looked up, for
example a record field or template argument.  The second is used for
parsing declarations.  Paste functionality implies that declarations
can contain arbitrary expressions so we need to be able to call into
the general value parser to parse declarations with paste operators.
So we need a way to parse a value-like thing without expecting that
the result will map to some existing object.  This parse mode provides
that.

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

12 years agoAdd NAME Member
David Greene [Wed, 19 Oct 2011 13:04:13 +0000 (13:04 +0000)]
Add NAME Member

Add a Value named "NAME" to each Record.  This will be set to the def or defm
name when instantiating multiclasses.  This will replace the #NAME# processing
hack once paste functionality is in place.

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

12 years agoFix Name Access
David Greene [Wed, 19 Oct 2011 13:04:02 +0000 (13:04 +0000)]
Fix Name Access

Get the Record name as a string explicitly to avoid asserts.

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

12 years agoFix Name Access
David Greene [Wed, 19 Oct 2011 13:03:58 +0000 (13:03 +0000)]
Fix Name Access

Get the Record name as a string explicitly to avoid asserts.

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

12 years agoFix Name Access
David Greene [Wed, 19 Oct 2011 13:03:51 +0000 (13:03 +0000)]
Fix Name Access

Get the Record name as a string explicitly to avoid asserts.

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

12 years agoFix Name Access
David Greene [Wed, 19 Oct 2011 13:03:45 +0000 (13:03 +0000)]
Fix Name Access

Get the Record name by string explicitly to avoid potential asserts.

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

12 years agoDisambiguate Numbers and Identifiers
David Greene [Wed, 19 Oct 2011 13:03:39 +0000 (13:03 +0000)]
Disambiguate Numbers and Identifiers

Use lookahead to determine whether a number is really a number or is
part of something forming an identifier.  This won't come into play
until the paste operator is recognized as a unique token.

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

12 years agoAdd Peek
David Greene [Wed, 19 Oct 2011 13:03:35 +0000 (13:03 +0000)]
Add Peek

Add a peek function to let the Lexer look at a character arbitrarily
far ahead in the stream without consuming anything.  We need this to
disambiguate numbers and operands of a paste operation.  For example:

def foo#8i

Without lookahead the lexer will treat '8' as a number rather than as
part of a string to be pasted to form an identifier.

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

12 years agoResolve Record Names
David Greene [Wed, 19 Oct 2011 13:03:30 +0000 (13:03 +0000)]
Resolve Record Names

When resolving Record values, be sure to update the Record name as it
may contain references to the value.

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

12 years agoAllow Names Changes on Unregistered Records
David Greene [Wed, 19 Oct 2011 13:03:25 +0000 (13:03 +0000)]
Allow Names Changes on Unregistered Records

Add Record names to be changed even on Records that aren't yet
registered.  We need to be able to do this for paste functionality
because we do not want to register def names before they are unique
and that can only happen once all paste operations are done.  This
change lets us update Record names formed by paste operations and
register the result later.

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

12 years agoCall Record Initializer
David Greene [Wed, 19 Oct 2011 13:03:21 +0000 (13:03 +0000)]
Call Record Initializer

Call the common Record initializer code from constructors.

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

12 years agoAdd Name Init Record Constructor
David Greene [Wed, 19 Oct 2011 13:03:15 +0000 (13:03 +0000)]
Add Name Init Record Constructor

Add a Record constructor that takes the Record name as an Init.  This
is more work toward paste functionality.

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

12 years agoFix 80-col Violation
David Greene [Wed, 19 Oct 2011 13:03:10 +0000 (13:03 +0000)]
Fix 80-col Violation

Split up the initializer list for Record to avoid 80-col issues.

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

12 years agoFix Name Access
David Greene [Wed, 19 Oct 2011 13:03:02 +0000 (13:03 +0000)]
Fix Name Access

Ask for the Record name as a string explicitly to avoid a possible assert.

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

12 years agoFix Name Access
David Greene [Wed, 19 Oct 2011 13:02:57 +0000 (13:02 +0000)]
Fix Name Access

Ask for the Record name as a string explicitly to avoid a possible
assert.

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

12 years agoFix Name Access
David Greene [Wed, 19 Oct 2011 13:02:52 +0000 (13:02 +0000)]
Fix Name Access

Ask for the record name as a string explicitly to avoid a potential
assert.

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

12 years agoFix Name Check
David Greene [Wed, 19 Oct 2011 13:02:48 +0000 (13:02 +0000)]
Fix Name Check

Avoid a potential assert by asking for record names as strings explicitly.

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

12 years agoFix Name Check
David Greene [Wed, 19 Oct 2011 13:02:47 +0000 (13:02 +0000)]
Fix Name Check

Record names may not be fully resolved at this point so ask for the
record name as a string explicitly.  This avoids a potential assert.

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

12 years agoAdd Record Init
David Greene [Wed, 19 Oct 2011 13:02:45 +0000 (13:02 +0000)]
Add Record Init

Add an init function to be shared among Record constructors.

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

12 years agoMake Template Arg Names Inits
David Greene [Wed, 19 Oct 2011 13:02:42 +0000 (13:02 +0000)]
Make Template Arg Names Inits

Allow template arg names to be Inits.  This is further work to
implement paste as it allows template names to participate in paste
operations.

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

12 years agoLet SetValue Take and Init Name
David Greene [Wed, 19 Oct 2011 13:02:39 +0000 (13:02 +0000)]
Let SetValue Take and Init Name

Convert SetValue to take the value name as an Init.  This allows us to
set values for variables whose names are not yet fully resolved.

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

12 years agoAdd Utility to Scope Names
David Greene [Wed, 19 Oct 2011 13:02:36 +0000 (13:02 +0000)]
Add Utility to Scope Names

Add a couple of utility functions to take a variable name and qualify
it with the namespace of the enclosing class and/or multiclass.  This
is inpreparation for making template arg names first-class Inits.

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

12 years agoMake VarInit Name an Init
David Greene [Wed, 19 Oct 2011 13:02:33 +0000 (13:02 +0000)]
Make VarInit Name an Init

Make the VarInit name an Init itself.  We need this to implement paste
functionality so we can reference variables whose names are not yet
completely resolved.

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

12 years agoAdd Value Accessors
David Greene [Wed, 19 Oct 2011 13:02:29 +0000 (13:02 +0000)]
Add Value Accessors

Add accessors to get Record values by Init name.  This lets us look up
Record values whose names are not yet fully resolved.  More work
toward paste.

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

12 years agoAdd Name Init Accessors
David Greene [Wed, 19 Oct 2011 13:02:28 +0000 (13:02 +0000)]
Add Name Init Accessors

Add a utility to get the name init and get the string representation
of the name.  This will be used for paste functionality.

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

12 years agoAdd Init Accessors
David Greene [Wed, 19 Oct 2011 13:02:22 +0000 (13:02 +0000)]
Add Init Accessors

Add a couple of utility functions to get at the name init and return
the name init as a string.  This will be used for paste functionality.

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

12 years agoGeneralize the reading of probability metadata to work for both branches
Chandler Carruth [Wed, 19 Oct 2011 10:32:19 +0000 (10:32 +0000)]
Generalize the reading of probability metadata to work for both branches
and switches, with arbitrary numbers of successors. Still optimized for
the common case of 2 successors for a conditional branch.

Add a test case for switch metadata showing up in the BlockFrequencyInfo pass.

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

12 years agoTeach the BranchProbabilityInfo analysis pass to read any metadata
Chandler Carruth [Wed, 19 Oct 2011 10:30:30 +0000 (10:30 +0000)]
Teach the BranchProbabilityInfo analysis pass to read any metadata
encoding of probabilities. In the absense of metadata, it continues to
fall back on static heuristics.

This allows __builtin_expect, after lowering through llvm.expect
a branch instruction's metadata, to actually enter the branch
probability model. This is one component of resolving PR2577.

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

12 years agoAdd pass printing support to BlockFrequencyInfo pass. The implementation
Chandler Carruth [Wed, 19 Oct 2011 10:12:41 +0000 (10:12 +0000)]
Add pass printing support to BlockFrequencyInfo pass. The implementation
layer already had support for printing the results of this analysis, but
the wiring was missing.

Now that printing the analysis works, actually bring some of this
analysis, and the BranchProbabilityInfo analysis that it wraps, under
test! I'm planning on fixing some bugs and doing other work here, so
having a nice place to add regression tests and a way to observe the
results is really useful.

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

12 years agoDuncan pointed out that sometimes CC and CXX are used to specify the compiler. Also...
Bill Wendling [Wed, 19 Oct 2011 09:47:00 +0000 (09:47 +0000)]
Duncan pointed out that sometimes CC and CXX are used to specify the compiler. Also that the configure script takes care of finding an appropriate compiler if one's not specified.

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

12 years agoAdd support for the vector-widening of vselect and vector-setcc
Nadav Rotem [Wed, 19 Oct 2011 09:45:11 +0000 (09:45 +0000)]
Add support for the vector-widening of vselect and vector-setcc

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

12 years agoUse bash instead.
Bill Wendling [Wed, 19 Oct 2011 09:25:49 +0000 (09:25 +0000)]
Use bash instead.

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

12 years agoMake sure we emit the 'movw' and 'movt' only if it's supported. Otherwise, use a...
Bill Wendling [Wed, 19 Oct 2011 09:24:02 +0000 (09:24 +0000)]
Make sure we emit the 'movw' and 'movt' only if it's supported. Otherwise, use a constant pool.

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

12 years agoRemove some dead code.
Bill Wendling [Wed, 19 Oct 2011 09:04:11 +0000 (09:04 +0000)]
Remove some dead code.

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

12 years agoMake changes so that this runs on FreeBSD.
Bill Wendling [Wed, 19 Oct 2011 08:42:07 +0000 (08:42 +0000)]
Make changes so that this runs on FreeBSD.

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

12 years agoRename PEXTR to PEXT. Add intrinsics for BMI instructions.
Craig Topper [Wed, 19 Oct 2011 07:48:35 +0000 (07:48 +0000)]
Rename PEXTR to PEXT. Add intrinsics for BMI instructions.

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

12 years agoAdding dependencies to allow -DBUILD_SHARED_LIBS=true to complete.
Joe Abbey [Wed, 19 Oct 2011 00:13:13 +0000 (00:13 +0000)]
Adding dependencies to allow -DBUILD_SHARED_LIBS=true to complete.

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

12 years agoAdded testcase for <rdar://problem/10215997>
Lang Hames [Tue, 18 Oct 2011 23:50:52 +0000 (23:50 +0000)]
Added testcase for <rdar://problem/10215997>

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

12 years agoEmit the MOVT instruction only if the # LPads is > 64K.
Bill Wendling [Tue, 18 Oct 2011 23:19:55 +0000 (23:19 +0000)]
Emit the MOVT instruction only if the # LPads is > 64K.

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

12 years agoFor Thumb mode, we need to use a constant pool if the value is too large to be
Bill Wendling [Tue, 18 Oct 2011 23:11:05 +0000 (23:11 +0000)]
For Thumb mode, we need to use a constant pool if the value is too large to be
used with the CMP instruction.

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

12 years agoRegenerate projects/sample/configure.
Daniel Dunbar [Tue, 18 Oct 2011 23:10:58 +0000 (23:10 +0000)]
Regenerate projects/sample/configure.

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

12 years agoprojects/sample: Import adapted form of current LLVM autoconf/Makefile setup so that...
Daniel Dunbar [Tue, 18 Oct 2011 23:10:47 +0000 (23:10 +0000)]
projects/sample: Import adapted form of current LLVM autoconf/Makefile setup so that projects/sample is standalone and not tied to the LLVM build setup.
 - This currently just moves over all of the behavior from LLVM. Eventually all of the configure checks that are directly needed by the LLVM build setup should probably go away, and the project should manage their own configuration checks if necessary.

 - This is the 1st half of this work, the actual Makefile.common hasn't moved over yet. I've tried to stage this in such a way that incremental builds will properly reconfigure for most active developers (the Makefiles don't handle reconfiguring in a perfectly reliable way, and I haven't found an easy way to make them do so).

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

12 years agoRevert "Turn on the vzeroupper pass by default."
Eric Christopher [Tue, 18 Oct 2011 23:10:11 +0000 (23:10 +0000)]
Revert "Turn on the vzeroupper pass by default."

This reverts commit 494f7ac3e8d2ab3d94e52317abf9c42a949fe1f3.

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

12 years agoAdd additional element-promotion tests.
Nadav Rotem [Tue, 18 Oct 2011 23:05:33 +0000 (23:05 +0000)]
Add additional element-promotion tests.

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

12 years agoARM VTBL (one register) assembly parsing and encoding.
Jim Grosbach [Tue, 18 Oct 2011 23:02:30 +0000 (23:02 +0000)]
ARM VTBL (one register) assembly parsing and encoding.

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

12 years agoUse the integer compare when the value is small enough. Use the "move into a
Bill Wendling [Tue, 18 Oct 2011 22:52:20 +0000 (22:52 +0000)]
Use the integer compare when the value is small enough. Use the "move into a
register and then compare against that" method when it's too large. We have to
move the value into the register in the "movw, movt" pair of instructions.

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