8 years agoBitcode: Don't optimize constants when preserving use-list order
Duncan P. N. Exon Smith [Fri, 25 Jul 2014 16:13:16 +0000 (16:13 +0000)]
Bitcode: Don't optimize constants when preserving use-list order

`ValueEnumerator::OptimizeConstants()` creates forward references within
the constant pools, which makes predicting constants' use-list order
difficult.  For now, just disable the optimization.

This can be re-enabled in the future in one of two ways:

  - Enable a limited version of this optimization that doesn't create
    forward references.  One idea is to categorize constants by their
    "height" and make that the top-level sort.

  - Enable it entirely.  This requires predicting how may times each
    constant will be recreated as its operands' and operands' operands'
    (etc.) forward references get resolved.

This is part of PR5680.

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

8 years agoRecommit r212203: Don't try to construct debug LexicalScopes hierarchy for functions...
David Blaikie [Fri, 25 Jul 2014 16:10:16 +0000 (16:10 +0000)]
Recommit r212203: Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information.

Reverted by Eric Christopher (Thanks!) in r212203 after Bob Wilson
reported LTO issues. Duncan Exon Smith and Aditya Nandakumar helped
provide a reduced reproduction, though the failure wasn't too hard to
guess, and even easier with the example to confirm.

The assertion that the subprogram metadata associated with an
llvm::Function matches the scope data referenced by the DbgLocs on the
instructions in that function is not valid under LTO. In LTO, a C++
inline function might exist in multiple CUs and the subprogram metadata
nodes will refer to the same llvm::Function. In this case, depending on
the order of the CUs, the first intance of the subprogram metadata may
not be the one referenced by the instructions in that function and the
assertion will fail.

A test case (test/DebugInfo/cross-cu-linkonce-distinct.ll) is added, the
assertion removed and a comment added to explain this situation.

This was then reverted again in r213581 as it caused PR20367. The root
cause of this was the early exit in LiveDebugVariables meant that
spurious DBG_VALUE intrinsics that referenced dead variables were not
removed, causing an assertion/crash later on. The fix is to have
LiveDebugVariables strip all DBG_VALUE intrinsics in functions without
debug info as they're not needed anyway. Test case added to cover this
situation (that occurs when a debug-having function is inlined into a
nodebug function) in test/DebugInfo/X86/nodebug_with_debug_loc.ll

Original commit message:

If a function isn't actually in a CU's subprogram list in the debug info
metadata, ignore all the DebugLocs and don't try to build scopes, track
variables, etc.

While this is possibly a minor optimization, it's also a correctness fix
for an incoming patch that will add assertions to LexicalScopes and the
debug info verifier to ensure that all scope chains lead to debug info
for the current function.

Fix up a few test cases that had broken/incomplete debug info that could
violate this constraint.

Add a test case where this occurs by design (inlining a
debug-info-having function in an attribute nodebug function - we want
this to work because /if/ the nodebug function is then inlined into a
debug-info-having function, it should be fine (and will work fine - we
just stitch the scopes up as usual), but should the inlining not happen
we need to not assert fail either).

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

8 years agoDebugInfo: Fix up some test cases to have more correct debug info metadata.
David Blaikie [Fri, 25 Jul 2014 16:05:18 +0000 (16:05 +0000)]
DebugInfo: Fix up some test cases to have more correct debug info metadata.

* Add CUs to the named CU node
* Add missing DW_TAG_subprogram nodes
* Add llvm::Functions to the DW_TAG_subprogram nodes

This cleans up the tests so that they don't break under a
soon-to-be-made change that is more strict about such things.

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

8 years agoAdd code owner of scoped-noalias metadata
Hal Finkel [Fri, 25 Jul 2014 15:54:55 +0000 (15:54 +0000)]
Add code owner of scoped-noalias metadata

Add myself as the code owner for the scoped-noalias metadata I've developed.

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

8 years agoConvert noalias parameter attributes into noalias metadata during inlining
Hal Finkel [Fri, 25 Jul 2014 15:50:08 +0000 (15:50 +0000)]
Convert noalias parameter attributes into noalias metadata during inlining

This functionality is currently turned off by default.

Part of the motivation for introducing scoped-noalias metadata is to enable the
preservation of noalias parameter attribute information after inlining.
Sometimes this can be inferred from the code in the caller after inlining, but
often we simply lose valuable information.

The overall process if fairly simple:
 1. Create a new unqiue scope domain.
 2. For each (used) noalias parameter, create a new alias scope.
 3. For each pointer, collect the underlying objects. Add a noalias scope for
    each noalias parameter from which we're not derived (and has not been
    captured prior to that point).
 4. Add an alias.scope for each noalias parameter from which we might be
    derived (or has been captured before that point).

Note that the capture checks apply only if one of the underlying objects is not
an identified function-local object.

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

8 years agoSimplify and improve scoped-noalias metadata semantics
Hal Finkel [Fri, 25 Jul 2014 15:50:02 +0000 (15:50 +0000)]
Simplify and improve scoped-noalias metadata semantics

In the process of fixing the noalias parameter -> metadata conversion process
that will take place during inlining (which will be committed soon, but not
turned on by default), I have come to realize that the semantics provided by
yesterday's commit are not really what we want. Here's why:

void foo(noalias a, noalias b, noalias c, bool x) {
  *q = x ? a : b;
  *c = *q;

Generically, we know that *c does not alias with *a and with *b (so there is an
'and' in what we know we're not), and we know that *q might be derived from *a
or from *b (so there is an 'or' in what we know that we are). So we do not want
the semantics currently, where any noalias scope matching any alias.scope
causes a NoAlias return. What we want to know is that the noalias scopes form a
superset of the alias.scope list (meaning that all the things we know we're not
is a superset of all of things the other instruction might be).

Making that change, however, introduces a composibility problem. If we inline
once, adding the noalias metadata, and then inline again adding more, and we
append new scopes onto the noalias and alias.scope lists each time. But, this
means that we could change what was a NoAlias result previously into a MayAlias
result because we appended an additional scope onto one of the alias.scope
lists. So, instead of giving scopes the ability to have parents (which I had
borrowed from the TBAA implementation, but seems increasingly unlikely to be
useful in practice), I've given them domains. The subset/superset condition now
applies within each domain independently, and we only need it to hold in one
domain. Each time we inline, we add the new scopes in a new scope domain, and
everything now composes nicely. In addition, this simplifies the

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

8 years agoTry to fix a layering violation introduced by r213945
Duncan P. N. Exon Smith [Fri, 25 Jul 2014 15:41:49 +0000 (15:41 +0000)]
Try to fix a layering violation introduced by r213945

The dragonegg buildbot (and others?) started failing after
r213945/r213946 because `llvm-as` wasn't linking in the bitcode reader.
I think moving the verify functions to the same file as the verify pass
should fix the build.  Adding a command-line option for maintaining
use-list order in assembly as a drive-by to prevent warnings about
unused static functions.

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

8 years agoFix -Werror build after r213945
Duncan P. N. Exon Smith [Fri, 25 Jul 2014 15:00:02 +0000 (15:00 +0000)]
Fix -Werror build after r213945

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

8 years agoIPO: Add use-list-order verifier
Duncan P. N. Exon Smith [Fri, 25 Jul 2014 14:49:26 +0000 (14:49 +0000)]
IPO: Add use-list-order verifier

Add a -verify-use-list-order pass, which shuffles use-list order, writes
to bitcode, reads back, and verifies that the (shuffled) order matches.

  - The utility functions live in lib/IR/UseListOrder.cpp.

  - Moved (and renamed) the command-line option to enable writing
    use-lists, so that this pass can return early if the use-list orders
    aren't being serialized.

It's not clear that this pass is the right direction long-term (perhaps
a separate tool instead?), but short-term it's a great way to test the
use-list order prototype.  I've added an XFAIL-ed testcase that I'm
hoping to get working pretty quickly.

This is part of PR5680.

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

8 years ago[ARM] Emit ABI_PCS_R9_use build attribute.
Amara Emerson [Fri, 25 Jul 2014 14:03:14 +0000 (14:03 +0000)]
[ARM] Emit ABI_PCS_R9_use build attribute.

Patch by Ben Foster!

Differential Revision: http://reviews.llvm.org/D4657

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

8 years agoRun sort_includes.py on the AArch64 backend.
Benjamin Kramer [Fri, 25 Jul 2014 11:42:14 +0000 (11:42 +0000)]
Run sort_includes.py on the AArch64 backend.

No functionality change.

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

8 years ago[cmake] Use the external project machinery for libcxxabi so that it can
Chandler Carruth [Fri, 25 Jul 2014 10:27:40 +0000 (10:27 +0000)]
[cmake] Use the external project machinery for libcxxabi so that it can
be disabled in CMake or relocated if desired.

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

8 years agollvm/test/CodeGen/ARM/inlineasm-global.ll: Add explicit triple to appease targeting...
NAKAMURA Takumi [Fri, 25 Jul 2014 09:55:01 +0000 (09:55 +0000)]
llvm/test/CodeGen/ARM/inlineasm-global.ll: Add explicit triple to appease targeting *-win32.

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

8 years agollvm/test/CodeGen/ARM/inlineasm-global.ll: Avoid specifing source file on llc.
NAKAMURA Takumi [Fri, 25 Jul 2014 09:54:49 +0000 (09:54 +0000)]
llvm/test/CodeGen/ARM/inlineasm-global.ll: Avoid specifing source file on llc.

It sometimes confuses FileCheck. Consider the case that path contains 'stmib'. :)

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

8 years ago[SDAG] Enable the new assert for out-of-range result numbers in
Chandler Carruth [Fri, 25 Jul 2014 09:19:23 +0000 (09:19 +0000)]
[SDAG] Enable the new assert for out-of-range result numbers in
SDValues, fixing the two bugs left in the regression suite.

The key for both of these was the use a single value type rather than
a VTList which caused an unintentionally single-result merge-value node.
Fix this by getting the appropriate VTList in place.

Doing this exposed that the comments in x86's code abouth how MUL_LOHI
operands are handle is wrong. The bug with the use of out-of-range
result numbers was hiding the bug about the order of operands here (as
best i can tell). There are more places where the code appears to get
this backwards still...

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

8 years ago[SDAG] Don't insert the VRBase into a mapping from SDValues when the def
Chandler Carruth [Fri, 25 Jul 2014 09:19:18 +0000 (09:19 +0000)]
[SDAG] Don't insert the VRBase into a mapping from SDValues when the def
doesn't actually correspond to an SDValue at all. Fixes most of the
remaining asserts on out-of-range SDValue result numbers.

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

8 years agoStore nodes only have 1 result.
Matt Arsenault [Fri, 25 Jul 2014 07:56:42 +0000 (07:56 +0000)]
Store nodes only have 1 result.

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

8 years ago[SDAG] Start plumbing an assert into SDValues that we don't form one
Chandler Carruth [Fri, 25 Jul 2014 07:23:23 +0000 (07:23 +0000)]
[SDAG] Start plumbing an assert into SDValues that we don't form one
with a result number outside the range of results for the node.

I don't know how we managed to not really check this very basic
invariant for so long, but the code is *very* broken at this point.
I have over 270 test failures with the assert enabled. I'm committing it
disabled so that others can join in the cleanup effort and reproduce the
issues. I've also included one of the obvious fixes that I already
found. More fixes to come.

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

8 years ago[ARM] In thumb mode, emit directive ".code 16" before file level inline
Akira Hatanaka [Fri, 25 Jul 2014 05:12:49 +0000 (05:12 +0000)]
[ARM] In thumb mode, emit directive ".code 16" before file level inline
assembly instructions.

This is necessary to ensure ARM assembler switches to Thumb mode before it
starts assembling the file level inline assembly instructions at the beginning
of a .s file.


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

8 years ago[X86] Add comments to clarify some non-obvious lines in the stackmap-nops.ll
Lang Hames [Fri, 25 Jul 2014 04:50:08 +0000 (04:50 +0000)]
[X86] Add comments to clarify some non-obvious lines in the stackmap-nops.ll

Based on code review from Philip Reames. Thanks Philip!

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

8 years agollvm-vtabledump: use a std::map instead of a StringMap for VBTables
David Majnemer [Fri, 25 Jul 2014 04:30:11 +0000 (04:30 +0000)]
llvm-vtabledump: use a std::map instead of a StringMap for VBTables

StringMap doesn't guarantee any particular iteration order,
this is suboptimal when comparing llvm-vtabledump's output for two
object files.

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

8 years agoFix a warning in CoverageMappingReader.cpp
Ehsan Akhgari [Fri, 25 Jul 2014 02:51:57 +0000 (02:51 +0000)]
Fix a warning in CoverageMappingReader.cpp

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

8 years ago[X86] Clarify some stackmap shadow optimization code as based on review
Lang Hames [Fri, 25 Jul 2014 02:29:19 +0000 (02:29 +0000)]
[X86] Clarify some stackmap shadow optimization code as based on review
feedback from Eric Christopher.

No functional change.

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

8 years ago[PATCH][PPC64LE] Correct little-endian usage of vmrgh* and vmrgl*.
Bill Schmidt [Fri, 25 Jul 2014 01:55:55 +0000 (01:55 +0000)]
[PATCH][PPC64LE] Correct little-endian usage of vmrgh* and vmrgl*.

Because the PowerPC vmrgh* and vmrgl* instructions have a built-in
big-endian bias, it is necessary to swap their inputs in little-endian
mode when using them to implement a vector shuffle.  This was
previously missed in the vector LE implementation.

There was already logic to distinguish between unary and "normal"
vmrg* vector shuffles, so this patch extends that logic to use a third
option:  "swapped" vmrg* vector shuffles that are used for little
endian in place of the "normal" ones.

I've updated the vec-shuffle-le.ll test to check for the expected
register ordering on the generated instructions.

This bug was discovered when testing the LE and ELFv2 patches for
safety if they were backported to 3.4.  A different vectorization
decision was made in 3.4 than on mainline trunk, and that exposed the
problem.  I've verified this fix takes care of that issue.

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

8 years agoAdd code coverage mapping data, reader, and writer.
Alex Lorenz [Thu, 24 Jul 2014 23:57:54 +0000 (23:57 +0000)]
Add code coverage mapping data, reader, and writer.

This patch implements the data structures, the reader and
the writers for the new code coverage mapping system.
The new code coverage mapping system uses the instrumentation
based profiling to provide code coverage analysis.

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

8 years agoAdd code coverage mapping data, reader, and writer.
Alex Lorenz [Thu, 24 Jul 2014 23:55:56 +0000 (23:55 +0000)]
Add code coverage mapping data, reader, and writer.

This patch implements the data structures, the reader and
the writers for the new code coverage mapping system.
The new code coverage mapping system uses the instrumentation
based profiling to provide code coverage analysis.

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

8 years agoAdd an implementation for llvm-nm’s -print-file-name option (aka -o and -A).
Kevin Enderby [Thu, 24 Jul 2014 23:31:52 +0000 (23:31 +0000)]
Add an implementation for llvm-nm’s -print-file-name option (aka -o and -A).

The -print-file-name option in llvm-nm is to precede each symbol
with the object file it came from.  While code for the parsing of this
option and its aliases existed there was no code to implement it.

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

8 years agoOpportunistically fix the builders
David Majnemer [Thu, 24 Jul 2014 23:26:54 +0000 (23:26 +0000)]
Opportunistically fix the builders

A builder complained that it couldn't find llvm-vtabledump, this is
probably because it wasn't a dependency of the 'test' target.

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

8 years agollvm-vtabledump: A vtable dumper
David Majnemer [Thu, 24 Jul 2014 23:14:40 +0000 (23:14 +0000)]
llvm-vtabledump: A vtable dumper

This tool's job is to dump the vtables inside object files.  It is
currently limited to MS ABI vf- and vb-tables but it will eventually
support Itanium-style v-tables as well.

Differential Revision: http://reviews.llvm.org/D4584

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

8 years agoAfter unrolling a loop with llvm.loop.unroll.count metadata (unroll factor
Mark Heffernan [Thu, 24 Jul 2014 22:36:40 +0000 (22:36 +0000)]
After unrolling a loop with llvm.loop.unroll.count metadata (unroll factor
hint) the loop unroller replaces the llvm.loop.unroll.count metadata with
llvm.loop.unroll.disable metadata to prevent any subsequent unrolling
passes from unrolling more than the hint indicates.  This patch fixes
an issue where loop unrolling could be disabled for other loops as well which
share the same llvm.loop metadata.

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

8 years agoDon't use 128bit functions on PPC32.
Joerg Sonnenberger [Thu, 24 Jul 2014 22:20:10 +0000 (22:20 +0000)]
Don't use 128bit functions on PPC32.

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

8 years ago[SDAG] Introduce a combined set to the DAG combiner which tracks nodes
Chandler Carruth [Thu, 24 Jul 2014 22:15:28 +0000 (22:15 +0000)]
[SDAG] Introduce a combined set to the DAG combiner which tracks nodes
which have successfully round-tripped through the combine phase, and use
this to ensure all operands to DAG nodes are visited by the combiner,
even if they are only added during the combine phase.

This is critical to have the combiner reach nodes that are *introduced*
during combining. Previously these would sometimes be visited and
sometimes not be visited based on whether they happened to end up on the
worklist or not. Now we always run them through the combiner.

This fixes quite a few bad codegen test cases lurking in the suite while
also being more principled. Among these, the TLS codegeneration is
particularly exciting for programs that have this in the critical path
like TSan-instrumented binaries (although I think they engineer to use
a different TLS that is faster anyways).

I've tried to check for compile-time regressions here by running llc
over a merged (but not LTO-ed) clang bitcode file and observed at most
a 3% slowdown in llc. Given that this is essentially a worst case (none
of opt or clang are running at this phase) I think this is tolerable.
The actual LTO case should be even less costly, and the cost in normal
compilation should be negligible.

With this combining logic, it is possible to re-legalize as we combine
which is necessary to implement PSHUFB formation on x86 as
a post-legalize DAG combine (my ultimate goal).

Differential Revision: http://reviews.llvm.org/D4638

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

8 years ago[x86] Make vector legalization of extloads work more like the "normal"
Chandler Carruth [Thu, 24 Jul 2014 22:09:56 +0000 (22:09 +0000)]
[x86] Make vector legalization of extloads work more like the "normal"
vector operation legalization with support for custom target lowering
and fallback to expand when it fails, and use this to implement sext and
anyext load lowering for x86 in a more principled way.

Previously, the x86 backend relied on a target DAG combine to "combine
away" sextload and extload nodes prior to legalization, or would expand
them during legalization with terrible code. This is particularly
problematic because the DAG combine relies on running over non-canonical
DAG nodes at just the right time to match several common and important
patterns. It used a combine rather than lowering because we didn't have
good lowering support, and to expose some tricks being employed to more
combine phases.

With this change it becomes a proper lowering operation, the backend
marks that it can lower these nodes, and I've added support for handling
the canonical forms that don't have direct legal representations such as
sextload of a v4i8 -> v4i64 on AVX1. With this change, our test cases
for this behavior continue to pass even after the DAG combiner beigns
running more systematically over every node.

There is some noise caused by this in the test suite where we actually
use vector extends instead of subregister extraction. This doesn't
really seem like the right thing to do, but is unlikely to be a critical
regression. We do regress in one case where by lowering to the
target-specific patterns early we were able to combine away extraneous
legal math nodes. However, this regression is completely addressed by
switching to a widening based legalization which is what I'm working
toward anyways, so I've just switched the test to that mode.

Differential Revision: http://reviews.llvm.org/D4654

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

8 years agoTarget: invert condition for Windows
Saleem Abdulrasool [Thu, 24 Jul 2014 22:09:06 +0000 (22:09 +0000)]
Target: invert condition for Windows

The Microsoft ABI and MSVCRT are considered the canonical C runtime and ABI.
The long double routines are not part of this environment.  However, cygwin and
MinGW both provide supplementary implementations.  Change the condition to
reflect this reality.

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

8 years agoFeedback from Hans on r213815. No functionaility change.
Manman Ren [Thu, 24 Jul 2014 21:13:20 +0000 (21:13 +0000)]
Feedback from Hans on r213815. No functionaility change.

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

8 years agoWindows: Don't wildcard expand /? or -?
Hans Wennborg [Thu, 24 Jul 2014 21:09:45 +0000 (21:09 +0000)]
Windows: Don't wildcard expand /? or -?

Even if there's a file called c:\a, we want /? to be preserved as
an option, not expanded to a filename.

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

8 years ago[X86] Optimize stackmap shadows on X86.
Lang Hames [Thu, 24 Jul 2014 20:40:55 +0000 (20:40 +0000)]
[X86] Optimize stackmap shadows on X86.

This patch minimizes the number of nops that must be emitted on X86 to satisfy
stackmap shadow constraints.

To minimize the number of nops inserted, the X86AsmPrinter now records the
size of the most recent stackmap's shadow in the StackMapShadowTracker class,
and tracks the number of instruction bytes emitted since the that stackmap
instruction was encountered. Padding is emitted (if it is required at all)
immediately before the next stackmap/patchpoint instruction, or at the end of
the basic block.

This optimization should reduce code-size and improve performance for people
using the llvm stackmap intrinsic on X86.


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

8 years agoReplace an assertion with a fatal error
Reid Kleckner [Thu, 24 Jul 2014 19:53:33 +0000 (19:53 +0000)]
Replace an assertion with a fatal error

Frontends are responsible for putting inalloca on parameters that would
be passed in memory and not registers.

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

8 years agoUse the same .eh_frame encoding for 32bit PPC as on i386.
Joerg Sonnenberger [Thu, 24 Jul 2014 19:25:16 +0000 (19:25 +0000)]
Use the same .eh_frame encoding for 32bit PPC as on i386.

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

8 years agoTry to fix the bots again by moving test to X86 directory.
Manman Ren [Thu, 24 Jul 2014 17:57:09 +0000 (17:57 +0000)]
Try to fix the bots again by moving test to X86 directory.

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

8 years agoX86: correct library call setup for Windows itanium
Saleem Abdulrasool [Thu, 24 Jul 2014 17:46:36 +0000 (17:46 +0000)]
X86: correct library call setup for Windows itanium

This target is identical to the Windows MSVC (and follows Microsoft ABI for C).
Correct the library call setup for this target.  The same set of library calls
are missing on this environment.

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

8 years agoR600: Add FMA instructions for Evergreen
Matt Arsenault [Thu, 24 Jul 2014 17:41:01 +0000 (17:41 +0000)]
R600: Add FMA instructions for Evergreen

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

8 years agoTry to fix the bots. If this does not work, I am going to move it to X86 directory.
Manman Ren [Thu, 24 Jul 2014 17:18:33 +0000 (17:18 +0000)]
Try to fix the bots. If this does not work, I am going to move it to X86 directory.

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

8 years agoX86: silence sign comparison warning
Saleem Abdulrasool [Thu, 24 Jul 2014 17:12:06 +0000 (17:12 +0000)]
X86: silence sign comparison warning

GCC 4.8 detected a signed compare [-Wsign-compare].  Add a cast for the
destination index.  Add an assert to catch a potential overflow however unlikely
it may be.

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

8 years agoR600: Add new functions for splitting vector loads and stores.
Matt Arsenault [Thu, 24 Jul 2014 17:10:35 +0000 (17:10 +0000)]
R600: Add new functions for splitting vector loads and stores.

These will be used in future patches and shouldn't change anything yet.

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

8 years agoLet the integrated assembler understand .exitm, PR20426.
Nico Weber [Thu, 24 Jul 2014 17:08:39 +0000 (17:08 +0000)]
Let the integrated assembler understand .exitm, PR20426.

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

8 years agoRemove unused field MacroInstantiation::TheMacro. No behavior change.
Nico Weber [Thu, 24 Jul 2014 16:29:04 +0000 (16:29 +0000)]
Remove unused field MacroInstantiation::TheMacro. No behavior change.

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

8 years agoLet the integrated assembler understand .warning, PR20428.
Nico Weber [Thu, 24 Jul 2014 16:26:06 +0000 (16:26 +0000)]
Let the integrated assembler understand .warning, PR20428.

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

8 years agoInclude relative path for header outside the current directory.
Joerg Sonnenberger [Thu, 24 Jul 2014 16:04:46 +0000 (16:04 +0000)]
Include relative path for header outside the current directory.

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

8 years agoRemove dead code.
Rafael Espindola [Thu, 24 Jul 2014 16:02:28 +0000 (16:02 +0000)]
Remove dead code.

Every user has been switched to using EngineBuilder.

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

8 years agoAArch64: refactor ReconstructShuffle function
Tim Northover [Thu, 24 Jul 2014 15:39:55 +0000 (15:39 +0000)]
AArch64: refactor ReconstructShuffle function

Quite a bit of cruft had accumulated as we realised the various different cases
it had to handle and squeezed them in where possible. This refactoring mostly
flattens the logic and special-cases. The result is slightly longer, but I
think clearer.

Should be no functionality change.

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

8 years agoFix r213824 on windows
Duncan P. N. Exon Smith [Thu, 24 Jul 2014 15:16:23 +0000 (15:16 +0000)]
Fix r213824 on windows

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

8 years agoAdd scoped-noalias metadata
Hal Finkel [Thu, 24 Jul 2014 14:25:39 +0000 (14:25 +0000)]
Add scoped-noalias metadata

This commit adds scoped noalias metadata. The primary motivations for this
feature are:
  1. To preserve noalias function attribute information when inlining
  2. To provide the ability to model block-scope C99 restrict pointers

Neither of these two abilities are added here, only the necessary
infrastructure. In fact, there should be no change to existing functionality,
only the addition of new features. The logic that converts noalias function
parameters into this metadata during inlining will come in a follow-up commit.

What is added here is the ability to generally specify noalias memory-access
sets. Regarding the metadata, alias-analysis scopes are defined similar to TBAA

!scope0 = metadata !{ metadata !"scope of foo()" }
!scope1 = metadata !{ metadata !"scope 1", metadata !scope0 }
!scope2 = metadata !{ metadata !"scope 2", metadata !scope0 }
!scope3 = metadata !{ metadata !"scope 2.1", metadata !scope2 }
!scope4 = metadata !{ metadata !"scope 2.2", metadata !scope2 }

Loads and stores can be tagged with an alias-analysis scope, and also, with a
noalias tag for a specific scope:

... = load %ptr1, !alias.scope !{ !scope1 }
... = load %ptr2, !alias.scope !{ !scope1, !scope2 }, !noalias !{ !scope1 }

When evaluating an aliasing query, if one of the instructions is associated
with an alias.scope id that is identical to the noalias scope associated with
the other instruction, or is a descendant (in the scope hierarchy) of the
noalias scope associated with the other instruction, then the two memory
accesses are assumed not to alias.

Note that is the first element of the scope metadata is a string, then it can
be combined accross functions and translation units. The string can be replaced
by a self-reference to create globally unqiue scope identifiers.

[Note: This overview is slightly stylized, since the metadata nodes really need
to just be numbers (!0 instead of !scope0), and the scope lists are also global
unnamed metadata.]

Existing noalias metadata in a callee is "cloned" for use by the inlined code.
This is necessary because the aliasing scopes are unique to each call site
(because of possible control dependencies on the aliasing properties). For
example, consider a function: foo(noalias a, noalias b) { *a = *b; } that gets
inlined into bar() { ... if (...) foo(a1, b1); ... if (...) foo(a2, b2); } --
now just because we know that a1 does not alias with b1 at the first call site,
and a2 does not alias with b2 at the second call site, we cannot let inlining
these functons have the metadata imply that a1 does not alias with b2.

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

8 years agoFixing an MSVC conversion warning about implicitly converting the shift results to...
Aaron Ballman [Thu, 24 Jul 2014 14:24:59 +0000 (14:24 +0000)]
Fixing an MSVC conversion warning about implicitly converting the shift results to 64-bits. No functional change intended.

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

8 years ago[Target] Teach the query interfaces for lowering of extloads and
Chandler Carruth [Thu, 24 Jul 2014 12:20:53 +0000 (12:20 +0000)]
[Target] Teach the query interfaces for lowering of extloads and
truncstores to support EVTs and return expand for non-simple ones.

This makes them more consistent with the isLegal... query style methods
and makes using them simpler in many scenarios.

No functionality actually changed.

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

8 years agoAA metadata refactoring (introduce AAMDNodes)
Hal Finkel [Thu, 24 Jul 2014 12:16:19 +0000 (12:16 +0000)]
AA metadata refactoring (introduce AAMDNodes)

In order to enable the preservation of noalias function parameter information
after inlining, and the representation of block-level __restrict__ pointer
information (etc.), additional kinds of aliasing metadata will be introduced.
This metadata needs to be carried around in AliasAnalysis::Location objects
(and MMOs at the SDAG level), and so we need to generalize the current scheme
(which is hard-coded to just one TBAA MDNode*).

This commit introduces only the necessary refactoring to allow for the
introduction of other aliasing metadata types, but does not actually introduce
any (that will come in a follow-up commit). What it does introduce is a new
AAMDNodes structure to hold all of the aliasing metadata nodes associated with
a particular memory-accessing instruction, and uses that structure instead of
the raw MDNode* in AliasAnalysis::Location, etc.

No functionality change intended.

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

8 years agoPrune redundant libdeps.
NAKAMURA Takumi [Thu, 24 Jul 2014 11:45:27 +0000 (11:45 +0000)]
Prune redundant libdeps.

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

8 years agoPrune dependency to MC from each target disassembler.
NAKAMURA Takumi [Thu, 24 Jul 2014 11:45:11 +0000 (11:45 +0000)]
Prune dependency to MC from each target disassembler.

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

8 years ago[CMake] tools/lto: Prune redundant libdep(s).
NAKAMURA Takumi [Thu, 24 Jul 2014 11:44:44 +0000 (11:44 +0000)]
[CMake] tools/lto: Prune redundant libdep(s).

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

8 years ago[CMake] LineEditorTests: Add Support to link_components.
NAKAMURA Takumi [Thu, 24 Jul 2014 11:44:33 +0000 (11:44 +0000)]
[CMake] LineEditorTests: Add Support to link_components.

Even if LLVMSupport is added in add_unittests, LLVMSupport may be here as consistency.

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

8 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM STRH instructions.
Tilmann Scheller [Thu, 24 Jul 2014 09:55:46 +0000 (09:55 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM STRH instructions.

The ARM ARM prohibits STRH instructions with writeback into the source register. With this commit this constraint is now enforced and we stop assembling STRH instructions with unpredictable behavior.

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

8 years ago[mips] Fix ll and sc instructions
Daniel Sanders [Thu, 24 Jul 2014 09:47:14 +0000 (09:47 +0000)]
[mips] Fix ll and sc instructions

Summary: The ll and sc instructions for r6 and non-r6 are misplaced. This patch fixes that.

Patch by Jyun-Yan You

Differential Revision: http://reviews.llvm.org/D4578

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

8 years agoR600: Match rcp node on pre-SI
Matt Arsenault [Thu, 24 Jul 2014 06:59:24 +0000 (06:59 +0000)]
R600: Match rcp node on pre-SI

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

8 years agoR600: Fix LowerSDIV24
Matt Arsenault [Thu, 24 Jul 2014 06:59:20 +0000 (06:59 +0000)]
R600: Fix LowerSDIV24

Use ComputeNumSignBits instead of checking for i8 / i16 which only
worked when AMDIL was lying about having legal i8 / i16.

If an integer is known to fit in 24-bits, we can
do division faster with float ops.

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

8 years agoRemove unused substitution.
Rafael Espindola [Thu, 24 Jul 2014 04:09:04 +0000 (04:09 +0000)]
Remove unused substitution.

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

8 years agoIR: Fix comment from r213824
Duncan P. N. Exon Smith [Thu, 24 Jul 2014 02:56:59 +0000 (02:56 +0000)]
IR: Fix comment from r213824

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

8 years agoRemove a stray semicolon. [-Wpedantic]
NAKAMURA Takumi [Thu, 24 Jul 2014 02:11:24 +0000 (02:11 +0000)]
Remove a stray semicolon. [-Wpedantic]

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

8 years agoUpdate library dependencies.
NAKAMURA Takumi [Thu, 24 Jul 2014 02:10:42 +0000 (02:10 +0000)]
Update library dependencies.

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

8 years agoR600: Implement enableClusterLoads()
Matt Arsenault [Thu, 24 Jul 2014 02:10:17 +0000 (02:10 +0000)]
R600: Implement enableClusterLoads()

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

8 years ago[AArch64] Fix a bug generating incorrect instruction when building small vector.
Kevin Qin [Thu, 24 Jul 2014 02:05:42 +0000 (02:05 +0000)]
[AArch64] Fix a bug generating incorrect instruction when building small vector.

This bug is introduced by r211144. The element of operand may be
smaller than the element of result, but previous commit can
only handle the contrary condition. This commit is to handle this
scenario and generate optimized codes like ZIP1.

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

8 years ago[AArch64] Disable some optimization cases for type conversion from sint to fp, becaus...
Jiangning Liu [Thu, 24 Jul 2014 01:29:59 +0000 (01:29 +0000)]
[AArch64] Disable some optimization cases for type conversion from sint to fp, because those optimization cases are micro-architecture dependent and only make sense for Cyclone. A new predicate Cyclone is introduced in .td file.

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

8 years agoFixed PR20411 - bug in getINSERTPS()
Filipe Cabecinhas [Thu, 24 Jul 2014 01:28:21 +0000 (01:28 +0000)]
Fixed PR20411 - bug in getINSERTPS()

When we had a vector_shuffle where we had an input from each vector, we
could miscompile it because we were assuming the input from V2 wouldn't
be moved from where it was on the vector.

Added a test case.

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

8 years agoIR: Add Value::sortUseList()
Duncan P. N. Exon Smith [Thu, 24 Jul 2014 00:53:19 +0000 (00:53 +0000)]
IR: Add Value::sortUseList()

Add `Value::sortUseList()`, templated on the comparison function to use.

The sort is an iterative merge sort that uses a binomial vector of
already-merged lists to limit the size overhead to `O(1)`.

This is part of PR5680.

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

8 years agoAdd a VS "14" msbuild toolset
Reid Kleckner [Wed, 23 Jul 2014 23:49:16 +0000 (23:49 +0000)]
Add a VS "14" msbuild toolset

This allows people to try clang inside MSBuild with the VS "14" CTP

Fixes PR20341.

Patch by Marcel Raad!

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

8 years agoSimplifyCFG: fix a bug in switch to table conversion
Manman Ren [Wed, 23 Jul 2014 23:13:23 +0000 (23:13 +0000)]
SimplifyCFG: fix a bug in switch to table conversion

We use gep to access the global array "switch.table", and the table index
should be treated as unsigned. When the highest bit is 1, this commit
zero-extends the index to an integer type with larger size.

For a switch on i2, we used to generate:
%switch.tableidx = sub i2 %0, -2
getelementptr inbounds [4 x i64]* @switch.table, i32 0, i2 %switch.tableidx

It is incorrect when %switch.tableidx is 2 or 3. The fix is to generate
%switch.tableidx = sub i2 %0, -2
%switch.tableidx.zext = zext i2 %switch.tableidx to i3
getelementptr inbounds [4 x i64]* @switch.table, i32 0, i3 %switch.tableidx.zext


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

8 years agoFix the build when building with only the ARM backend.
Rafael Espindola [Wed, 23 Jul 2014 22:54:28 +0000 (22:54 +0000)]
Fix the build when building with only the ARM backend.

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

8 years agoDocument what backwards compatibility we provide for bitcode.
Rafael Espindola [Wed, 23 Jul 2014 22:43:22 +0000 (22:43 +0000)]
Document what backwards compatibility we provide for bitcode.

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

8 years agoLet llvm/test/CodeGen/X86/avx512*-mask-op.ll(s) aware of Win32 x64 calling convention.
NAKAMURA Takumi [Wed, 23 Jul 2014 22:38:25 +0000 (22:38 +0000)]
Let llvm/test/CodeGen/X86/avx512*-mask-op.ll(s) aware of Win32 x64 calling convention.

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

8 years agoFix indenting.
Eric Christopher [Wed, 23 Jul 2014 22:34:13 +0000 (22:34 +0000)]
Fix indenting.

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

8 years ago[x86] Rip out some broken test cases for avx512 i1 store support.
Chandler Carruth [Wed, 23 Jul 2014 22:29:19 +0000 (22:29 +0000)]
[x86] Rip out some broken test cases for avx512 i1 store support.

It isn't reasonable to test storing things using undef pointers --
storing through those is at best "good luck" and really should be
transformed to "unreachable". Random changes in the combiner can
randomly break these tests for no good reason. I'm following up on the
original commit regarding the right long-term strategy here.

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

8 years agoReorganize and simplify local variables.
Eric Christopher [Wed, 23 Jul 2014 22:27:10 +0000 (22:27 +0000)]
Reorganize and simplify local variables.

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

8 years agoFinish inverting the MC -> Object dependency.
Rafael Espindola [Wed, 23 Jul 2014 22:26:07 +0000 (22:26 +0000)]
Finish inverting the MC -> Object dependency.

There were still some disassembler bits in lib/MC, but their use of Object
was only visible in the includes they used, not in the symbols.

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

8 years ago[RuntimeDyld][AArch64] Update relocation tests and also add a simple GOT test.
Juergen Ributzka [Wed, 23 Jul 2014 22:23:17 +0000 (22:23 +0000)]
[RuntimeDyld][AArch64] Update relocation tests and also add a simple GOT test.

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

8 years agoRemove the query for TargetMachine and TargetInstrInfo since we're
Eric Christopher [Wed, 23 Jul 2014 22:12:03 +0000 (22:12 +0000)]
Remove the query for TargetMachine and TargetInstrInfo since we're
already inside TargetInstrInfo.

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

8 years agoArgPromo+DebugInfo: Handle updating debug info over multiple applications of argument...
David Blaikie [Wed, 23 Jul 2014 22:09:29 +0000 (22:09 +0000)]
ArgPromo+DebugInfo: Handle updating debug info over multiple applications of argument promotion.

While the subprogram map cache used by Dead Argument Elimination works
there, I made a mistake when reusing it for Argument Promotion in
r212128 because ArgPromo may transform functions more than once whereas
DAE transforms each function only once, removing all the dead arguments
in one go.

To address this, ensure that the map is updated after each argument

In retrospect it might be a little wasteful to create a map of all
subprograms when only handling a single CGSCC, but the alternative is
walking the debug info for each function in the CGSCC that gets updated.
It's not clear to me what the right tradeoff is there, but since the
current tradeoff seems to be working OK (and the code to keep things
updated is very cheap), let's stick with that for now.

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

8 years agoTest debug info in arg promotion with an actual promotion case, rather than a degener...
David Blaikie [Wed, 23 Jul 2014 21:30:59 +0000 (21:30 +0000)]
Test debug info in arg promotion with an actual promotion case, rather than a degenerate arg promotion that's actually DAE performed by ArgPromo

Also the debug location I had here was bogus, describing the location of
the call site as in the callee - and unnecessary, so just drop it.

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

8 years agoUse an explicit triple in testcase.
Jim Grosbach [Wed, 23 Jul 2014 20:46:32 +0000 (20:46 +0000)]
Use an explicit triple in testcase.

Make the test work better on non-darwin hosts. Hopefully.

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

8 years ago[X86,AArch64] Extend vcmp w/ unary op combine to work w/ more constants.
Jim Grosbach [Wed, 23 Jul 2014 20:41:43 +0000 (20:41 +0000)]
[X86,AArch64] Extend vcmp w/ unary op combine to work w/ more constants.

The transform to constant fold unary operations with an AND across a
vector comparison applies when the constant is not a splat of a scalar
as well.

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

8 years agoX86: restrict combine to when type sizes are safe.
Jim Grosbach [Wed, 23 Jul 2014 20:41:38 +0000 (20:41 +0000)]
X86: restrict combine to when type sizes are safe.

The folding of unary operations through a vector compare and mask operation
is only safe if the unary operation result is of the same size as its input.
For example, it's not safe for [su]itofp from v4i32 to v4f64.

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

8 years agoDAG: fp->int conversion for non-splat constants.
Jim Grosbach [Wed, 23 Jul 2014 20:41:31 +0000 (20:41 +0000)]
DAG: fp->int conversion for non-splat constants.

Constant fold the lanes of the input constant build_vector individually
so we correctly handle when the vector elements are not all the same
constant value.


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

8 years ago[NVPTX] Add some extra tests for mul.wide to test non-power-of-two source types
Justin Holewinski [Wed, 23 Jul 2014 20:23:49 +0000 (20:23 +0000)]
[NVPTX] Add some extra tests for mul.wide to test non-power-of-two source types

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

8 years ago[NVPTX] Silence a GCC warning found by the buildbots
Justin Holewinski [Wed, 23 Jul 2014 20:23:47 +0000 (20:23 +0000)]
[NVPTX] Silence a GCC warning found by the buildbots

The cast to NVPTXTargetLowering was missing a 'const', but let's
just access the right pointer through the subtarget anyway.

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

8 years agoDo not add unroll disable metadata after unrolling pass for loops with #pragma clang...
Mark Heffernan [Wed, 23 Jul 2014 20:05:44 +0000 (20:05 +0000)]
Do not add unroll disable metadata after unrolling pass for loops with #pragma clang loop unroll(full).

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

8 years ago[FastISel][AArch64] Fix return type in FastLowerCall.
Juergen Ributzka [Wed, 23 Jul 2014 20:03:13 +0000 (20:03 +0000)]
[FastISel][AArch64] Fix return type in FastLowerCall.

I used the wrong method to obtain the return type inside FinishCall. This fix
simply uses the return type from FastLowerCall, which we already determined to
be a valid type.

Reduced test case from Chad. Thanks.

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

8 years ago[NVPTX] mul.wide generation works for any smaller integer source types, not just...
Justin Holewinski [Wed, 23 Jul 2014 18:46:03 +0000 (18:46 +0000)]
[NVPTX] mul.wide generation works for any smaller integer source types, not just the next smaller power of two

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

8 years ago[SKX] Added missed test files for rev 213757
Robert Khasanov [Wed, 23 Jul 2014 18:17:49 +0000 (18:17 +0000)]
[SKX] Added missed test files for rev 213757

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

8 years agoAsmParser: remove deprecated LLIR support
Saleem Abdulrasool [Wed, 23 Jul 2014 18:09:31 +0000 (18:09 +0000)]
AsmParser: remove deprecated LLIR support

linker_private and linker_private_weak were deprecated in 3.5.  Remove support
for them now that the 3.5 branch has been created.

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

8 years agoExecutionEngine: remove a stray semicolon
Saleem Abdulrasool [Wed, 23 Jul 2014 18:09:28 +0000 (18:09 +0000)]
ExecutionEngine: remove a stray semicolon

Detected via GCC 4.8 [-Wpedantic].

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

8 years ago[SKX] Fix lowercase "error:" in rev 213757
Robert Khasanov [Wed, 23 Jul 2014 17:42:13 +0000 (17:42 +0000)]
[SKX] Fix lowercase "error:" in rev 213757

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

8 years ago[NVPTX] Make sure we do not generate MULWIDE ISD nodes when optimizations are disabled
Justin Holewinski [Wed, 23 Jul 2014 17:40:45 +0000 (17:40 +0000)]
[NVPTX] Make sure we do not generate MULWIDE ISD nodes when optimizations are disabled

With optimizations disabled, we disable the isel patterns for mul.wide; but we
were still generating MULWIDE ISD nodes.  Now, we only try to generate MULWIDE
ISD nodes in DAGCombine if the optimization level is not zero.

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