OSDN Git Service

android-x86/external-llvm.git
8 years agoBitcodeReader: Fix some holes in upgrade from r267296
Duncan P. N. Exon Smith [Sun, 24 Apr 2016 06:52:01 +0000 (06:52 +0000)]
BitcodeReader: Fix some holes in upgrade from r267296

Add tests for some missing cases to bitcode upgrade in r267296.

  - DICompositeType with an 'elements:' field, which will cause it to be
    involved in a cycle after the upgrade.

  - A DIDerivedType that references a class in 'extraData:'.

I updated test/Bitcode/dityperefs-3.8.ll with the missing cases and
regenerated test/Bitcode/dityperefs-3.8.ll.bc.

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

8 years ago[X86] Merge LowerCTLZ and LowerCTLZ_ZERO_UNDEF into a single function that branches...
Craig Topper [Sun, 24 Apr 2016 06:27:39 +0000 (06:27 +0000)]
[X86] Merge LowerCTLZ and LowerCTLZ_ZERO_UNDEF into a single function that branches internally for the one difference, allowing the rest of the code to be common. NFC

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

8 years ago[X86] Node need to check if AVX512 is supported when lowering vector CTLZ. The CTLZ...
Craig Topper [Sun, 24 Apr 2016 06:27:35 +0000 (06:27 +0000)]
[X86] Node need to check if AVX512 is supported when lowering vector CTLZ. The CTLZ operation is only Custom for vectors if AVX512 is enabled so if a vector gets here AVX512 is implied. NFC

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

8 years agoAdd "hasSection" flag in the Summary
Mehdi Amini [Sun, 24 Apr 2016 05:31:43 +0000 (05:31 +0000)]
Add "hasSection" flag in the Summary

Reviewers: tejohnson

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years ago[MachineCombiner] Support for floating-point FMA on ARM64 (re-commit r267098)
Gerolf Hoflehner [Sun, 24 Apr 2016 05:14:01 +0000 (05:14 +0000)]
[MachineCombiner] Support for floating-point FMA on ARM64 (re-commit r267098)

The original patch caused crashes because it could derefence a null pointer
for SelectionDAGTargetInfo for targets that do not define it.

Evaluates fmul+fadd -> fmadd combines and similar code sequences in the
machine combiner. It adds support for float and double similar to the existing
integer implementation. The key features are:

- DAGCombiner checks whether it should combine greedily or let the machine
combiner do the evaluation. This is only supported on ARM64.
- It gives preference to throughput over latency: the heuristic used is
to combine always in loops. The targets decides whether the machine
combiner should optimize for throughput or latency.
- Supports for fmadd, f(n)msub, fmla, fmls patterns
- On by default at O3 ffast-math

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

8 years ago[X86] Remove isel patterns for selecting tzcnt/lzcnt from cmove/ne+cttz/ctlz. These...
Craig Topper [Sun, 24 Apr 2016 04:38:34 +0000 (04:38 +0000)]
[X86] Remove isel patterns for selecting tzcnt/lzcnt from cmove/ne+cttz/ctlz. These are folded by DAG combine now.

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

8 years ago[CodeGen] Teach DAG combine to fold select_cc seteq X, 0, sizeof(X), ctlz_zero_undef...
Craig Topper [Sun, 24 Apr 2016 04:38:32 +0000 (04:38 +0000)]
[CodeGen] Teach DAG combine to fold select_cc seteq X, 0, sizeof(X), ctlz_zero_undef(X) -> ctlz(X). InstCombine already does this for IR and X86 pattern matches this during isel.

A follow up commit will remove the X86 patterns to allow this to be tested.

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

8 years agoFix an assertion that can never fire because the condition ANDed with the string...
Craig Topper [Sun, 24 Apr 2016 04:38:29 +0000 (04:38 +0000)]
Fix an assertion that can never fire because the condition ANDed with the string is just true or 1.

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

8 years agoRevert "Verifier: Verify that each inlinable callsite of a debug-info-bearing function"
Adrian Prantl [Sun, 24 Apr 2016 03:47:37 +0000 (03:47 +0000)]
Revert "Verifier: Verify that each inlinable callsite of a debug-info-bearing function"

This reverts commit r267320 while investigating an OpenMP buildbot failure.

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

8 years agoVerifier: Verify that each inlinable callsite of a debug-info-bearing function
Adrian Prantl [Sun, 24 Apr 2016 03:23:02 +0000 (03:23 +0000)]
Verifier: Verify that each inlinable callsite of a debug-info-bearing function
in a debug-info-bearing function has a debug location attached to it. Failure to
do so causes an "!dbg attachment points at wrong subprogram for function"
assertion failure when the inliner sets up inline scope info.

rdar://problem/25878916

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

8 years agoReorganize GlobalValueSummary with a "Flags" bitfield.
Mehdi Amini [Sun, 24 Apr 2016 03:18:18 +0000 (03:18 +0000)]
Reorganize GlobalValueSummary with a "Flags" bitfield.

Right now it only contains the LinkageType, but will be extended
with "hasSection", "isOptSize", "hasInlineAssembly", etc.

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoAdd a version field in the bitcode for the summary
Mehdi Amini [Sun, 24 Apr 2016 03:18:11 +0000 (03:18 +0000)]
Add a version field in the bitcode for the summary

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoAdd an internalization step to the ThinLTOCodeGenerator
Mehdi Amini [Sun, 24 Apr 2016 03:18:01 +0000 (03:18 +0000)]
Add an internalization step to the ThinLTOCodeGenerator

Keeping as much as possible internal/private is
known to help the optimizer. Let's try to benefit from
this in ThinLTO.
Note: this is early work, but is enough to build clang (and
all the LLVM tools). I still need to write some lit-tests...

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoFix a couple assertions that can never fire because they just contained the text...
Craig Topper [Sun, 24 Apr 2016 02:01:25 +0000 (02:01 +0000)]
Fix a couple assertions that can never fire because they just contained the text string which always evaluates to true. Add a ! so they'll evaluate to false.

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

8 years ago[X86] Fix patterns that turn cmove/cmovne+ctlz/cttz into lzcnt/tzcnt instructions...
Craig Topper [Sun, 24 Apr 2016 02:01:22 +0000 (02:01 +0000)]
[X86] Fix patterns that turn cmove/cmovne+ctlz/cttz into lzcnt/tzcnt instructions. Only one of the conditions should be valid for each pattern, not both. Update tests accordingly.

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

8 years ago[RuntimeDyldELF] Handle GOTPCRELX/REX_GOTPCRELX.
Davide Italiano [Sun, 24 Apr 2016 01:36:37 +0000 (01:36 +0000)]
[RuntimeDyldELF] Handle GOTPCRELX/REX_GOTPCRELX.

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

8 years ago[MC/ELF] Make the relaxation test more interesting.
Davide Italiano [Sun, 24 Apr 2016 01:08:35 +0000 (01:08 +0000)]
[MC/ELF] Make the relaxation test more interesting.

Add a case where we can't relax.

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

8 years ago[MC/ELF] Implement support for GOTPCRELX/REX_GOTPCRELX.
Davide Italiano [Sun, 24 Apr 2016 01:03:57 +0000 (01:03 +0000)]
[MC/ELF] Implement support for GOTPCRELX/REX_GOTPCRELX.

The option to control the emission of the new relocations
is -relax-relocations (blatantly copied from GNU as).
It can't be enabled by default because it breaks relatively
recent versions of ld.bfd/ld.gold (late 2015).

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

8 years agoRelax test using CHECK-DAG instead of CHECK-NEXT
Mehdi Amini [Sun, 24 Apr 2016 00:25:15 +0000 (00:25 +0000)]
Relax test using CHECK-DAG instead of CHECK-NEXT

It seems we still have some ordering issue in the combined index
emission, but I can't figure out why right now.

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoFix test stability (was sensitive to the path)
Mehdi Amini [Sun, 24 Apr 2016 00:03:57 +0000 (00:03 +0000)]
Fix test stability (was sensitive to the path)

This is a fixup for r267304.
The test was sensitive to the path in a subtle way:
the index in memory is sorted by GUID, which are hashes
that include the source filename for local globals.
Teresa recently added a directive at the IR level, so
we can specify it here to make the test independent of
the path.

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoStore and emit original name in combined index
Mehdi Amini [Sat, 23 Apr 2016 23:38:17 +0000 (23:38 +0000)]
Store and emit original name in combined index

Summary:
As discussed in D18298, some local globals can't
be renamed/promoted (because they have a section, or because
they are referenced from inline assembly).
To be able to detect naming collision, we need to keep around
the "GUID" using their original name without taking the linkage
into account.

Reviewers: tejohnson

Subscribers: joker.eph, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoAlways traverse GlobalVariable initializer when computing the export list
Mehdi Amini [Sat, 23 Apr 2016 23:29:24 +0000 (23:29 +0000)]
Always traverse GlobalVariable initializer when computing the export list

Summary:
We are always importing the initializer for a GlobalVariable.
So if a GlobalVariable is in the export-list, we pull in any
refs as well.

Reviewers: tejohnson

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoDebugInfo: Change DIBuilder to make distinct DIGlobalVariables
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 22:29:09 +0000 (22:29 +0000)]
DebugInfo: Change DIBuilder to make distinct DIGlobalVariables

A long overdue change to make DIGlobalVariable distinct.  Much like
DISubprogram definitions (changed in r246098), it isn't logical to
unique DIGlobalVariable definitions from two different compile units.

(Longer-term, we should also find a way to reverse the link between
GlobalVariable and DIGlobalVariable, and between DIGlobalVariable and
DICompileUnit, so that debug info to do with optimized-out globals
disappears.  Admittedly it's harder than with Function/DISubprogram,
since global variables may be constant-folded and the debug info should
still describe that somehow.)

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

8 years ago[MC/ELF] Pass Fixup to getRelocType64.
Davide Italiano [Sat, 23 Apr 2016 22:26:31 +0000 (22:26 +0000)]
[MC/ELF] Pass Fixup to getRelocType64.

In preparation for other changes.

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

8 years agoBitcodeReader: Avoid std::vector with non-movable types from r267296
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 21:36:59 +0000 (21:36 +0000)]
BitcodeReader: Avoid std::vector with non-movable types from r267296

r267298 didn't quite fix the build errors.  Use SmallVector instead of
std::vector, the latter of which I think is trying to maintain a strong
exception safety guarantee.

http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/6228

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

8 years agoBitcodeReader: Avoid non-moving std::piecewise_construct from r267296
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 21:23:41 +0000 (21:23 +0000)]
BitcodeReader: Avoid non-moving std::piecewise_construct from r267296

Not exactly sure why the host tries to use a copy constructor here, but
it's easy enough to work around it.

http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/6227

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

8 years agoDebugInfo: Remove MDString-based type references
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 21:08:00 +0000 (21:08 +0000)]
DebugInfo: Remove MDString-based type references

Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around
DIType*.  It is no longer legal to refer to a DICompositeType by its
'identifier:', and DIBuilder no longer retains all types with an
'identifier:' automatically.

Aside from the bitcode upgrade, this is mainly removing logic to resolve
an MDString-based reference to an actualy DIType.  The commits leading
up to this have made the implicit type map in DICompileUnit's
'retainedTypes:' field superfluous.

This does not remove DITypeRef, DIScopeRef, DINodeRef, and
DITypeRefArray, or stop using them in DI-related metadata.  Although as
of this commit they aren't serving a useful purpose, there are patchces
under review to reuse them for CodeView support.

The tests in LLVM were updated with deref-typerefs.sh, which is attached
to the thread "[RFC] Lazy-loading of debug info metadata":

  http://lists.llvm.org/pipermail/llvm-dev/2016-April/098318.html

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

8 years agoreplace duplicated static functions for profile metadata access with BranchInst membe...
Sanjay Patel [Sat, 23 Apr 2016 20:01:22 +0000 (20:01 +0000)]
replace duplicated static functions for profile metadata access with BranchInst member function; NFCI

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

8 years agoRevert "[AArch64] Fix optimizeCondBranch logic."
Renato Golin [Sat, 23 Apr 2016 19:30:52 +0000 (19:30 +0000)]
Revert "[AArch64] Fix optimizeCondBranch logic."

This reverts commit r267206, as it broke self-hosting on AArch64.

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

8 years agoimprove documentation comments; NFC
Sanjay Patel [Sat, 23 Apr 2016 16:31:48 +0000 (16:31 +0000)]
improve documentation comments; NFC

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

8 years ago[X86][XOP] Added VPPERM -> BLEND-WITH-ZERO Test
Simon Pilgrim [Sat, 23 Apr 2016 11:14:18 +0000 (11:14 +0000)]
[X86][XOP] Added VPPERM -> BLEND-WITH-ZERO Test

Currently failing due to poor blend matching, found whilst investigating PR27472

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

8 years agoUse %T instead of cd'ing to Output directly.
Benjamin Kramer [Sat, 23 Apr 2016 11:01:36 +0000 (11:01 +0000)]
Use %T instead of cd'ing to Output directly.

%T expands to Output if not configured differently.

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

8 years ago[CodeGen] When promoting CTTZ operations to larger type, don't insert a select to...
Craig Topper [Sat, 23 Apr 2016 05:20:47 +0000 (05:20 +0000)]
[CodeGen] When promoting CTTZ operations to larger type, don't insert a select to detect if the input is zero to return the original size instead of the extended size. Instead just set the first bit in the zero extended part.

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

8 years ago[gold] Gate value name discarding under save-temps
Teresa Johnson [Sat, 23 Apr 2016 05:15:59 +0000 (05:15 +0000)]
[gold] Gate value name discarding under save-temps

Summary:
This removes a couple of flags added to control this behavior, and
simply keeps all value names when save-temps is specified.

Reviewers: rafael

Subscribers: llvm-commits, pcc, davide

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

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

8 years agoBitcodeWriter: Emit uniqued subgraphs after all distinct nodes
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:59:22 +0000 (04:59 +0000)]
BitcodeWriter: Emit uniqued subgraphs after all distinct nodes

Since forward references for uniqued node operands are expensive (and
those for distinct node operands are cheap due to
DistinctMDOperandPlaceholder), minimize forward references in uniqued
node operands.

Moreover, guarantee that when a cycle is broken by a distinct node, none
of the uniqued nodes have any forward references.  In
ValueEnumerator::EnumerateMetadata, enumerate uniqued node subgraphs
first, delaying distinct nodes until all uniqued nodes have been
handled.  This guarantees that uniqued nodes only have forward
references when there is a uniquing cycle (since r267276 changed
ValueEnumerator::organizeMetadata to partition distinct nodes in front
of uniqued nodes as a post-pass).

Note that a single uniqued subgraph can hit multiple distinct nodes at
its leaves.  Ideally these would themselves be emitted in post-order,
but this commit doesn't attempt that; I think it requires an extra pass
through the edges, which I'm not convinced is worth it (since
DistinctMDOperandPlaceholder makes forward references quite cheap
between distinct nodes).

I've added two testcases:

  - test/Bitcode/mdnodes-distinct-in-post-order.ll is just like
    test/Bitcode/mdnodes-in-post-order.ll, except with distinct nodes
    instead of uniqued ones.  This confirms that, in the absence of
    uniqued nodes, distinct nodes are still emitted in post-order.

  - test/Bitcode/mdnodes-distinct-nodes-break-cycles.ll is the minimal
    example where a naive post-order traversal would cause one uniqued
    node to forward-reference another.  IOW, it's the motivating test.

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

8 years agoAvoid MSVC failure with default arguments in lambdas from r267270
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:52:47 +0000 (04:52 +0000)]
Avoid MSVC failure with default arguments in lambdas from r267270

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11700

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

8 years agoBitcodeWriter: Emit distinct nodes before uniqued nodes
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:42:39 +0000 (04:42 +0000)]
BitcodeWriter: Emit distinct nodes before uniqued nodes

When an operand of a distinct node hasn't been read yet, the reader can
use a DistinctMDOperandPlaceholder.  This is much cheaper than forward
referencing from a uniqued node.  Change
ValueEnumerator::organizeMetadata to partition distinct nodes and
uniqued nodes to reduce the overhead of cycles broken by distinct nodes.

Mehdi measured this for me; this removes most of the RAUW from the
importing step of -flto=thin, even after a WIP patch that removes
string-based DITypeRefs (introducing many more cycles to the metadata
graph).

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

8 years agoAdd #ifndef NDEBUG markers around EXPECT_DEATH after r267270
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:34:11 +0000 (04:34 +0000)]
Add #ifndef NDEBUG markers around EXPECT_DEATH after r267270

http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/36076

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

8 years agoAddress comments.
Teresa Johnson [Sat, 23 Apr 2016 04:31:20 +0000 (04:31 +0000)]
Address comments.

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

8 years agoRefactor bitcode writer into classes (NFC)
Teresa Johnson [Sat, 23 Apr 2016 04:30:47 +0000 (04:30 +0000)]
Refactor bitcode writer into classes (NFC)

Summary:
As discussed in on the mailing list yesterday, I have refactored
BitcodeWriter.cpp to use classes to manage the bitcode writing process,
instead of passing around long lists of parameters between static
functions. See:
  http://lists.llvm.org/pipermail/llvm-dev/2016-April/098610.html

I created a parent BitcodeWriter class to own the BitstreamWriter,
write the header, and contain the main entry point into the writing
process. There are two derived classes, one for writing a module and one
for writing a combined index file (for ThinLTO), which manage the
writing process specific to those bitcode file types.

I also changed the functions to conform to LLVM coding standards
(lowercase function name first letter). The only two routines that still
start with an uppercase letter are the two external interfaces, which
can be fixed as a follow-on (I wanted to keep this round just within
BitcodeWriter.cpp).

Reviewers: dexonsmith, joker.eph

Subscribers: llvm-commits

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

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

8 years agoAvoid ternery statement to please g++ after r267270, NFC
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:23:57 +0000 (04:23 +0000)]
Avoid ternery statement to please g++ after r267270, NFC

http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/36074

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

8 years agoValueEnumerator: Use std::find_if, NFC
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:22:38 +0000 (04:22 +0000)]
ValueEnumerator: Use std::find_if, NFC

Mehdi's pattern recognition pulled this one out.  This is cleaner with
std::find_if than with the strange helper function that took an iterator
by reference and updated it.

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

8 years agoBitcodeReader: Avoid referencing unresolved nodes from distinct ones
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:15:56 +0000 (04:15 +0000)]
BitcodeReader: Avoid referencing unresolved nodes from distinct ones

Each reference to an unresolved MDNode is expensive, since the RAUW
support in MDNode uses a separate allocation and side map.  Since
a distinct MDNode doesn't require its operands on creation (unlike
uniuqed nodes, there's no need to check for structural equivalence),
use nullptr for any of its unresolved operands.  Besides reducing the
burden on MDNode maps, this can avoid allocating temporary MDNodes in
the first place.

We need some way to track operands.  Invent DistinctMDOperandPlaceholder
for this purpose, which is a Metadata subclass that holds an ID and
points at its single user.  DistinctMDOperandPlaceholder::replaceUseWith
is just like RAUW, but its name highlights that there is only ever
exactly one use.

There is no support for moving (or, obviously, copying) these.  Move
support would be possible but expensive; leaving it unimplemented
prevents user error.  In the BitcodeReader I originally considered
allocating on a BumpPtrAllocator and keeping a vector of pointers to
them, and then I realized that std::deque implements exactly this.

A couple of obvious follow-ups:

  - Change ValueEnumerator to emit distinct nodes first to take more
    advantage of this optimization.  (How convenient... I think I might
    have a couple of patches for this.)

  - Change DIBuilder and its consumers (like CGDebugInfo in clang) to
    use something like this when constructing debug info in the first
    place.

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

8 years agoTag the end of an anonymous namespace, NFC
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:02:39 +0000 (04:02 +0000)]
Tag the end of an anonymous namespace, NFC

Prevent clang-format from moving the closing branch.

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

8 years agoBitcodeReader: Consistently use IsDistinct, NFC
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:01:57 +0000 (04:01 +0000)]
BitcodeReader: Consistently use IsDistinct, NFC

Consistently use the IsDistinct variable and start relying on it in
GET_OR_DISTINCT.  This change has NFC, but prepares for using IsDistinct
to optimize the behaviour of the getMD() and getMDOrNull() helpers.

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

8 years agoBitcodeReader: Use getMD/getMDOrNull helpers consistently, almost NFC
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 03:55:14 +0000 (03:55 +0000)]
BitcodeReader: Use getMD/getMDOrNull helpers consistently, almost NFC

The only functionality change was removing an error check from the
BitcodeReader (and an assertion from DILocation::getImpl) that is
already caught by Verifier::visitDILocation.  The Verifier is a better
place for this anyway, and being inconsistent with other subclasses of
MDNode isn't serving anyone.

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

8 years ago[Hexagon] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG will convert...
Craig Topper [Sat, 23 Apr 2016 02:49:31 +0000 (02:49 +0000)]
[Hexagon] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG will convert them to ctlz/cttz. Remove the now unneccessary isel patterns. NFC

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

8 years ago[NVPTX] Set ctlz_zero_undef to Expand so LegalizeDAG will convert it to ctlz. Remove...
Craig Topper [Sat, 23 Apr 2016 02:49:29 +0000 (02:49 +0000)]
[NVPTX] Set ctlz_zero_undef to Expand so LegalizeDAG will convert it to ctlz. Remove the now unneccessary isel patterns. NFC

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

8 years ago[WebAssembly] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG will conve...
Craig Topper [Sat, 23 Apr 2016 02:49:25 +0000 (02:49 +0000)]
[WebAssembly] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG will convert them to ctlz/cttz. Remove the now unneccessary isel patterns. NFC

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

8 years agoStyle fix in Core.h / Core.cpp. NFC
Amaury Sechet [Sat, 23 Apr 2016 00:12:45 +0000 (00:12 +0000)]
Style fix in Core.h / Core.cpp. NFC

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

8 years agollvm-objdump: deal with invalid ARM encodings slightly better.
Tim Northover [Fri, 22 Apr 2016 23:23:31 +0000 (23:23 +0000)]
llvm-objdump: deal with invalid ARM encodings slightly better.

Before we printed a warning to stderr and left the actual output stream in a
mess. This tries to print a .long or .short representation of what we saw (as
if there was a data-in-code directive).

This isn't guaranteed to restore synchronization in Thumb-mode (if the invalid
instruction was supposed to be 32-bits, we may be off-by-16 for the rest of the
function). But there's no certain way to deal with that, and it's invalid code
anyway (if the data really wasn't an instruction, the user can add proper
.data_in_code directives if they care)

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

8 years agoMachO: remove weird ARM/Thumb interface from MachOObjectFile
Tim Northover [Fri, 22 Apr 2016 23:21:13 +0000 (23:21 +0000)]
MachO: remove weird ARM/Thumb interface from MachOObjectFile

Only one consumer (llvm-objdump) actually cared about the fact that there were
two triples. Others were actively working around the fact that the Triple
returned by getArch might have been invalid. As for llvm-objdump, it needs to
be acutely aware of both Triples anyway, so being generic in the exposed API is
no benefit.

Also rename the version of getArch returning a Triple. Users were having to
pass an unwanted nullptr to disambiguate the two, which was nasty.

The only functional change here is that armv7m and armv7em object files no
longer crash llvm-objdump.

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

8 years agoAMDGPU: sext_inreg (srl x, K), vt -> bfe x, K, vt.Size
Matt Arsenault [Fri, 22 Apr 2016 22:59:16 +0000 (22:59 +0000)]
AMDGPU: sext_inreg (srl x, K), vt -> bfe x, K, vt.Size

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

8 years agoFix llvm/test/CodeGen/ARM/Windows/dbzchk.ll not to check mixed output, take #2.
NAKAMURA Takumi [Fri, 22 Apr 2016 22:51:48 +0000 (22:51 +0000)]
Fix llvm/test/CodeGen/ARM/Windows/dbzchk.ll not to check mixed output, take #2.

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

8 years agollvm-symbolizer: Avoid infinite recursion walking dwos where the dwo contains a dwo_n...
David Blaikie [Fri, 22 Apr 2016 22:50:56 +0000 (22:50 +0000)]
llvm-symbolizer: Avoid infinite recursion walking dwos where the dwo contains a dwo_name attribute

The dwo_name was added to dwo files to improve diagnostics in dwp, but
it confuses tools that attempt to load any dwo named by a dwo_name, even
ones inside dwos. Avoid this by keeping track of whether a unit is
already a dwo unit, and if so, not loading further dwos.

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

8 years agoAMDGPU: Re-visit nodes in performAndCombine
Matt Arsenault [Fri, 22 Apr 2016 22:48:38 +0000 (22:48 +0000)]
AMDGPU: Re-visit nodes in performAndCombine

This fixes test regressions when i64 loads/stores are made promote.

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

8 years agoAdd some release notes about the fix for PR26774
Sanjoy Das [Fri, 22 Apr 2016 22:45:23 +0000 (22:45 +0000)]
Add some release notes about the fix for PR26774

As suggested by Chandler on the review thread for D18634.

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

8 years agoFix comment about Intr*Mem properties
Nicolai Haehnle [Fri, 22 Apr 2016 22:37:58 +0000 (22:37 +0000)]
Fix comment about Intr*Mem properties

Summary:
Follow up to D19291: it now makes sense to use two Intr*Mem properties,
in particular IntrReadMem + IntrArgMemOnly is common.

Pointed out by Mikael Holmén.

Reviewers: uabelho, joker.eph, reames

Subscribers: llvm-commits

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

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

8 years agoRemoving unused function.
Andrew Kaylor [Fri, 22 Apr 2016 22:24:20 +0000 (22:24 +0000)]
Removing unused function.

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

8 years agoRevert r267210, it makes clang assert (PR27490).
Nico Weber [Fri, 22 Apr 2016 22:08:42 +0000 (22:08 +0000)]
Revert r267210, it makes clang assert (PR27490).

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

8 years agoRe-commit optimization bisect support (r267022) without new pass manager support.
Andrew Kaylor [Fri, 22 Apr 2016 22:06:11 +0000 (22:06 +0000)]
Re-commit optimization bisect support (r267022) without new pass manager support.

The original commit was reverted because of a buildbot problem with LazyCallGraph::SCC handling (not related to the OptBisect handling).

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

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

8 years agoDifferential Revision: http://reviews.llvm.org/D19040
Sriraman Tallam [Fri, 22 Apr 2016 21:41:58 +0000 (21:41 +0000)]
Differential Revision: reviews.llvm.org/D19040

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

8 years agollvm-symbolizer: prefer .dwo contents over fission-gmlt-like-data when .dwo file...
David Blaikie [Fri, 22 Apr 2016 21:32:59 +0000 (21:32 +0000)]
llvm-symbolizer: prefer .dwo contents over fission-gmlt-like-data when .dwo file is present

Rather than relying on the gmlt-like data emitted into the .o/executable
which only contains the simple name of any inlined functions, use the
.dwo file if present.

Test symbolication with/without a .dwo, and the old test that was
testing behavior when no gmlt-like data was present. (I haven't included
a test of non-gmlt-like data + no .dwo (that would be akin to
symbolication with no debug info) but we could add one for completeness)

The test was simplified a bit to be a little clearer (unoptimized, force
inline, using a function call as the inlined entity) and regenerated
with ToT clang. For the no-gmlt-like-data case, I modified Clang back to
its old behavior temporarily & the .dwo file is identical so it is
shared between the two executables.

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

8 years agoUpdate discriminator assignment algorithm in clang assembler.
Dehao Chen [Fri, 22 Apr 2016 21:31:18 +0000 (21:31 +0000)]
Update discriminator assignment algorithm in clang assembler.

Summary: The clang assembler assumes that the discriminator remains the same when there is source line change. The correct behavior is that when there is line change, discriminator will automatically reset to 0.

Reviewers: dnovillo, davidxl, echristo

Subscribers: echristo, llvm-commits

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

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

8 years agoAMDGPU: Fix crash when dumping unknown opcode
Matt Arsenault [Fri, 22 Apr 2016 21:23:41 +0000 (21:23 +0000)]
AMDGPU: Fix crash when dumping unknown opcode

I'm for some reason having a problem producing a test.
It should be the same as test/MC/X86/invalid_opcode.s,
but llvm-mc seems to ignore random bytes.

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

8 years agoIntroduce llvm.load.relative intrinsic.
Peter Collingbourne [Fri, 22 Apr 2016 21:18:02 +0000 (21:18 +0000)]
Introduce llvm.load.relative intrinsic.

This intrinsic takes two arguments, ``%ptr`` and ``%offset``. It loads
a 32-bit value from the address ``%ptr + %offset``, adds ``%ptr`` to that
value and returns it. The constant folder specifically recognizes the form of
this intrinsic and the constant initializers it may load from; if a loaded
constant initializer is known to have the form ``i32 trunc(x - %ptr)``,
the intrinsic call is folded to ``x``.

LLVM provides that the calculation of such a constant initializer will
not overflow at link time under the medium code model if ``x`` is an
``unnamed_addr`` function. However, it does not provide this guarantee for
a constant initializer folded into a function body. This intrinsic can be
used to avoid the possibility of overflows when loading from such a constant.

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

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

8 years agoTLI: Only iterate over integer vector types
Matt Arsenault [Fri, 22 Apr 2016 21:16:17 +0000 (21:16 +0000)]
TLI: Only iterate over integer vector types

Instead of iterating over all vectors and skipping integers.

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

8 years agoDAGCombiner: Relax alignment restriction when changing store type
Matt Arsenault [Fri, 22 Apr 2016 21:01:41 +0000 (21:01 +0000)]
DAGCombiner: Relax alignment restriction when changing store type

If the target allows the alignment, this should be OK.

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

8 years ago[PGO] change the interface for createPGOFuncNameMetadata()
Rong Xu [Fri, 22 Apr 2016 21:00:17 +0000 (21:00 +0000)]
[PGO] change the interface for createPGOFuncNameMetadata()

This patch changes the interface for createPGOFuncNameMetadata() where we add
another PGOFuncName argument.

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

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

8 years ago[unordered] sink unordered stores at end of blocks
Philip Reames [Fri, 22 Apr 2016 20:53:32 +0000 (20:53 +0000)]
[unordered] sink unordered stores at end of blocks

The existing code turned out to be completely correct when auditted.  Thus, only minor code changes and adding a couple of tests.

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

8 years agoFold compares for distinct allocations
Sanjoy Das [Fri, 22 Apr 2016 20:52:25 +0000 (20:52 +0000)]
Fold compares for distinct allocations

Summary:
We can fold compares to false when two distinct allocations within a
function are compared for equality.

Patch by Anna Thomas!

Reviewers: majnemer, reames, sanjoy

Subscribers: llvm-commits

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

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

8 years agoCodeGen: Use PLT relocations for relative references to unnamed_addr functions.
Peter Collingbourne [Fri, 22 Apr 2016 20:40:10 +0000 (20:40 +0000)]
CodeGen: Use PLT relocations for relative references to unnamed_addr functions.

The relative vtable ABI (PR26723) needs PLT relocations to refer to virtual
functions defined in other DSOs. The unnamed_addr attribute means that the
function's address is not significant, so we're allowed to substitute it
with the address of a PLT entry.

Also includes a bonus feature: addends for COFF image-relative references.

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

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

8 years ago[unordered] Extend load/store type canonicalization to handle unordered operations
Philip Reames [Fri, 22 Apr 2016 20:33:48 +0000 (20:33 +0000)]
[unordered] Extend load/store type canonicalization to handle unordered operations

Extend the type canonicalization logic to work for unordered atomic loads and stores.  Note that while this change itself is fairly simple and low risk, there's a reasonable chance this will expose problems in the backends by suddenly generating IR they wouldn't have seen before.  Anything of this nature will be an existing bug in the backend (you could write an atomic float load), but this will definitely change the frequency with which such cases are encountered.  If you see problems, feel free to revert this change, but please make sure you collect a test case.

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

8 years agoDAGCombiner: Relax alignment restriction when changing load type
Matt Arsenault [Fri, 22 Apr 2016 20:21:36 +0000 (20:21 +0000)]
DAGCombiner: Relax alignment restriction when changing load type

If the target allows the alignment, this should still be OK.

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

8 years ago[AArch64] Fix optimizeCondBranch logic.
Quentin Colombet [Fri, 22 Apr 2016 20:09:58 +0000 (20:09 +0000)]
[AArch64] Fix optimizeCondBranch logic.

The opcode for the optimized branch does not depend on the size
of the activate bits in the AND masks, but the AND opcode itself.
Indeed, we need to use a X or W variant based on the AND variant
not based on whether the mask fits into the related variant.
Otherwise, we may end up using the W variant of the optimized branch
for 64-bit register inputs!

This fixes the last make check verifier issues for AArch64: PR27479.

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

8 years agoPM: Port SinkingPass to the new pass manager
Justin Bogner [Fri, 22 Apr 2016 19:54:10 +0000 (19:54 +0000)]
PM: Port SinkingPass to the new pass manager

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

8 years agoPM: Reorder the functions used for SinkingPass. NFC
Justin Bogner [Fri, 22 Apr 2016 19:54:04 +0000 (19:54 +0000)]
PM: Reorder the functions used for SinkingPass. NFC

This will make the port to the new PM easier to follow.

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

8 years ago[DeadStoreElimination] Shorten beginning of memset overwritten by later stores
Jun Bum Lim [Fri, 22 Apr 2016 19:51:29 +0000 (19:51 +0000)]
[DeadStoreElimination] Shorten beginning of memset overwritten by later stores

Summary: This change will shorten memset if the beginning of memset is overwritten by later stores.

Reviewers: hfinkel, eeckstein, dberlin, mcrosier

Subscribers: mgrang, mcrosier, llvm-commits

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

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

8 years agoPM: Port DCE to the new pass manager
Justin Bogner [Fri, 22 Apr 2016 19:40:41 +0000 (19:40 +0000)]
PM: Port DCE to the new pass manager

Also add a very basic test, since apparently there aren't any tests
for DCE whatsoever to add the new pass version to.

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

8 years agoMachineScheduler: Move code to initialize a Candidate out of tryCandidate(); NFC
Matthias Braun [Fri, 22 Apr 2016 19:10:15 +0000 (19:10 +0000)]
MachineScheduler: Move code to initialize a Candidate out of tryCandidate(); NFC

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

8 years ago[LoopUtils] Extend findStringMetadataForLoop to return the value for metadata
Adam Nemet [Fri, 22 Apr 2016 19:10:05 +0000 (19:10 +0000)]
[LoopUtils] Extend findStringMetadataForLoop to return the value for metadata

E.g. for:

  !1 = {"llvm.distribute", i32 1}

it now returns the MDOperand for 1.

I will use this in LoopDistribution to check the value of the metadata.

Note that the change is backward-compatible with its current use in
LoopVersioningLICM.  An Optional implicitly converts to a bool depending
whether it contains a value or not.

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

8 years agoMachineScheduler: Limit the size of the ready list.
Matthias Braun [Fri, 22 Apr 2016 19:09:17 +0000 (19:09 +0000)]
MachineScheduler: Limit the size of the ready list.

Avoid quadratic complexity in unusually large basic blocks by limiting
the size of the ready lists.

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

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

8 years ago[EarlyCSE/CVP] Add stats for CVPs and make sure to account for any Changes.
Chad Rosier [Fri, 22 Apr 2016 18:47:21 +0000 (18:47 +0000)]
[EarlyCSE/CVP] Add stats for CVPs and make sure to account for any Changes.

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

8 years ago[AArch64] When creating MRS instruction, make sure the destination register is
Quentin Colombet [Fri, 22 Apr 2016 18:46:17 +0000 (18:46 +0000)]
[AArch64] When creating MRS instruction, make sure the destination register is
declared as a definition.

This fixes the machine verifier error for CodeGen/AArch64/nzcv-save.ll.

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

8 years ago[LoopVersioningLICM] Add test coverage for llvm.loop.licm_versioning.disable
Adam Nemet [Fri, 22 Apr 2016 18:34:50 +0000 (18:34 +0000)]
[LoopVersioningLICM] Add test coverage for llvm.loop.licm_versioning.disable

In the next change, I am generalizing the function
findStringMetadataForLoop and I want to make sure I don't break this.
Looks like there was no coverage for this so far.

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

8 years ago[AArch64][AdvSIMDScalar] Update the kill flags correctly.
Quentin Colombet [Fri, 22 Apr 2016 18:09:14 +0000 (18:09 +0000)]
[AArch64][AdvSIMDScalar] Update the kill flags correctly.

We used to simply set the kill flags to true when transforming a scalar
instruction to a vector one.
SrcScalar1 = copy SrcVector1
... = opScalar SrcScalar1
=>
SrcScalar1 = copy SrcVector1
... = opVector SrcVector1<kill>

This is obviously wrong. The proper update consists in:
1. Propagate the kill status from the copy to the new opVector
2. Reset the kill status on the copy, since the live-range of
   SrcVector1 got extended.

This fixes some of the machine verifier errors for AArch64 with make check.

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

8 years agotest: split test into two runs
Saleem Abdulrasool [Fri, 22 Apr 2016 18:06:51 +0000 (18:06 +0000)]
test: split test into two runs

Rather than checking both stdout and stderr simultaneously, split it into two
tests.  This apparently breaks on Windows where MSVCRT does not buffer output
correctly.  NFC.

Thanks to chapuni for bringing the issue to my attention!

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

8 years ago[Hexagon] Use common Pat classes for selecting code for intrinsics
Krzysztof Parzyszek [Fri, 22 Apr 2016 18:05:55 +0000 (18:05 +0000)]
[Hexagon] Use common Pat classes for selecting code for intrinsics

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

8 years ago[SimplifyCFG] Add final missing implications to isImpliedTrueByMatchingCmp.
Chad Rosier [Fri, 22 Apr 2016 17:57:34 +0000 (17:57 +0000)]
[SimplifyCFG] Add final missing implications to isImpliedTrueByMatchingCmp.

Summary: eq imply [u|s]ge and [u|s]le are true.

Remove redundant logic by implementing isImpliedFalseByMatchingCmp(Pred1, Pred2)
as isImpliedTrueByMatchingCmp(Pred1, getInversePredicate(Pred2)).

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

8 years agoPoint link to CODE_OWNERS.txt to klaus instead of viewvc.
Michael Kuperstein [Fri, 22 Apr 2016 17:41:12 +0000 (17:41 +0000)]
Point link to CODE_OWNERS.txt to klaus instead of viewvc.

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

8 years agoHave isKnownNotFullPoison be smarter around control flow
Sanjoy Das [Fri, 22 Apr 2016 17:41:06 +0000 (17:41 +0000)]
Have isKnownNotFullPoison be smarter around control flow

Summary:
(... while still not using a PostDomTree)

The way we use isKnownNotFullPoison from SCEV today, the new CFG walking
logic will not trigger for any realistic cases -- it will kick in only
for situations where we could have merged the contiguous basic blocks
anyway[0], since the poison generating instruction dominates all of its
non-PHI uses (which are the only uses we consider right now).

However, having this change in place will allow a later bugfix to break
fewer llvm-lit tests.

[0]: i.e. cases where block A branches to block B and B is A's only
successor and A is B's only predecessor.

Reviewers: broune, bjarke.roune

Subscribers: mcrosier, llvm-commits

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

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

8 years ago[Hexagon] Properly close live range in HexagonBlockRanges ---add testcase
Krzysztof Parzyszek [Fri, 22 Apr 2016 17:30:13 +0000 (17:30 +0000)]
[Hexagon] Properly close live range in HexagonBlockRanges ---add testcase

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

8 years ago[Hexagon] Properly close live range in HexagonBlockRanges
Krzysztof Parzyszek [Fri, 22 Apr 2016 17:27:22 +0000 (17:27 +0000)]
[Hexagon] Properly close live range in HexagonBlockRanges

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

8 years agoPM: Remove some redundant name() methods
Justin Bogner [Fri, 22 Apr 2016 17:25:43 +0000 (17:25 +0000)]
PM: Remove some redundant name() methods

These passes all get names from PassInfoMixin already, we don't need
to override them.

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

8 years ago[SimplifyCFG] Add missing implications to isImpliedTrueByMatchingCmp.
Chad Rosier [Fri, 22 Apr 2016 17:14:12 +0000 (17:14 +0000)]
[SimplifyCFG] Add missing implications to isImpliedTrueByMatchingCmp.

Summary: [u|s]gt and [u|s]lt imply [u|s]ge and [u|s]le are true, respectively.
I've simplified the existing tests and added additional tests to cover the new
cases mentioned above.  I've also added tests for all the cases where the
first compare doesn't imply anything about the second compare.

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

8 years ago[SimplifyCFG] Simplify code review by temporarily removing this test file.
Chad Rosier [Fri, 22 Apr 2016 17:14:08 +0000 (17:14 +0000)]
[SimplifyCFG] Simplify code review by temporarily removing this test file.

A followup commit will replace these tests with simplified and more inclusive
tests.  The diff is unreadable if this were to be done in a single commit.

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

8 years ago[AMDGPU] Insert nop pass: take care of outstanding feedback
Konstantin Zhuravlyov [Fri, 22 Apr 2016 17:04:51 +0000 (17:04 +0000)]
[AMDGPU] Insert nop pass: take care of outstanding feedback

- Switch few loops to range-based for loops
- Fix nop insertion at the end of BB
- Fix formatting
- Check for endpgm

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

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

8 years ago[mips][microMIPS] Revert commit r266861.
Zoran Jovanovic [Fri, 22 Apr 2016 16:53:15 +0000 (16:53 +0000)]
[mips][microMIPS] Revert commit r266861.
Commit r266861 was the reason for failing tests in LLVM test suite.

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

8 years ago[Hexagon] Teach mux expansion how to deal with undef predicates
Krzysztof Parzyszek [Fri, 22 Apr 2016 16:47:01 +0000 (16:47 +0000)]
[Hexagon] Teach mux expansion how to deal with undef predicates

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

8 years ago[Hexagon] Add definitions for trap/pause instructions
Krzysztof Parzyszek [Fri, 22 Apr 2016 16:25:00 +0000 (16:25 +0000)]
[Hexagon] Add definitions for trap/pause instructions

Also add tests for other instructions from HexagonSystemInst.td.

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