Jim Grosbach [Fri, 21 Oct 2011 20:35:01 +0000 (20:35 +0000)]
Assembly parsing for 4-register variant of VLD1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142682
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 21 Oct 2011 20:28:19 +0000 (20:28 +0000)]
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142681
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 21 Oct 2011 20:12:47 +0000 (20:12 +0000)]
BranchProbabilityInfo: floating point equality is unlikely.
This is from the same paper from Ball and Larus as the rest of the currently implemented heuristics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142677
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Fri, 21 Oct 2011 20:02:19 +0000 (20:02 +0000)]
Assembly parsing for 3-register variant of VLD1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142675
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 21 Oct 2011 19:26:54 +0000 (19:26 +0000)]
STABS symbols are debug symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142673
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Fri, 21 Oct 2011 19:11:34 +0000 (19:11 +0000)]
Minor simplification: use ShuffleVectorInst::getMaskValue instead of a more expensive helper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142672
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Fri, 21 Oct 2011 19:06:29 +0000 (19:06 +0000)]
Extend instcombine's shufflevector simplification to handle more cases where the input and output vectors have different sizes. Patch by Xiaoyi Guo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142671
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Fri, 21 Oct 2011 18:54:25 +0000 (18:54 +0000)]
ARM VLD parsing and encoding.
Next step in the ongoing saga of NEON load/store assmebly parsing. Handle
VLD1 instructions that take a two-register register list.
Adjust the instruction definitions to only have the single encoded register
as an operand. The super-register from the pseudo is kept as an implicit def,
so passes which come after pseudo-expansion still know that the instruction
defines the other subregs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142670
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 21 Oct 2011 18:43:28 +0000 (18:43 +0000)]
Don't automatically set the "fc" bits on MSR instructions if the user didn't ask for them. This is a divergence from gas' behavior, but it is correct per the documentation and allows us to forge ahead with roundtrip testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142669
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 21 Oct 2011 18:21:22 +0000 (18:21 +0000)]
Bind libObject API for obtaining the section containing a Symbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142667
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 21 Oct 2011 17:50:59 +0000 (17:50 +0000)]
Expand the coverage of the libObject C bindings to include more SectionRef accessors as well as Symbol iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142661
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Fri, 21 Oct 2011 17:35:19 +0000 (17:35 +0000)]
Fix pr11194. When promoting and splitting integers we need to use
ZExtPromotedInteger and SExtPromotedInteger based on the operation we legalize.
SetCC return type needs to be legalized via PromoteTargetBoolean.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142660
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Fri, 21 Oct 2011 16:59:08 +0000 (16:59 +0000)]
Nuke an #if0 that got accidentally left in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142658
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Fri, 21 Oct 2011 16:56:40 +0000 (16:56 +0000)]
whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142657
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 21 Oct 2011 16:41:39 +0000 (16:41 +0000)]
Don't hard code the desired alignment for loops -- it isn't 16-bytes on
all x86 systems. Sorry for the breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142656
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Fri, 21 Oct 2011 16:14:12 +0000 (16:14 +0000)]
Remove some outdated comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142653
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Fri, 21 Oct 2011 11:42:07 +0000 (11:42 +0000)]
1. Fix the widening of SETCC in WidenVecOp_SETCC. Use the correct return CC type.
2. Fix a typo in CONCAT_VECTORS which exposed the bug in #1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142648
91177308-0d34-0410-b5e6-
96231b3b80d8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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