OSDN Git Service

android-x86/external-llvm.git
7 years ago[FileCheck] Added --enable-var-scope option to enable scope for regex variables.
Artem Belevich [Thu, 9 Mar 2017 17:59:04 +0000 (17:59 +0000)]
[FileCheck] Added --enable-var-scope option to enable scope for regex variables.

If `--enable-var-scope` is in effect, variables with names that
start with `$` are considered to be global. All other variables are
local. All local variables get undefined at the beginning of each
CHECK-LABEL block. Global variables are not affected by CHECK-LABEL.
This makes it easier to ensure that individual tests are not affected
by variables set in preceding tests.

Differential Revision: https://reviews.llvm.org/D30749

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

7 years ago[Hexagon] Add -mhvx option to the Hexagon backend
Krzysztof Parzyszek [Thu, 9 Mar 2017 17:05:11 +0000 (17:05 +0000)]
[Hexagon] Add -mhvx option to the Hexagon backend

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

7 years ago[Hexagon] Propagate zext of i1 into arithmetic code in selection DAG
Krzysztof Parzyszek [Thu, 9 Mar 2017 16:29:30 +0000 (16:29 +0000)]
[Hexagon] Propagate zext of i1 into arithmetic code in selection DAG

(op ... (zext i1 c) ...) -> (select c (op ... 1 ...),
                                      (op ... 0 ...))

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

7 years ago[InstSimplify] vector div/rem with any zero element in divisor is undef
Sanjay Patel [Thu, 9 Mar 2017 16:20:52 +0000 (16:20 +0000)]
[InstSimplify] vector div/rem with any zero element in divisor is undef

This was suggested as a DAG simplification in the review for rL297026 :
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170306/435253.html
...but let's start with IR since we have actual docs for IR (LangRef).

Differential Revision:
https://reviews.llvm.org/D30665

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

7 years ago[ARM] Remove t2xtpk feature from tests
Sam Parker [Thu, 9 Mar 2017 15:14:32 +0000 (15:14 +0000)]
[ARM] Remove t2xtpk feature from tests

I previously removed the T2XtPk feature from the ARM backend, but it
looks like I missed some of the tests that were using the feature.

Differential Revision: https://reviews.llvm.org/D30778

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

7 years ago[DAG] recognize div/rem by 0 as undef before trying constant folding
Sanjay Patel [Thu, 9 Mar 2017 15:02:25 +0000 (15:02 +0000)]
[DAG] recognize div/rem by 0 as undef before trying constant folding

As discussed in the review thread for rL297026, this is actually 2 changes that
would independently fix all of the test cases in the patch:

1. Return undef in FoldConstantArithmetic for div/rem by 0.
2. Move basic undef simplifications for div/rem (simplifyDivRem()) before
   foldBinopIntoSelect() as a matter of efficiency.

I will handle the case of vectors with any zero element as a follow-up. That change
is the DAG sibling for D30665 + adding a check of vector elements to FoldConstantVectorArithmetic().

I'm deleting the test for PR30693 because it does not test for the actual bug any more
(dangers of using bugpoint).

Differential Revision:
https://reviews.llvm.org/D30741

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

7 years ago[X86][SSE] Speed up constant pool shuffle mask decoding with direct copy (PR32037).
Simon Pilgrim [Thu, 9 Mar 2017 14:06:39 +0000 (14:06 +0000)]
[X86][SSE] Speed up constant pool shuffle mask decoding with direct copy (PR32037).

If the constants are already the correct size, we can copy them directly into the shuffle mask.

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

7 years ago[mips] Revert fixes for PR32020.
Simon Dardis [Thu, 9 Mar 2017 14:03:26 +0000 (14:03 +0000)]
[mips] Revert fixes for PR32020.

The fix introduces segfaults and clobbers the value to be stored when
the atomic sequence loops.

Revert "[Target/MIPS] Kill dead code, no functional change intended."

This reverts commit r296153.

Revert "Recommit "[mips] Fix atomic compare and swap at O0.""

This reverts commit r296134.

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

7 years agoFixed typos in comments. NFCI.
Simon Pilgrim [Thu, 9 Mar 2017 13:57:04 +0000 (13:57 +0000)]
Fixed typos in comments. NFCI.

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

7 years agofix build on Cygwin
Nuno Lopes [Thu, 9 Mar 2017 13:43:31 +0000 (13:43 +0000)]
fix build on Cygwin

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

7 years ago[SelectionDAG] Make SelectCode return void
Joey Gouly [Thu, 9 Mar 2017 13:38:06 +0000 (13:38 +0000)]
[SelectionDAG] Make SelectCode return void

SelectCode has been returning nullptr since 182dac0 ("SDAG: Make
SelectCodeCommon return void", 2016-05-10). Make SelectCode also
return void instead, as all callers have been updated.

Patch by Sven van Haastregt.

Review: https://reviews.llvm.org/D30497

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

7 years ago[ARM] remove FIXMEs and add vcmp MC test
Sjoerd Meijer [Thu, 9 Mar 2017 13:28:37 +0000 (13:28 +0000)]
[ARM] remove FIXMEs and add vcmp MC test

Minor cleanup in ARMInstrVFP.td: removed some FIXMEs and added a MC test for
vcmp that was actually missing.

Differential Revision: https://reviews.llvm.org/D30745

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

7 years ago[PM/Inliner] Make the new PM's inliner process call edges across an
Chandler Carruth [Thu, 9 Mar 2017 11:35:40 +0000 (11:35 +0000)]
[PM/Inliner] Make the new PM's inliner process call edges across an
entire SCC before iterating on newly-introduced call edges resulting
from any inlined function bodies.

This more closely matches the behavior of the old PM's inliner. While it
wasn't really clear to me initially, this behavior is actually essential
to the inliner behaving reasonably in its current design.

Because the inliner is fundamentally a bottom-up inliner and all of its
cost modeling is designed around that it often runs into trouble within
an SCC where we don't have any meaningful bottom-up ordering to use. In
addition to potentially cyclic, infinite inlining that we block with the
inline history mechanism, it can also take seemingly simple call graph
patterns within an SCC and turn them into *insanely* large functions by
accidentally working top-down across the SCC without any of the
threshold limitations that traditional top-down inliners use.

Consider this diabolical monster.cpp file that Richard Smith came up
with to help demonstrate this issue:
```
template <int N> extern const char *str;

void g(const char *);

template <bool K, int N> void f(bool *B, bool *E) {
  if (K)
    g(str<N>);
  if (B == E)
    return;
  if (*B)
    f<true, N + 1>(B + 1, E);
  else
    f<false, N + 1>(B + 1, E);
}
template <> void f<false, MAX>(bool *B, bool *E) { return f<false, 0>(B, E); }
template <> void f<true, MAX>(bool *B, bool *E) { return f<true, 0>(B, E); }

extern bool *arr, *end;
void test() { f<false, 0>(arr, end); }
```

When compiled with '-DMAX=N' for various values of N, this will create an SCC
with a reasonably large number of functions. Previously, the inliner would try
to exhaust the inlining candidates in a single function before moving on. This,
unfortunately, turns it into a top-down inliner within the SCC. Because our
thresholds were never built for that, we will incrementally decide that it is
always worth inlining and proceed to flatten the entire SCC into that one
function.

What's worse, we'll then proceed to the next function, and do the exact same
thing except we'll skip the first function, and so on. And at each step, we'll
also make some of the constant factors larger, which is awesome.

The fix in this patch is the obvious one which makes the new PM's inliner use
the same technique used by the old PM: consider all the call edges across the
entire SCC before beginning to process call edges introduced by inlining. The
result of this is essentially to distribute the inlining across the SCC so that
every function incrementally grows toward the inline thresholds rather than
allowing the inliner to grow one of the functions vastly beyond the threshold.
The code for this is a bit awkward, but it works out OK.

We could consider in the future doing something more powerful here such as
prioritized order (via lowest cost and/or profile info) and/or a code-growth
budget per SCC. However, both of those would require really substantial work
both to design the system in a way that wouldn't break really useful
abstraction decomposition properties of the current inliner and to be tuned
across a reasonably diverse set of code and workloads. It also seems really
risky in many ways. I have only found a single real-world file that triggers
the bad behavior here and it is generated code that has a pretty pathological
pattern. I'm not worried about the inliner not doing an *awesome* job here as
long as it does *ok*. On the other hand, the cases that will be tricky to get
right in a prioritized scheme with a budget will be more common and idiomatic
for at least some frontends (C++ and Rust at least). So while these approaches
are still really interesting, I'm not in a huge rush to go after them. Staying
even closer to the existing PM's behavior, especially when this easy to do,
seems like the right short to medium term approach.

I don't really have a test case that makes sense yet... I'll try to find a
variant of the IR produced by the monster template metaprogram that is both
small enough to be sane and large enough to clearly show when we get this wrong
in the future. But I'm not confident this exists. And the behavior change here
*should* be unobservable without snooping on debug logging. So there isn't
really much to test.

The test case updates come from two incidental changes:
1) We now visit functions in an SCC in the opposite order. I don't think there
   really is a "right" order here, so I just update the test cases.
2) We no longer compute some analyses when an SCC has no call instructions that
   we consider for inlining.

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

7 years ago[mips] Fix return lowering
Simon Dardis [Thu, 9 Mar 2017 11:19:48 +0000 (11:19 +0000)]
[mips] Fix return lowering

Fix a machine verifier issue where a instruction was using a invalid
register. The return pseudo is expanded and has the return address
register added to it. The return register may have been spuriously
mark as killed earlier.

This partially resolves PR/27458

Thanks to Quentin Colombet for reporting the issue!

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

7 years ago[SSP] In opt remarks, stream Function directly
Adam Nemet [Thu, 9 Mar 2017 06:10:27 +0000 (06:10 +0000)]
[SSP] In opt remarks, stream Function directly

With this, it shows up as an attribute in YAML and non-printable characters
are properly removed by GlobalValue::getRealLinkageName.

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

7 years ago[SLP] Mark values in Dot that need to be extracted
Adam Nemet [Thu, 9 Mar 2017 05:48:03 +0000 (05:48 +0000)]
[SLP] Mark values in Dot that need to be extracted

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

7 years agoDAG: Check no signed zeros instead of unsafe math attribute
Matt Arsenault [Thu, 9 Mar 2017 01:36:39 +0000 (01:36 +0000)]
DAG: Check no signed zeros instead of unsafe math attribute

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

7 years agoWholeProgramDevirt: Implement importing for uniform ret val opt.
Peter Collingbourne [Thu, 9 Mar 2017 01:11:15 +0000 (01:11 +0000)]
WholeProgramDevirt: Implement importing for uniform ret val opt.

Differential Revision: https://reviews.llvm.org/D29854

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

7 years agoAMDGPU: add missing lit.local.cfg to test/DebugInfo/AMDGPU
Konstantin Zhuravlyov [Thu, 9 Mar 2017 00:21:36 +0000 (00:21 +0000)]
AMDGPU: add missing lit.local.cfg to test/DebugInfo/AMDGPU

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

7 years agoWholeProgramDevirt: Implement importing for single-impl devirtualization.
Peter Collingbourne [Thu, 9 Mar 2017 00:21:25 +0000 (00:21 +0000)]
WholeProgramDevirt: Implement importing for single-impl devirtualization.

Differential Revision: https://reviews.llvm.org/D29844

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

7 years agoPerform symbol binding for .symver versioned symbols
Teresa Johnson [Thu, 9 Mar 2017 00:19:49 +0000 (00:19 +0000)]
Perform symbol binding for .symver versioned symbols

Summary:
In a .symver assembler directive like:
.symver name, name2@@nodename
"name2@@nodename" should get the same symbol binding as "name".

While the ELF object writer is updating the symbol binding for .symver
aliases before emitting the object file, not doing so when the module
inline assembly is handled by the RecordStreamer is causing the wrong
behavior in *LTO mode.

E.g. when "name" is global, "name2@@nodename" must also be marked as
global. Otherwise, the symbol is skipped when iterating over the LTO
InputFile symbols (InputFile::Symbol::shouldSkip). So, for example,
when performing any *LTO via the gold-plugin, the versioned symbol
definition is not recorded by the plugin and passed back to the
linker. If the object was in an archive, and there were no other symbols
needed from that object, the object would not be included in the final
link and references to the versioned symbol are undefined.

The llvm-lto2 tests added will give an error about an unused symbol
resolution without the fix.

Reviewers: rafael, pcc

Reviewed By: pcc

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D30485

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

7 years agoAMDGPU/SI: Disable unrolling in the loop vectorizer if the loop is not vectorized.
Changpeng Fang [Thu, 9 Mar 2017 00:07:00 +0000 (00:07 +0000)]
AMDGPU/SI: Disable unrolling in the loop vectorizer if the loop is not vectorized.

Reviewers:
  arsenm

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

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

7 years agoDon't merge global constants with non-dbg metadata.
Evgeniy Stepanov [Thu, 9 Mar 2017 00:03:37 +0000 (00:03 +0000)]
Don't merge global constants with non-dbg metadata.

!type metadata can not be dropped. An alternative to this is adding
!type metadata from the replaced globals to the replacement, but that
may weaken type tests and make them slower at the same time.

The merged global gets !dbg metadata from replaced globals, and can
end up with multiple debug locations.

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

7 years ago[DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and...
Konstantin Zhuravlyov [Wed, 8 Mar 2017 23:55:44 +0000 (23:55 +0000)]
[DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types

Differential Revision: https://reviews.llvm.org/D29670

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

7 years ago[Outliner] Fix memory leak in suffix tree.
Jessica Paquette [Wed, 8 Mar 2017 23:55:33 +0000 (23:55 +0000)]
[Outliner] Fix memory leak in suffix tree.

This commit changes the BumpPtrAllocator for suffix tree nodes to a SpecificBumpPtrAllocator.
Before, node construction was leaking memory because of the DenseMap in SuffixTreeNodes.
Changing this to a SpecificBumpPtrAllocator allows this memory to properly be released.

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

7 years ago[ConstantFold] Fix defect in constant folding computation for GEP
Javed Absar [Wed, 8 Mar 2017 23:01:50 +0000 (23:01 +0000)]
[ConstantFold] Fix defect in constant folding computation for GEP

When the array indexes are all determined by GVN to be constants,
a call is made to constant-folding to optimize/simplify the address
computation.

The constant-folding, however, makes a mistake in that it sometimes reads
back stale Idxs instead of NewIdxs, that it re-computed in previous iteration.
This leads to incorrect addresses coming out of constant-folding to GEP.
A test case is included. The error is only triggered when indexes have particular
patterns that the stale/new index updates interplay matters.

Reviewers: Daniel Berlin
Differential Revision: https://reviews.llvm.org/D30642

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

7 years ago[Support] Add llvm::sys::fs::remove_directories.
Zachary Turner [Wed, 8 Mar 2017 22:49:32 +0000 (22:49 +0000)]
[Support] Add llvm::sys::fs::remove_directories.

We already have a function create_directories() which can create
an entire tree, and remove() which can remove an empty directory,
but we do not have remove_directories() which can remove an entire
tree.  This patch adds such a function.

Because removing a directory tree can have dangerous consequences
when the tree contains a directory symlink, the patch here updates
the existing directory_iterator construct to optionally not follow
symlinks (previously it would always follow symlinks).  The delete
algorithm uses this flag so that for symlinks, only the links are
removed, and not the targets.

On Windows this is implemented with SHFileOperation, which also
does not recurse into symbolic links or junctions.

Differential Revision: https://reviews.llvm.org/D30676

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

7 years agoAdd red zones to BumpPtrAllocator under ASan
Jordan Rose [Wed, 8 Mar 2017 21:53:12 +0000 (21:53 +0000)]
Add red zones to BumpPtrAllocator under ASan

To help catch buffer overruns, this patch changes BumpPtrAllocator to
insert an extra unused byte between allocations when building with
ASan. SpecificBumpPtrAllocator opts out of this behavior, since it
needs to destroy its items later by walking the allocated memory.

Reviewed by Pete Cooper.

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

7 years ago[MemCpyOpt] clang-format + trim the legacy pass. NFC.
George Burgess IV [Wed, 8 Mar 2017 21:28:19 +0000 (21:28 +0000)]
[MemCpyOpt] clang-format + trim the legacy pass. NFC.

None of the declarations below `// Helper functions` seem to have
definitions anymore.

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

7 years agoGlobalISel: correctly handle trivial fcmp predicates.
Tim Northover [Wed, 8 Mar 2017 18:49:54 +0000 (18:49 +0000)]
GlobalISel: correctly handle trivial fcmp predicates.

It makes sense to only do them once in IRTranslator rather than making everyone
deal with them.

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

7 years ago[SLP] Visualize SLP trees with -view-slp-tree
Adam Nemet [Wed, 8 Mar 2017 18:47:50 +0000 (18:47 +0000)]
[SLP] Visualize SLP trees with -view-slp-tree

Analyzing larger trees is extremely difficult with the current debug output so
this adds GraphTraits and DOTGraphTraits on top of the VectorizableTree data
structure.  We can now display the SLP trees with Graphviz as in
https://reviews.llvm.org/F3132765.

I decorated the graph where a value needs to be gathered for one reason or
another.  These are the red nodes.

There are other improvement I am planning to make as I work through my case
here.  For example, I would also like to mark nodes that need to be extracted.

Differential Revision: https://reviews.llvm.org/D30731

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

7 years ago[LV] Select legal insert point when fixing first-order recurrences
Matthew Simpson [Wed, 8 Mar 2017 18:18:20 +0000 (18:18 +0000)]
[LV] Select legal insert point when fixing first-order recurrences

Because IRBuilder performs constant-folding, it's not guaranteed that an
instruction in the original loop map to an instruction in the vector loop. It
could map to a constant vector instead. The handling of first-order recurrences
was incorrectly making this assumption when setting the IRBuilder's insert
point.

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

7 years ago[GlobalISel] Add default action for G_FNEG
Volkan Keles [Wed, 8 Mar 2017 18:09:14 +0000 (18:09 +0000)]
[GlobalISel] Add default action for G_FNEG

Summary: rL297171 introduced G_FNEG for floating-point negation instruction and IRTranslator started to translate `FSUB -0.0, X` to `FNEG X`. This patch adds a default action for G_FNEG to avoid breaking existing targets.

Reviewers: qcolombet, ab, kristof.beyls, t.p.northover, aditya_nandakumar, dsanders

Reviewed By: qcolombet

Subscribers: dberris, rovka, llvm-commits

Differential Revision: https://reviews.llvm.org/D30721

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

7 years agoResubmit FileSystem changes.
Zachary Turner [Wed, 8 Mar 2017 17:56:08 +0000 (17:56 +0000)]
Resubmit FileSystem changes.

This was originall reverted due to some test failures in
ModuleCache and TestCompDirSymlink.  These issues have all
been resolved and the code now passes all tests.

Differential Revision: https://reviews.llvm.org/D30698

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

7 years ago[x86] regenerate checks; NFC
Sanjay Patel [Wed, 8 Mar 2017 17:19:56 +0000 (17:19 +0000)]
[x86] regenerate checks; NFC

This test could be reduced? The check fails for a seemingly unrelated change,
so I'm adding full checks to see what is happening.

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

7 years ago[LV] Make the test case for PR30183 less fragile
Matthew Simpson [Wed, 8 Mar 2017 17:03:38 +0000 (17:03 +0000)]
[LV] Make the test case for PR30183 less fragile

This patch also renames the PR number the test points to. The previous
reference was PR29559, but that bug was somehow deleted and recreated under
PR30183.

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

7 years ago[LV] Add missing check labels to tests and reformat
Matthew Simpson [Wed, 8 Mar 2017 16:55:34 +0000 (16:55 +0000)]
[LV] Add missing check labels to tests and reformat

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

7 years ago[Hexagon] Use correct offset when extracting from the high word
Krzysztof Parzyszek [Wed, 8 Mar 2017 15:46:28 +0000 (15:46 +0000)]
[Hexagon] Use correct offset when extracting from the high word

When extracting a bitfield from the high register in a register pair,
the final offset should be relative to the high register (for 32-bit
extracts).

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

7 years ago[Sparc] Check register use with isPhysRegUsed() instead of reg_nodbg_empty()
Daniel Cederman [Wed, 8 Mar 2017 15:23:10 +0000 (15:23 +0000)]
[Sparc] Check register use with isPhysRegUsed() instead of reg_nodbg_empty()

Summary: By using reg_nodbg_empty() to determine if a function can be
treated as a leaf function or not, we miss the case when the register
pair L0_L1 is used but not L0 by itself. This has the effect that
use_all_i32_regs(), a test in reserved-regs.ll which tries to use all
registers, gets treated as a leaf function.

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: davide, RKSimon, sepavloff, llvm-commits

Differential Revision: https://reviews.llvm.org/D27089

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

7 years ago[JumpThread] Use AA in SimplifyPartiallyRedundantLoad()
Jun Bum Lim [Wed, 8 Mar 2017 15:22:30 +0000 (15:22 +0000)]
[JumpThread] Use AA in SimplifyPartiallyRedundantLoad()

Summary: Use AA when scanning to find an available load value.

Reviewers: rengolin, mcrosier, hfinkel, trentxintong, dberlin

Reviewed By: rengolin, dberlin

Subscribers: aemerson, dberlin, llvm-commits

Differential Revision: https://reviews.llvm.org/D30352

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

7 years ago[InstCombine] avoid crashing on shuffle shrinkage when input type is not same as...
Sanjay Patel [Wed, 8 Mar 2017 15:02:23 +0000 (15:02 +0000)]
[InstCombine] avoid crashing on shuffle shrinkage when input type is not same as result type

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

7 years ago[ARM] Split up lsl-zero test into two tests
John Brawn [Wed, 8 Mar 2017 12:49:18 +0000 (12:49 +0000)]
[ARM] Split up lsl-zero test into two tests

On Windows stderr and stdout happen to get interleaved in a way that causes the
test to fail, so split it up into a test that checks for errors and a test that
doesn't.

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

7 years ago[LoopRotate] Propagate dbg.value intrinsics
Sam Parker [Wed, 8 Mar 2017 09:56:22 +0000 (09:56 +0000)]
[LoopRotate] Propagate dbg.value intrinsics

Recommitting patch which was previously reverted in r297159. These
changes should address the casting issues.

The original patch enables dbg.value intrinsics to be attached to
newly inserted PHI nodes.

Differential Review: https://reviews.llvm.org/D30701

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

7 years ago[X86][SSE] combineX86ShufflesRecursively can handle shuffle masks up to 64 elements...
Simon Pilgrim [Wed, 8 Mar 2017 09:36:39 +0000 (09:36 +0000)]
[X86][SSE] combineX86ShufflesRecursively can handle shuffle masks up to 64 elements wide

By defining the mask types as SmallVector<int, 16> we were causing a lot of unnecessary heap usage.

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

7 years ago[Support] Remove unit test for fs::is_local
Jonas Hahnfeld [Wed, 8 Mar 2017 08:36:21 +0000 (08:36 +0000)]
[Support] Remove unit test for fs::is_local

rL295768 introduced this test that fails if LLVM is built and tested on
an NFS share. Delete the test as discussed on the corresponing commit
thread. The only feasible solution would have been to introduce
environment variables and to en/disable the test conditionally.

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

7 years ago[SLP] Fixed non-deterministic behavior in Loop Vectorizer.
Amjad Aboud [Wed, 8 Mar 2017 05:09:10 +0000 (05:09 +0000)]
[SLP] Fixed non-deterministic behavior in Loop Vectorizer.

Differential Revision: https://reviews.llvm.org/D30638

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

7 years agoRevert "Revert "[PowerPC][ELFv2ABI] Allocate parameter area on-demand to reduce stack...
Tim Shen [Wed, 8 Mar 2017 02:41:35 +0000 (02:41 +0000)]
Revert "Revert "[PowerPC][ELFv2ABI] Allocate parameter area on-demand to reduce stack frame size""

After inspection, it's an UB in our code base. Someone cast a var-arg
function pointer to a non-var-arg one. :/

Re-commit r296771 to continue testing on the patch.

Sorry for the trouble!

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

7 years agoWork around an ICE on MSVC 2017.
Zachary Turner [Wed, 8 Mar 2017 01:57:40 +0000 (01:57 +0000)]
Work around an ICE on MSVC 2017.

MSVC 2017 was released today, and I found one bug in the
compiler which prevents a successful build of LLVM.  This
patch works around the bug in a fairly benign way.

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

7 years agoHandle UnreachableInst in isGuaranteedToTransferExecutionToSuccessor
Sebastian Pop [Wed, 8 Mar 2017 01:54:50 +0000 (01:54 +0000)]
Handle UnreachableInst in isGuaranteedToTransferExecutionToSuccessor

A block with an UnreachableInst does not transfer execution to a successor.
The problem was exposed by GVN-hoist. This patch fixes bug 32153.

Patch by Aditya Kumar.

Differential Revision: https://reviews.llvm.org/D30667

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

7 years ago[SCCP] Merge markOverdefined and markAnythingOverdefined.
Davide Italiano [Wed, 8 Mar 2017 01:26:37 +0000 (01:26 +0000)]
[SCCP] Merge markOverdefined and markAnythingOverdefined.

There's no need to have two separate APIs.

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

7 years ago[NVPTX] Remove unnecessary isImageReadoOnly(), isImageWriteOnly(), & isImageReadWrite...
Justin Lebar [Wed, 8 Mar 2017 01:14:15 +0000 (01:14 +0000)]
[NVPTX] Remove unnecessary isImageReadoOnly(), isImageWriteOnly(), & isImageReadWrite calls

This is repetition of isImage() function in NVPTXUtilities.cpp.

Patch by Briana Grace!

Differential Revision: https://reviews.llvm.org/D30706

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

7 years agoAMDGPU: Don't wait at end of block with a trivial successor
Matt Arsenault [Wed, 8 Mar 2017 01:06:58 +0000 (01:06 +0000)]
AMDGPU: Don't wait at end of block with a trivial successor

If there is only one successor, and that successor only
has one predecessor the wait can obviously be delayed until
uses or the end of the next block. This avoids code quality
regressions when there are trivial fallthrough blocks inserted
for structurization.

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

7 years ago[DAGCombine] Simplify ISD::AND in GetDemandedBits.
Eli Friedman [Wed, 8 Mar 2017 00:56:35 +0000 (00:56 +0000)]
[DAGCombine] Simplify ISD::AND in GetDemandedBits.

This helps in cases involving bitfields where an AND is exposed by
legalization.

Differential Revision: https://reviews.llvm.org/D30472

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

7 years agoAMDGPU: Constant fold rcp node
Matt Arsenault [Wed, 8 Mar 2017 00:48:46 +0000 (00:48 +0000)]
AMDGPU: Constant fold rcp node

When doing arcp optimization with a constant denominator,
this was leaving behind rcps with constant inputs.

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

7 years ago[DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderef
Konstantin Zhuravlyov [Wed, 8 Mar 2017 00:28:57 +0000 (00:28 +0000)]
[DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderef

Differential Revision: https://reviews.llvm.org/D29672

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

7 years agoFix additional constructor call missed by r297241.
Daniel Sanders [Tue, 7 Mar 2017 23:32:10 +0000 (23:32 +0000)]
Fix additional constructor call missed by r297241.

It was added between my build+test and my commit.

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

7 years agoAMDGPU/SI: Do not insert EndCf in an unreachable block
Changpeng Fang [Tue, 7 Mar 2017 23:29:36 +0000 (23:29 +0000)]
AMDGPU/SI: Do not insert EndCf in an unreachable block

Reviewers:
  arsenm

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

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

7 years ago[InstCombine] shrink truncated insertelement into undef vector
Sanjay Patel [Tue, 7 Mar 2017 23:27:14 +0000 (23:27 +0000)]
[InstCombine] shrink truncated insertelement into undef vector

This is the 2nd part of solving:
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110293.html

D30123 moves the trunc ahead of the shuffle, and this moves the trunc ahead of the insertelement.
We're limiting this transform to undef rather than any constant to avoid backend problems.

Differential Revision: https://reviews.llvm.org/D30137

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

7 years agoRecommit: [globalisel] Change LLT constructor string into an LLT-based object that...
Daniel Sanders [Tue, 7 Mar 2017 23:20:35 +0000 (23:20 +0000)]
Recommit: [globalisel] Change LLT constructor string into an LLT-based object that knows how to generate it.

Summary:
This will allow future patches to inspect the details of the LLT. The implementation is now split between
the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.

Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.

The problem with the previous commit appears to have been that TableGen was including CodeGen/LowLevelType.h instead of Support/LowLevelTypeImpl.h.

Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar

Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D30046

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

7 years ago[Hexagon] Check for presence before looking registers up in bit tracker
Krzysztof Parzyszek [Tue, 7 Mar 2017 23:12:04 +0000 (23:12 +0000)]
[Hexagon] Check for presence before looking registers up in bit tracker

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

7 years ago[Hexagon] Generate bitsplit instruction
Krzysztof Parzyszek [Tue, 7 Mar 2017 23:08:35 +0000 (23:08 +0000)]
[Hexagon] Generate bitsplit instruction

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

7 years agoGlobalISel: use inserts for landingpad instead of sequences.
Tim Northover [Tue, 7 Mar 2017 23:04:06 +0000 (23:04 +0000)]
GlobalISel: use inserts for landingpad instead of sequences.

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

7 years agoFix one-after-the-end type metadata handling in globalsplit.
Evgeniy Stepanov [Tue, 7 Mar 2017 22:18:48 +0000 (22:18 +0000)]
Fix one-after-the-end type metadata handling in globalsplit.

Itanium ABI may have an address point one byte after the end of a
vtable. When such vtable global is split, the !type metadata needs to
follow the right vtable.

Differential Revision: https://reviews.llvm.org/D30716

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

7 years agoADT: Fix SmallPtrSet iterators in reverse mode
Duncan P. N. Exon Smith [Tue, 7 Mar 2017 21:56:32 +0000 (21:56 +0000)]
ADT: Fix SmallPtrSet iterators in reverse mode

Fix SmallPtrSet::iterator behaviour and creation ReverseIterate is true.

  - Any function that creates an iterator now uses
    SmallPtrSet::makeIterator, which creates an iterator that
    dereferences to the given pointer.

  - In reverse-iterate mode, initialze iterator::End with "CurArray"
    instead of EndPointer.

  - In reverse-iterate mode, the current node is iterator::Buffer[-1].
    iterator::operator* and SmallPtrSet::makeIterator are the only ones
    that need to know.

  - Fix the assertions for reverse-iterate mode.

This fixes the tests Danny B added in r297182, and adds a couple of
others to confirm that dereferencing does the right thing, regardless of
how the iterator was found, and that iteration works correctly from each
return from find.

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

7 years agoFix source-lines test on Windows.
Zachary Turner [Tue, 7 Mar 2017 21:53:21 +0000 (21:53 +0000)]
Fix source-lines test on Windows.

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

7 years ago[InstCombine] shrink truncated splat shuffle (2nd try)
Sanjay Patel [Tue, 7 Mar 2017 21:45:16 +0000 (21:45 +0000)]
[InstCombine] shrink truncated splat shuffle (2nd try)

This was committed at r297155 and reverted at r297166 because of an
over-reaching clang test. That should be fixed with r297189.

This is one part of solving a recent bug report:
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110293.html

This keeps with our general approach: changing arbitrary shuffles is off-limts,
but changing splat is ok. The transform is very similar to the existing
shrinkBitwiseLogic() canonicalization.

Differential Revision: https://reviews.llvm.org/D30123

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

7 years ago[ObjectYAML] Fix issue with DWARF2 AddrSize 8
Chris Bieneman [Tue, 7 Mar 2017 21:34:35 +0000 (21:34 +0000)]
[ObjectYAML] Fix issue with DWARF2 AddrSize 8

In my refactoring I introduced a bug where we were using the reference size instead of the offset size for DW_FORM_strp and similar forms.

This patch resolves the error and adds a test case testing all the DWARF forms for DWARF2 AddrSize 8. There is similar coverage already in the DWARFDebugInfoTest sources that covers the parser. Once I migrate the DWARFGenerator APIs to be built on the YAML tools they will be fully covered under the same tests.

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

7 years agoGlobalISel: fix legalization of G_INSERT
Tim Northover [Tue, 7 Mar 2017 21:24:33 +0000 (21:24 +0000)]
GlobalISel: fix legalization of G_INSERT

We were calculating incorrect extract/insert offsets by trying to be too
tricksy with min/max. It's clearer to just split the logic up into "register
starts before this segment" vs "after".

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

7 years agoStrip trailing whitespace.
Simon Pilgrim [Tue, 7 Mar 2017 21:16:38 +0000 (21:16 +0000)]
Strip trailing whitespace.

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

7 years ago[coroutines] Add handling for unwind coro.ends
Gor Nishanov [Tue, 7 Mar 2017 21:00:54 +0000 (21:00 +0000)]
[coroutines] Add handling for unwind coro.ends

Summary:
The purpose of coro.end intrinsic is to allow frontends to mark the cleanup and
other code that is only relevant during the initial invocation of the coroutine
and should not be present in resume and destroy parts.

In landing pads coro.end is replaced with an appropriate instruction to unwind to
caller. The handling of coro.end differs depending on whether the target is
using landingpad or WinEH exception model.

For landingpad based exception model, it is expected that frontend uses the
`coro.end`_ intrinsic as follows:

```
    ehcleanup:
      %InResumePart = call i1 @llvm.coro.end(i8* null, i1 true)
      br i1 %InResumePart, label %eh.resume, label %cleanup.cont

    cleanup.cont:
      ; rest of the cleanup

    eh.resume:
      %exn = load i8*, i8** %exn.slot, align 8
      %sel = load i32, i32* %ehselector.slot, align 4
      %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0
      %lpad.val29 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1
      resume { i8*, i32 } %lpad.val29

```
The `CoroSpit` pass replaces `coro.end` with ``True`` in the resume functions,
thus leading to immediate unwind to the caller, whereas in start function it
is replaced with ``False``, thus allowing to proceed to the rest of the cleanup
code that is only needed during initial invocation of the coroutine.

For Windows Exception handling model, a frontend should attach a funclet bundle
referring to an enclosing cleanuppad as follows:

```
    ehcleanup:
      %tok = cleanuppad within none []
      %unused = call i1 @llvm.coro.end(i8* null, i1 true) [ "funclet"(token %tok) ]
      cleanupret from %tok unwind label %RestOfTheCleanup
```

The `CoroSplit` pass, if the funclet bundle is present, will insert
``cleanupret from %tok unwind to caller`` before
the `coro.end`_ intrinsic and will remove the rest of the block.

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25543

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

7 years agoImplement FreeMachineFunction::getPassName().
Yaron Keren [Tue, 7 Mar 2017 20:59:08 +0000 (20:59 +0000)]
Implement FreeMachineFunction::getPassName().

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

7 years ago[GlobalISel] Don't translate intrinsics with metadata parameters.
Ahmed Bougacha [Tue, 7 Mar 2017 20:53:09 +0000 (20:53 +0000)]
[GlobalISel] Don't translate intrinsics with metadata parameters.

Some intrinsics take metadata parameters.  These all need custom
handling of some form, and cannot possibly be lowered generically to
G_INTRINSIC calls with vreg operands.
Reject them, instead of hitting an assert later in getOrCreateVReg.

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

7 years ago[GlobalISel] Avoid invalidating ValToVReg when translating no-op bitcast.
Ahmed Bougacha [Tue, 7 Mar 2017 20:53:06 +0000 (20:53 +0000)]
[GlobalISel] Avoid invalidating ValToVReg when translating no-op bitcast.

When we translate a no-op (same type) bitcast, we try to be clever and
only emit a COPY if we already assigned a vreg to the defined value.
However, when we didn't, we tried to assign to a reference into the
ValToVReg DenseMap, even though the RHS of the assignment
(getOrCreateVReg) could potentially grow that DenseMap, invalidating the
reference.

Avoid that by getting the source vreg first.
I audited the rest of the translator; this is the only tricky case.

The test is quite unwieldy, as the problem is caused by the DenseMap
growing, which happens after the 47th mapped value.

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

7 years ago[GlobalISel] Relax vector G_SELECT assertion.
Ahmed Bougacha [Tue, 7 Mar 2017 20:53:03 +0000 (20:53 +0000)]
[GlobalISel] Relax vector G_SELECT assertion.

For vector operands, the `select` instruction supports both vector and
non-vector conditions.  The MIR builder had an overly restrictive
assertion, that only accepted vector conditions for vector selects
(in effect implementing ISD::VSELECT).

Make it possible to express the full range of G_SELECTs.

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

7 years ago[GlobalISel] Add vector select translation test. NFC.
Ahmed Bougacha [Tue, 7 Mar 2017 20:53:00 +0000 (20:53 +0000)]
[GlobalISel] Add vector select translation test. NFC.

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

7 years ago[GlobalISel] Slightly clean up DBG_VALUE FP build code.
Ahmed Bougacha [Tue, 7 Mar 2017 20:52:57 +0000 (20:52 +0000)]
[GlobalISel] Slightly clean up DBG_VALUE FP build code.

I messed up my rebases leading to r297200, and ended up with stale (but
working) code.  Fix it.

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

7 years ago[fuzzer] Don't crash if LLVMFuzzerMutate was called by CustomCrossOver
Vitaly Buka [Tue, 7 Mar 2017 20:37:38 +0000 (20:37 +0000)]
[fuzzer] Don't crash if LLVMFuzzerMutate was called by CustomCrossOver

Reviewers: kcc

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D30682

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

7 years ago[GlobalISel] Ignore %noreg when applying default regbank mapping.
Ahmed Bougacha [Tue, 7 Mar 2017 20:34:23 +0000 (20:34 +0000)]
[GlobalISel] Ignore %noreg when applying default regbank mapping.

When computing the mapping for non-generic instructions, we skipped
%noreg operands, because we can't always reason about their banks.

Also skip them when applying the mapping.  Otherwise, we could end
up with mappings that we can't apply.

While there, duplicate an assert to distinguish between the two
error conditions.

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

7 years ago[GlobalISel] Emit DBG_VALUE %noreg for non-int/fp constant values.
Ahmed Bougacha [Tue, 7 Mar 2017 20:34:20 +0000 (20:34 +0000)]
[GlobalISel] Emit DBG_VALUE %noreg for non-int/fp constant values.

When a dbg_value has a constant operand that isn't representable in MI,
there isn't much we can do.  Use %noreg (0) for those situations.
This matches the SelectionDAG behavior.

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

7 years ago[GlobalISel] Add constant dbg.value translation tests. NFC.
Ahmed Bougacha [Tue, 7 Mar 2017 20:34:13 +0000 (20:34 +0000)]
[GlobalISel] Add constant dbg.value translation tests. NFC.

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

7 years ago[NVPTX] Fixed lowering of unaligned loads/stores of f16 scalars and vectors.
Artem Belevich [Tue, 7 Mar 2017 20:33:38 +0000 (20:33 +0000)]
[NVPTX] Fixed lowering of unaligned loads/stores of f16 scalars and vectors.

Differential Revision: https://reviews.llvm.org/D30672

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

7 years agoSjLjEHPrepare: Fix the pass for swifterror arguments
Arnold Schwaighofer [Tue, 7 Mar 2017 20:29:02 +0000 (20:29 +0000)]
SjLjEHPrepare: Fix the pass for swifterror arguments

We cannot leave the identity copies 'select true, arg, undef' that this pass
inserts for arguments to simplify handling of values on swifterror arguments.

swifterror arguments have restrictions on their uses.

rdar://30839288

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

7 years agoFix bugpoint to work with swifterror values
Arnold Schwaighofer [Tue, 7 Mar 2017 20:28:59 +0000 (20:28 +0000)]
Fix bugpoint to work with swifterror values

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

7 years agollvm-objdump: handle line numbers and source options for amdgpu objects
Konstantin Zhuravlyov [Tue, 7 Mar 2017 20:17:11 +0000 (20:17 +0000)]
llvm-objdump: handle line numbers and source options for amdgpu objects

Differential Revision: https://reviews.llvm.org/D30679

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

7 years agoFix C2712 build error on Windows
Konstantin Zhuravlyov [Tue, 7 Mar 2017 20:09:46 +0000 (20:09 +0000)]
Fix C2712 build error on Windows

Move the __try/__except block outside of the set_thread_name function to avoid a conflict with object unwinding due to the use of the llvm::Storage.

Differential Revision: https://reviews.llvm.org/D30707

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

7 years ago[AArch64] Vulcan is now ThunderXT99
Joel Jones [Tue, 7 Mar 2017 19:42:40 +0000 (19:42 +0000)]
[AArch64] Vulcan is now ThunderXT99

Broadcom Vulcan is now Cavium ThunderX2T99.

LLVM Bugzilla: http://bugs.llvm.org/show_bug.cgi?id=32113

Minor fixes for the alignments of loops and functions for
ThunderX T81/T83/T88 (better performance).

Patch was tested with SpecCPU2006.

Patch by Stefan Teleman

Differential Revision: https://reviews.llvm.org/D30510

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

7 years agoRevert r297177: Change LLT constructor string into an LLT-based object ...
Daniel Sanders [Tue, 7 Mar 2017 19:21:23 +0000 (19:21 +0000)]
Revert r297177: Change LLT constructor string into an LLT-based object ...

More module problems. This time it only showed up in the stage 2 compile of
clang-x86_64-linux-selfhost-modules-2 but not the stage 1 compile.

Somehow, this change causes the build to need Attributes.gen before it's been
generated.

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

7 years ago[JumpThread] Simplify CmpInst-as-Condition branch-folding a bit.
Xin Tong [Tue, 7 Mar 2017 18:59:09 +0000 (18:59 +0000)]
[JumpThread] Simplify CmpInst-as-Condition branch-folding a bit.

Summary: Simplify CmpInst-as-Condition branch-folding a bit.

Reviewers: sanjoy, efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D30429

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

7 years ago[cmake] Include openmp with add_llvm_external_project
Pirama Arumuga Nainar [Tue, 7 Mar 2017 18:54:17 +0000 (18:54 +0000)]
[cmake] Include openmp with add_llvm_external_project

Summary:
Include projects/openmp into the build using add_llvm_external_project
instead of add_subdirectory.  This creates an option
LLVM_TOOL_OPENMP_BUILD that selects whether this project gets included
in an in-tree build.

Reviewers: beanz, AndreyChurbanov, jlpeyton

Subscribers: srhines, openmp-commits, llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D30470

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

7 years ago[ObjectYAML] Add support for DWARF5 Unit header
Chris Bieneman [Tue, 7 Mar 2017 18:50:58 +0000 (18:50 +0000)]
[ObjectYAML] Add support for DWARF5 Unit header

In DWARF5 the Unit header added a new field, UnitType, and swapped the order of the address size and abbreviation offset fields.

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

7 years agoAdd unit tests for changes to SmallPtrSet and PointerLikeTypeTraits
Daniel Berlin [Tue, 7 Mar 2017 18:47:52 +0000 (18:47 +0000)]
Add unit tests for changes to SmallPtrSet and PointerLikeTypeTraits

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

7 years agoAdd PointerLikeTypeTraits for const things, as long as there is one for the non-const...
Daniel Berlin [Tue, 7 Mar 2017 18:47:50 +0000 (18:47 +0000)]
Add PointerLikeTypeTraits for const things, as long as there is one for the non-const version. Clang and other users have a number of types they use as pointers, and this avoids having to define both const and non-const versions of PointerLikeTraits.

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

7 years agoMake SmallPtrSet count and find able to take const PtrType's
Daniel Berlin [Tue, 7 Mar 2017 18:47:48 +0000 (18:47 +0000)]
Make SmallPtrSet count and find able to take const PtrType's

Summary:
For our set/map types, count/find normally take const references.
This works well for non-pointer types, but can suck for pointer
types.

DenseSet<int *> foo;
const int *b = nullptr;
foo.count(b) does not work

but the equivalent reference version does work
(patch to fix DenseSet/DenseMap coming up)
For SmallPtrSet, you have no such option.

The following will not work right now:
SmallPtrSet<int *> foo;
const int *b = nullptr;
foo.count(b);

This makes const correctness hard in some cases.
Example:
SmallPtrSet<Instruction *> InstructionsToErase;

You can't make this SmallPtrSet<const Instruction *> because then you
can't erase the instruction.  If I want to see if something is in the
set, I may only have a const Instruction *.  Given that count and find
are non-mutating, this should just work.

The places in our code base that do this resort to const_cast :(.

This patch makes count and find able to be used with const Instruction
* in the above SmallPtrSet examples.

This is a bit annoying because of where C++ applies the const, so we
have to remove the pointer type from the passed-in-type and rebuild it
with const.

Reviewers: dblaikie

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D30608

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

7 years ago[LV] Consider users that are memory accesses in uniforms expansion step
Matthew Simpson [Tue, 7 Mar 2017 18:47:30 +0000 (18:47 +0000)]
[LV] Consider users that are memory accesses in uniforms expansion step

When expanding the set of uniform instructions beyond the seed instructions
(e.g., consecutive pointers), we mark a new instruction uniform if all its
loop-varying users are uniform. We should also allow users that are consecutive
or interleaved memory accesses. This fixes cases where we have an instruction
that is used as the pointer operand of a consecutive access but also used by a
non-memory instruction that later becomes uniform as part of the expansion.

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

7 years ago[X86] Add option to specify preferable loop alignment
Sanjoy Das [Tue, 7 Mar 2017 18:47:22 +0000 (18:47 +0000)]
[X86] Add option to specify preferable loop alignment

Summary:
Loop alignment can cause a significant change of
the perfromance for short loops.
To be able to evaluate the impact of loop alignment this change
introduces the new option x86-experimental-pref-loop-alignment.
The alignment will be 2^Value bytes, the default value is 4.

Patch by Serguei Katkov!

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: sanjoy, llvm-commits

Differential Revision: https://reviews.llvm.org/D30391

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

7 years ago[globalisel] Change LLT constructor string into an LLT-based object that knows how...
Daniel Sanders [Tue, 7 Mar 2017 18:32:25 +0000 (18:32 +0000)]
[globalisel] Change LLT constructor string into an LLT-based object that knows how to generate it.

Summary:
This will allow future patches to inspect the details of the LLT. The implementation is now split between
the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.

Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.

Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar

Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D30046

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

7 years agoFurther reduce testcase
Adrian Prantl [Tue, 7 Mar 2017 18:26:36 +0000 (18:26 +0000)]
Further reduce testcase

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

7 years agoFix test and add missing return for llvm-lto2 error case
Teresa Johnson [Tue, 7 Mar 2017 18:15:13 +0000 (18:15 +0000)]
Fix test and add missing return for llvm-lto2 error case

Summary:
This test was missing the target triple.
Once I fixed that, the case with the invalid character error stopped
returning 1 from llvm-lto2 and the test reported a failure. Fixed by
adding the missing return from llvm-lto2. Apparently we were failing
when we eventually tried to get the target.

Reviewers: pcc

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D30585

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

7 years ago[GlobalISel] Translate floating-point negation
Volkan Keles [Tue, 7 Mar 2017 18:03:28 +0000 (18:03 +0000)]
[GlobalISel] Translate floating-point negation

Reviewers: qcolombet, javed.absar, aditya_nandakumar, dsanders, t.p.northover, ab

Reviewed By: qcolombet

Subscribers: dberris, rovka, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D30671

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

7 years agoUpdate comment in testcase
Adrian Prantl [Tue, 7 Mar 2017 17:55:36 +0000 (17:55 +0000)]
Update comment in testcase

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