OSDN Git Service

android-x86/external-llvm.git
6 years agoFix -Wcovered-switch-default warnings from r314821
Hans Wennborg [Tue, 3 Oct 2017 18:44:12 +0000 (18:44 +0000)]
Fix -Wcovered-switch-default warnings from r314821

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

6 years agoRevert r314817 "[dwarfdump] Add -lookup option"
Hans Wennborg [Tue, 3 Oct 2017 18:39:13 +0000 (18:39 +0000)]
Revert r314817 "[dwarfdump] Add -lookup option"

The test fails on Linux; see follow-up email on the llvm-commits list.

> Add the option to lookup an address in the debug information and print
> out the file, function, block and line table details.
>
> Differential revision: https://reviews.llvm.org/D38409

This also reverts the follow-up r314818:

> [test] Fix llvm-dwarfdump/cmdline.test
>
> Fixes test/tools/llvm-dwarfdump/cmdline.test

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

6 years agoRevert r314806 "[SLP] Vectorize jumbled memory loads."
Hans Wennborg [Tue, 3 Oct 2017 18:32:29 +0000 (18:32 +0000)]
Revert r314806 "[SLP] Vectorize jumbled memory loads."

All the buildbots are red, e.g.
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-lld/builds/2436/

> Summary:
> This patch tries to vectorize loads of consecutive memory accesses, accessed
> in non-consecutive or jumbled way. An earlier attempt was made with patch D26905
> which was reverted back due to some basic issue with representing the 'use mask' of
> jumbled accesses.
>
> This patch fixes the mask representation by recording the 'use mask' in the usertree entry.
>
> Change-Id: I9fe7f5045f065d84c126fa307ef6ebe0787296df
>
> Reviewers: mkuper, loladiro, Ayal, zvi, danielcdh
>
> Reviewed By: Ayal
>
> Subscribers: hans, mzolotukhin
>
> Differential Revision: https://reviews.llvm.org/D36130

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

6 years agoFix expectations in MC wasm init-fini-array test
Reid Kleckner [Tue, 3 Oct 2017 18:30:38 +0000 (18:30 +0000)]
Fix expectations in MC wasm init-fini-array test

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

6 years agoImplement David Blaikie's suggestion for comparison operators
Reid Kleckner [Tue, 3 Oct 2017 18:30:11 +0000 (18:30 +0000)]
Implement David Blaikie's suggestion for comparison operators

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

6 years agoCodeView: Provide a .def file with the register ids
Hans Wennborg [Tue, 3 Oct 2017 18:27:22 +0000 (18:27 +0000)]
CodeView: Provide a .def file with the register ids

The list of register ids was previously written out in a couple of dirrent
places. This puts it in a .def file and also adds a few more registers (e.g.
the x87 regs) which should lead to more readable dumps, but I didn't include
the whole list since that seems unnecessary.

X86_MC::initLLVMToSEHAndCVRegMapping is pretty ugly, but at least it's not
relying on magic constants anymore. The TODO of using tablegen still stands.

Differential revision: https://reviews.llvm.org/D38480

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

6 years ago[DebugInfo] Correctly coalesce DBG_VALUEs that mix direct and indirect values
Reid Kleckner [Tue, 3 Oct 2017 17:59:02 +0000 (17:59 +0000)]
[DebugInfo] Correctly coalesce DBG_VALUEs that mix direct and indirect values

Summary:
This should fix a regression introduced by r313786, which switched from
MachineInstr::isIndirectDebugValue() to checking if operand 1 is an
immediate. I didn't have a test case for it until now.

A single UserValue, which approximates a user variable, may have many
DBG_VALUE instructions that disagree about whether the variable is in
memory or in a virtual register. This will become much more common once
we have llvm.dbg.addr, but you can construct such a test case manually
today with llvm.dbg.value.

Before this change, we would get two UserValues: one for direct and one
for indirect DBG_VALUE instructions describing the same variable. If we
build separate interval maps for direct and indirect locations, we will
end up accidentally coalescing identical DBG_VALUE intervals that need
to remain separate because they are broken up by intervals of the
opposite direct-ness.

Reviewers: aprantl

Subscribers: llvm-commits, hiraditya

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

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

6 years ago[test] Fix llvm-dwarfdump/cmdline.test
Jonas Devlieghere [Tue, 3 Oct 2017 17:28:37 +0000 (17:28 +0000)]
[test] Fix llvm-dwarfdump/cmdline.test

Fixes test/tools/llvm-dwarfdump/cmdline.test

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

6 years ago[dwarfdump] Add -lookup option
Jonas Devlieghere [Tue, 3 Oct 2017 17:10:21 +0000 (17:10 +0000)]
[dwarfdump] Add -lookup option

Add the option to lookup an address in the debug information and print
out the file, function, block and line table details.

Differential revision: https://reviews.llvm.org/D38409

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

6 years ago[X86] Add non-SSE tests for PR15215 as well
Simon Pilgrim [Tue, 3 Oct 2017 17:04:36 +0000 (17:04 +0000)]
[X86] Add non-SSE tests for PR15215 as well

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

6 years agoRevert "Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding""
Geoff Berry [Tue, 3 Oct 2017 16:59:13 +0000 (16:59 +0000)]
Revert "Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding""

This reverts commit r314729.

Another bug has been encountered in an out-of-tree target reported by Quentin.

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

6 years ago[X86][SSE] Add bool vector extraction test cases from PR15215
Simon Pilgrim [Tue, 3 Oct 2017 16:56:57 +0000 (16:56 +0000)]
[X86][SSE] Add bool vector extraction test cases from PR15215

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

6 years agoUse sched_getaffinity instead of std::thread::hardware_concurrency.
Rafael Espindola [Tue, 3 Oct 2017 16:25:15 +0000 (16:25 +0000)]
Use sched_getaffinity instead of std::thread::hardware_concurrency.

The issue with std::thread::hardware_concurrency is that it forwards
to libc and some implementations (like glibc) don't take thread
affinity into consideration.

With this change a llvm program that can execute in only 2 cores will
use 2 threads, even if the machine has 32 cores.

This makes benchmarking a lot easier, but should also help if someone
doesn't want to use all cores for compilation for example.

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

6 years agoRevert the change that accidentally went in r314806.
Dehao Chen [Tue, 3 Oct 2017 15:50:42 +0000 (15:50 +0000)]
Revert the change that accidentally went in r314806.

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

6 years ago[SLP] Vectorize jumbled memory loads.
Mohammad Shahid [Tue, 3 Oct 2017 15:28:48 +0000 (15:28 +0000)]
[SLP] Vectorize jumbled memory loads.

Summary:
This patch tries to vectorize loads of consecutive memory accesses, accessed
in non-consecutive or jumbled way. An earlier attempt was made with patch D26905
which was reverted back due to some basic issue with representing the 'use mask' of
jumbled accesses.

This patch fixes the mask representation by recording the 'use mask' in the usertree entry.

Change-Id: I9fe7f5045f065d84c126fa307ef6ebe0787296df

Reviewers: mkuper, loladiro, Ayal, zvi, danielcdh

Reviewed By: Ayal

Subscribers: hans, mzolotukhin

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

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

6 years ago[Dominators] Don't use default parameter in lambda
Jakub Kuderski [Tue, 3 Oct 2017 14:51:31 +0000 (14:51 +0000)]
[Dominators] Don't use default parameter in lambda

... to make GCC buildbots happy.

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

6 years ago[ARM] Use table-gen'd assembly operand diags in ARM asm parser
Oliver Stannard [Tue, 3 Oct 2017 14:38:52 +0000 (14:38 +0000)]
[ARM] Use table-gen'd assembly operand diags in ARM asm parser

This switches the ARM AsmParser to use assembly operand diagnostics from
tablegen, rather than a switch statement on the ARMMatchResultTy. It
moves the existing diagnostic strings to tablegen, but adds no new ones,
so this is NFC except for one diagnostic string that had an off-by-1 error
in the hand-written switch statement.

Differential revision: https://reviews.llvm.org/D31607

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

6 years ago[AsmParser] Add DiagnosticString to AsmOperands in tablegen
Oliver Stannard [Tue, 3 Oct 2017 14:34:57 +0000 (14:34 +0000)]
[AsmParser] Add DiagnosticString to AsmOperands in tablegen

This adds a DiagnosticString member to the AsmOperand tablegen class, so
that the diagnostic text to be used when an assembly operand is
incorrect can be stored in the tablegen description of the operand,
rather than in a separate switch statement in the AsmParser.

If DiagnosticString is used for any operands, tablegen will emit a
getMatchKindDiag function, to map from diagnostic enums to strings.

Differential revision: https://reviews.llvm.org/D31606

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

6 years ago[Dominators] Add DFS number verification
Jakub Kuderski [Tue, 3 Oct 2017 14:33:41 +0000 (14:33 +0000)]
[Dominators] Add DFS number verification

Summary:
This patch teaches the DominatorTree verifier to check DFS In/Out numbers which are used to answer dominance queries.
DFS number verification is done in O(nlogn), so it shouldn't add much overhead on top of the O(n^3) sibling property verification.
This check should detect errors like the one spotted in PR34466 and related bug reports.

The patch also cleans up the DFS calculation a bit, as all constructed trees should have a single root now.

I see 2 new test failures when running check-all after this change:

```
Failing Tests (2):
    Polly :: Isl/CodeGen/OpenMP/reference-argument-from-non-affine-region.ll
    Polly :: Isl/CodeGen/OpenMP/two-parallel-loops-reference-outer-indvar.ll

```
which seem to happen just after `Create LLVM-IR from SCoPs` -- I XFAILed them in r314800.

Reviewers: dberlin, grosser, davide, zhendongsu, bollu

Reviewed By: dberlin

Subscribers: nandini12396, bollu, Meinersbur, brzycki, llvm-commits

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

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

6 years ago[ARM, Asm] Use correct source location for register tokens
Oliver Stannard [Tue, 3 Oct 2017 14:30:58 +0000 (14:30 +0000)]
[ARM, Asm] Use correct source location for register tokens

tryParseRegister advances the lexer, so we need to take copies of the start and
end locations of the register operand before calling it.

Previously, the caret in the diagnostic pointer to the comma after the r0
operand in the test, rather than the start of the operand.

Differential revision: https://reviews.llvm.org/D31537

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

6 years ago[mips] Enable spilling and reloading of the dsp register set.
Simon Dardis [Tue, 3 Oct 2017 13:45:49 +0000 (13:45 +0000)]
[mips] Enable spilling and reloading of the dsp register set.

The dsp register class is an alias of the gpr register class, so
we have to define instructions for spilling and reloading.

Reviewers: atanasyan

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

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

6 years ago[CGP] Make optimizeMemoryInst capable of handling multiple AddrModes
John Brawn [Tue, 3 Oct 2017 13:08:22 +0000 (13:08 +0000)]
[CGP] Make optimizeMemoryInst capable of handling multiple AddrModes

Currently optimizeMemoryInst requires that all of the AddrModes it sees are
identical. This patch makes it capable of tracking multiple AddrModes, so long
as they differ in at most one field.

This patch does nothing by itself, but later patches will make use of it to
insert or reuse phi or select instructions for the differing fields.

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

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

6 years ago[CGP] In optimizeMemoryInst handle select similarly to phi
John Brawn [Tue, 3 Oct 2017 13:04:15 +0000 (13:04 +0000)]
[CGP] In optimizeMemoryInst handle select similarly to phi

This lets us optimize away selects that perform the same address computation in
two different ways and is also the first step towards being able to handle
selects between two different, but compatible, address computations.

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

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

6 years ago[ARM, Asm] Fix ubsan failure caused by out-of-range enum value
Oliver Stannard [Tue, 3 Oct 2017 12:45:18 +0000 (12:45 +0000)]
[ARM, Asm] Fix ubsan failure caused by out-of-range enum value

In this code, we use ~0U as a sentinel value for any operand class that doesn't
have a user-friendly error message, but this value isn't in range of the
MatchClassKind enum, so we need to ensure it does not get passed to isSubclass.

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

6 years ago[X86][SSE] Add support for decoding PACKSS/PACKUS shuffles masks with UNDEF
Simon Pilgrim [Tue, 3 Oct 2017 12:41:39 +0000 (12:41 +0000)]
[X86][SSE] Add support for decoding PACKSS/PACKUS shuffles masks with UNDEF

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

6 years ago[ARM, Asm] Remove dead code causing MSan failure.
Oliver Stannard [Tue, 3 Oct 2017 12:28:28 +0000 (12:28 +0000)]
[ARM, Asm] Remove dead code causing MSan failure.

r314779 caused ErrorInfo to be red uninitialised, but also made this code dead,
so it can just be removed.

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

6 years ago[X86][SSE] Add support for lowering shuffles to PACKSS/PACKUS
Simon Pilgrim [Tue, 3 Oct 2017 12:01:31 +0000 (12:01 +0000)]
[X86][SSE] Add support for lowering shuffles to PACKSS/PACKUS

If the upper bits of a truncation shuffle patterns have at least the minimum number of sign/zero bits on their inputs then we can safely use PACKSS/PACKUS as shuffles.

Partial fix for https://bugs.llvm.org/show_bug.cgi?id=34773

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

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

6 years ago[InlineCost, NFC] Extract code dealing with inbounds GEPs from visitGetElementPtr...
Evgeny Astigeevich [Tue, 3 Oct 2017 12:00:40 +0000 (12:00 +0000)]
[InlineCost, NFC] Extract code dealing with inbounds GEPs from visitGetElementPtr into a function

The code responsible for analysis of inbounds GEPs is extracted into a separate
function: CallAnalyzer::canFoldInboundsGEP. With the patch SROA
enabling/disabling code is localized at one place instead of spreading across
the code of CallAnalyzer::visitGetElementPtr.

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

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

6 years ago[WebAssembly] MC: Support for init_array and fini_array
Sam Clegg [Tue, 3 Oct 2017 11:20:28 +0000 (11:20 +0000)]
[WebAssembly] MC: Support for init_array and fini_array

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

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

6 years ago[llvm-cov] Hide files with no coverage from the index when filtering by name
Sean Eveson [Tue, 3 Oct 2017 11:05:28 +0000 (11:05 +0000)]
[llvm-cov] Hide files with no coverage from the index when filtering by name

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

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

6 years ago[DebugInfo] Handle endianness when moving debug info for split integer values (reapplied)
Bjorn Pettersson [Tue, 3 Oct 2017 11:03:02 +0000 (11:03 +0000)]
[DebugInfo] Handle endianness when moving debug info for split integer values (reapplied)

Summary:
Take the target's endianness into account when splitting the
debug information in DAGTypeLegalizer::SetExpandedInteger.

This patch fixes so that, for big-endian targets, the fragment
expression corresponding to the high part of a split integer
value is placed at offset 0, in order to correctly represent
the memory address order.

I have attached a PPC32 reproducer where the resulting DWARF
pieces for a 64-bit integer were incorrectly reversed.

Original patch was reverted due to using -stop-after=isel in
the test case (but that is only working when AMDGPU target
is included in the llc build). The test case has now been
updated to use -stop-before=expand-isel-pseudos instead.

Patch by: dstenb

Reviewers: JDevlieghere, aprantl, dblaikie

Reviewed By: JDevlieghere, aprantl, dblaikie

Subscribers: nemanjai

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

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

6 years ago[ARM] Use new assembler diags for ARM
Oliver Stannard [Tue, 3 Oct 2017 10:26:11 +0000 (10:26 +0000)]
[ARM] Use new assembler diags for ARM

This converts the ARM AsmParser to use the new assembly matcher error
reporting mechanism, which allows errors to be reported for multiple
instruction encodings when it is ambiguous which one the user intended
to use.

By itself this doesn't improve many error messages, because we don't have
diagnostic text for most operand types, but as we add that then this will allow
more of those diagnostic strings to be used when they are relevant.

Differential revision: https://reviews.llvm.org/D31530

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

6 years agoRemove unused variable. NFCI.
Simon Pilgrim [Tue, 3 Oct 2017 10:01:02 +0000 (10:01 +0000)]
Remove unused variable. NFCI.

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

6 years ago[X86][SSE] Add support for shuffle combining from PACKSS/PACKUS
Simon Pilgrim [Tue, 3 Oct 2017 09:54:03 +0000 (09:54 +0000)]
[X86][SSE] Add support for shuffle combining from PACKSS/PACKUS

Mentioned in D38472

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

6 years ago[X86][SSE] Add support for PACKSS/PACKUS constant folding
Simon Pilgrim [Tue, 3 Oct 2017 09:41:00 +0000 (09:41 +0000)]
[X86][SSE] Add support for PACKSS/PACKUS constant folding

Pulled out of D38472

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

6 years ago[MiSched] - Simplify ProcResEntry access
Javed Absar [Tue, 3 Oct 2017 09:35:04 +0000 (09:35 +0000)]
[MiSched] - Simplify ProcResEntry access

Reviewed by: @MatzeB
Differential Revision: https://reviews.llvm.org/D38447

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

6 years ago[Assembler] Report multiple near misses for invalid instructions
Oliver Stannard [Tue, 3 Oct 2017 09:33:12 +0000 (09:33 +0000)]
[Assembler] Report multiple near misses for invalid instructions

The current table-generated assembly instruction matcher returns a
64-bit error code when matching fails. Since multiple instruction
encodings with the same mnemonic can fail for different reasons, it uses
some heuristics to decide which message is important.

This heuristic does not work well for targets that have many encodings
with the same mnemonic but different operands, or which have different
versions of instructions controlled by subtarget features, as it is hard
to know which encoding the user was intending to use.

Instead of trying to improve the heuristic in the table-generated
matcher, this patch changes it to report a list of near-miss encodings.
This list contains an entry for each encoding with the correct mnemonic,
but with exactly one thing preventing it from being valid. This thing
could be a single invalid operand, a missing target feature or a failed
target-specific validation function.

The target-specific assembly parser can then report an error message
giving multiple options for instruction variants that the user may have
been trying to use. For example, I am working on a patch to use this for
ARM, which can give this error for an invalid instruction for ARMv6-M:

  <stdin>:8:3: error: invalid instruction, multiple near-miss encodings found
    adds r0, r1, #0x8
    ^
  <stdin>:8:3: note: for one encoding: instruction requires: thumb2
    adds r0, r1, #0x8
    ^
  <stdin>:8:16: note: for one encoding: expected an integer in range [0, 7]
    adds r0, r1, #0x8
                 ^
  <stdin>:8:16: note: for one encoding: expected a register in range [r0, r7]
    adds r0, r1, #0x8
                 ^

This also allows the target-specific assembly parser to apply its own
heuristics to suppress some errors. For example, the error "instruction
requires: arm-mode" is never going to be useful when targeting an
M-profile architecture (which does not have ARM mode).

This patch just adds the target-independent mechanism for doing this,
all targets still use the old mechanism. I've added a bit in the
AsmParser tablegen class to allow targets to switch to this new
mechanism. To use this, the target-specific assembly parser will have to
be modified for the change in signature of MatchInstructionImpl, and to
report errors based on the list of near-misses.

Differential revision: https://reviews.llvm.org/D27620

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

6 years agoISel type legalization: add debug messages. NFCI.
Sjoerd Meijer [Tue, 3 Oct 2017 08:54:15 +0000 (08:54 +0000)]
ISel type legalization: add debug messages. NFCI.

This adds some more debug messages to the type legalizer and functions
like PromoteNode, ExpandNode, ExpandLibCall in an attempt to make
the debug messages a little bit more informative and useful.

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

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

6 years ago[llvm-readobj][RISCV] Pretty-print RISCV e_flags
Alex Bradbury [Tue, 3 Oct 2017 08:41:59 +0000 (08:41 +0000)]
[llvm-readobj][RISCV] Pretty-print RISCV e_flags

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

6 years ago[RISCV] Add missed test case for r314770
Alex Bradbury [Tue, 3 Oct 2017 08:03:14 +0000 (08:03 +0000)]
[RISCV] Add missed test case for r314770

Differential Revision: https://reviews.llvm.org/D38311
Patch by https://reviews.llvm.org/D38311

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

6 years ago[RISCV] Parse RISC-V eflags in ObjectYAML
Alex Bradbury [Tue, 3 Oct 2017 08:00:47 +0000 (08:00 +0000)]
[RISCV] Parse RISC-V eflags in ObjectYAML

Differential Revision: https://reviews.llvm.org/D38311
Patch by Chih-Mao Chen.

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

6 years ago[trivial] fix format, NFC
Hiroshi Inoue [Tue, 3 Oct 2017 07:28:58 +0000 (07:28 +0000)]
[trivial] fix format, NFC

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

6 years ago[ObjectYAML] Handle SHF_COMPRESSED
Shoaib Meenai [Tue, 3 Oct 2017 06:35:55 +0000 (06:35 +0000)]
[ObjectYAML] Handle SHF_COMPRESSED

This was previously being silently dropped by obj2yaml and caused
parsing errors with yaml2obj.

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

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

6 years ago[X86] Provide the LSDA pointer with RIP relative addressing if necessary
Martin Storsjo [Tue, 3 Oct 2017 06:29:58 +0000 (06:29 +0000)]
[X86] Provide the LSDA pointer with RIP relative addressing if necessary

This makes sure the LSDA pointer isn't truncated to 32 bit.

Make LowerINTRINSIC_WO_CHAIN a member function instead of a static
function, so that it can use the getGlobalWrapperKind method.

This solves the second half of the issues mentioned in PR34720.

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

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

6 years ago[Lint] Avoid failed assertion by fetching the proper pointer type
Mikael Holmen [Tue, 3 Oct 2017 06:03:49 +0000 (06:03 +0000)]
[Lint] Avoid failed assertion by fetching the proper pointer type

Summary:
When checking if a constant expression is a noop cast we fetched the
IntPtrType by doing DL->getIntPtrType(V->getType())). However, there can
be cases where V doesn't return a pointer, and then getIntPtrType()
triggers an assertion.

Now we pass DataLayout to isNoopCast so the method itself can determine
what the IntPtrType is.

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: wdng, llvm-commits

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

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

6 years ago[InstCombine] Change a bunch of methods to take APInts by reference instead of pointer.
Craig Topper [Tue, 3 Oct 2017 05:31:07 +0000 (05:31 +0000)]
[InstCombine] Change a bunch of methods to take APInts by reference instead of pointer.

This allows us to remove a bunch of dereferences and only have a few dereferences at the call sites.

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

6 years ago[InstCombine] Replace an equality compare of two APInt pointers with a compare of...
Craig Topper [Tue, 3 Oct 2017 04:55:04 +0000 (04:55 +0000)]
[InstCombine] Replace an equality compare of two APInt pointers with a compare of the APInts themselves.

Apparently this works by virtue of the fact that the pointers are pointers to the APInts stored inside of the ConstantInt objects. But I really don't think we should be relying on that.

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

6 years ago[Legalizer] Add support for G_OR NarrowScalar.
Quentin Colombet [Tue, 3 Oct 2017 04:53:56 +0000 (04:53 +0000)]
[Legalizer] Add support for G_OR NarrowScalar.

Legalize bitwise OR:
 A = BinOp<Ty> B, C
into:
 B1, ..., BN = G_UNMERGE_VALUES B
 C1, ..., CN = G_UNMERGE_VALUES C
 A1 = BinOp<Ty/N> B1, C2
 ...
 AN = BinOp<Ty/N> BN, CN
 A = G_MERGE_VALUES A1, ..., AN

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

6 years ago[X86] Add AVX512 check lines to the cost model truncate test.
Craig Topper [Tue, 3 Oct 2017 03:47:34 +0000 (03:47 +0000)]
[X86] Add AVX512 check lines to the cost model truncate test.

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

6 years agoRewrite a function so that it doesn't use pointers to pointers. NFC.
Rui Ueyama [Tue, 3 Oct 2017 03:09:05 +0000 (03:09 +0000)]
Rewrite a function so that it doesn't use pointers to pointers. NFC.

Previous code was a bit puzzling because of its use of pointers.
In this patch, we pass a vector and its offsets, instead of pointers to
vector elements.

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

6 years agoLTO: Improve error reporting when adding a cache entry.
Peter Collingbourne [Tue, 3 Oct 2017 00:44:21 +0000 (00:44 +0000)]
LTO: Improve error reporting when adding a cache entry.

Move error handling code next to the code that returns the error,
and change the error message in order to distinguish it from a similar
error message elsewhere in this file.

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

6 years agoSparseSolver: Rename getOrInitValueState to getValueState, matching what SCCP calls it
Daniel Berlin [Tue, 3 Oct 2017 00:26:21 +0000 (00:26 +0000)]
SparseSolver: Rename getOrInitValueState to getValueState, matching what SCCP calls it

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

6 years agoAMDGPU: Remove global isGCN predicates
Matt Arsenault [Tue, 3 Oct 2017 00:06:41 +0000 (00:06 +0000)]
AMDGPU: Remove global isGCN predicates

These are problematic because they apply to everything,
and can easily clobber whatever more specific predicate
you are trying to add to a function.

Currently instructions use SubtargetPredicate/PredicateControl
to apply this to patterns applied to an instruction definition,
but not to free standing Pats. Add a wrapper around Pat
so the special PredicateControls requirements can be appended
to the final predicate list like how Mips does it.

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

6 years ago[InstSimplify] teach SimplifySelectInst() to fold more vector selects
Haicheng Wu [Mon, 2 Oct 2017 23:43:52 +0000 (23:43 +0000)]
[InstSimplify] teach SimplifySelectInst() to fold more vector selects

Call ConstantFoldSelectInstruction() to fold cases like below

select <2 x i1><i1 true, i1 false>, <2 x i8> <i8 0, i8 1>, <2 x i8> <i8 2, i8 3>

All operands are constants and the condition has mixed true and false conditions.

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

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

6 years ago[PassManager] Retire cl::opt that have been set for a while. NFCI.
Davide Italiano [Mon, 2 Oct 2017 23:39:20 +0000 (23:39 +0000)]
[PassManager] Retire cl::opt that have been set for a while. NFCI.

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

6 years ago[PowerPC] Revert r314666.
Tim Shen [Mon, 2 Oct 2017 23:20:06 +0000 (23:20 +0000)]
[PowerPC] Revert r314666.

See https://reviews.llvm.org/D38172.

I tried to XFAIL it, but sometimes XPASS triggers the bot. Simply
revert it.

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

6 years agoTemplate the sparse propagation solver instead of using void pointers
Daniel Berlin [Mon, 2 Oct 2017 22:49:49 +0000 (22:49 +0000)]
Template the sparse propagation solver instead of using void pointers

Summary:
This avoids using void * as the type of the lattice value and ugly casts needed to make that happen.
(If folks want to use references, etc, they can use a reference_wrapper).

Reviewers: davide, mssimpso

Subscribers: sanjoy, llvm-commits

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

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

6 years ago[PowerPC] Temporarily disable the test introduced by r314666
Tim Shen [Mon, 2 Oct 2017 22:40:32 +0000 (22:40 +0000)]
[PowerPC] Temporarily disable the test introduced by r314666

See https://reviews.llvm.org/D38172 for details.

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

6 years agoRe-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
Geoff Berry [Mon, 2 Oct 2017 22:01:37 +0000 (22:01 +0000)]
Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"

Issues addressed since original review:
- Avoid bug in regalloc greedy/machine verifier when forwarding to use
  in an instruction that re-defines the same virtual register.
- Fixed bug when forwarding to use in EarlyClobber instruction slot.
- Fixed incorrect forwarding to register definitions that showed up in
  explicit_uses() iterator (e.g. in INLINEASM).
- Moved removal of dead instructions found by
  LiveIntervals::shrinkToUses() outside of loop iterating over
  instructions to avoid instructions being deleted while pointed to by
  iterator.
- Fixed ARMLoadStoreOptimizer bug exposed by this change in r311907.
- The pass no longer forwards COPYs to physical register uses, since
  doing so can break code that implicitly relies on the physical
  register number of the use.
- The pass no longer forwards COPYs to undef uses, since doing so
  can break the machine verifier by creating LiveRanges that don't
  end on a use (since the undef operand is not considered a use).

  [MachineCopyPropagation] Extend pass to do COPY source forwarding

  This change extends MachineCopyPropagation to do COPY source forwarding.

  This change also extends the MachineCopyPropagation pass to be able to
  be run during register allocation, after physical registers have been
  assigned, but before the virtual registers have been re-written, which
  allows it to remove virtual register COPY LiveIntervals that become dead
  through the forwarding of all of their uses.

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

6 years agoRemove trailing whitespace to trigger re-cmaking
Michael Liao [Mon, 2 Oct 2017 21:54:38 +0000 (21:54 +0000)]
Remove trailing whitespace to trigger re-cmaking

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

6 years ago[X86] Run dos2unix on two disassembler tests.
Craig Topper [Mon, 2 Oct 2017 21:46:58 +0000 (21:46 +0000)]
[X86] Run dos2unix on two disassembler tests.

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

6 years ago[X86][NFC] Add X86CmovConverterPass to the pass registry.
Amjad Aboud [Mon, 2 Oct 2017 21:46:37 +0000 (21:46 +0000)]
[X86][NFC] Add X86CmovConverterPass to the pass registry.

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

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

6 years agollvm-dwarfdump: support the --ignore-case option.
Adrian Prantl [Mon, 2 Oct 2017 21:21:09 +0000 (21:21 +0000)]
llvm-dwarfdump: support the --ignore-case option.

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

6 years agoRemove dead file.
Michael Liao [Mon, 2 Oct 2017 21:00:52 +0000 (21:00 +0000)]
Remove dead file.

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

6 years agoAdd ELFOSABI_FIRST_ARCH, ELFOSABI_LAST_ARCH and start using those in llvm-readobj
Konstantin Zhuravlyov [Mon, 2 Oct 2017 20:49:58 +0000 (20:49 +0000)]
Add ELFOSABI_FIRST_ARCH, ELFOSABI_LAST_ARCH and start using those in llvm-readobj

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

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

6 years agoAMDGPU: Fix typos
Matt Arsenault [Mon, 2 Oct 2017 20:31:18 +0000 (20:31 +0000)]
AMDGPU: Fix typos

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

6 years agoAMDGPU: Fix potentially incorrectly matching check lines
Matt Arsenault [Mon, 2 Oct 2017 20:31:16 +0000 (20:31 +0000)]
AMDGPU: Fix potentially incorrectly matching check lines

These check lines are supposed to make sure the new d16
load instructions aren't used, but the expected instruction
name is a prefix of the incorrect instruction name.

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

6 years ago[InstCombine] auto-generate complete checks; NFC
Sanjay Patel [Mon, 2 Oct 2017 20:16:59 +0000 (20:16 +0000)]
[InstCombine] auto-generate complete checks; NFC

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

6 years ago[InstCombine] add icmp (shr X, Y), 0 test; NFC
Sanjay Patel [Mon, 2 Oct 2017 20:07:15 +0000 (20:07 +0000)]
[InstCombine] add icmp (shr X, Y), 0 test; NFC

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

6 years agoFix two header comments. NFC.
Hans Wennborg [Mon, 2 Oct 2017 19:48:28 +0000 (19:48 +0000)]
Fix two header comments. NFC.

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

6 years agoAdd support for Myriad ma2x8x series of CPUs
Walter Lee [Mon, 2 Oct 2017 18:50:48 +0000 (18:50 +0000)]
Add support for Myriad ma2x8x series of CPUs

Summary: Also add support for some older Myriad CPUs that were missing.

Reviewers: jyknight

Subscribers: fedor.sergeev

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

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

6 years agoMove the stripping of invalid debug info from the Verifier to AutoUpgrade.
Adrian Prantl [Mon, 2 Oct 2017 18:31:29 +0000 (18:31 +0000)]
Move the stripping of invalid debug info from the Verifier to AutoUpgrade.

This came out of a recent discussion on llvm-dev
(https://reviews.llvm.org/D38042). Currently the Verifier will strip
the debug info metadata from a module if it finds the dbeug info to be
malformed. This feature is very valuable since it allows us to improve
the Verifier by making it stricter without breaking bcompatibility,
but arguable the Verifier pass should not be modifying the IR. This
patch moves the stripping of broken debug info into AutoUpgrade
(UpgradeDebugInfo to be precise), which is a much better location for
this since the stripping of malformed (i.e., produced by older, buggy
versions of Clang) is a (harsh) form of AutoUpgrade.

This change is mostly NFC in nature, the one big difference is the
behavior when LLVM module passes are introducing malformed debug
info. Prior to this patch, a NoAsserts build would have printed a
warning and stripped the debug info, after this patch the Verifier
will report a fatal error. I believe this behavior is actually more
desirable anyway.

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

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

6 years ago[InstCombine] remove one-use restriction for icmp (shr exact X, C1), C2 --> icmp...
Sanjay Patel [Mon, 2 Oct 2017 18:26:44 +0000 (18:26 +0000)]
[InstCombine] remove one-use restriction for icmp (shr exact X, C1), C2 --> icmp X, (C2<<C1)

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

6 years ago[InstCombine] add icmp (lshr X, C1), C2 test; NFC
Sanjay Patel [Mon, 2 Oct 2017 18:16:17 +0000 (18:16 +0000)]
[InstCombine] add icmp (lshr X, C1), C2 test; NFC

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

6 years agoUpdate getMergedLocation to check the instruction type and merge properly.
Dehao Chen [Mon, 2 Oct 2017 18:13:14 +0000 (18:13 +0000)]
Update getMergedLocation to check the instruction type and merge properly.

Summary: If the merged instruction is call instruction, we need to set the scope to the closes common scope between 2 locations, otherwise it will cause trouble when the call is getting inlined.

Reviewers: dblaikie, aprantl

Reviewed By: dblaikie, aprantl

Subscribers: llvm-commits, sanjoy

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

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

6 years agoCodeView symbol dumper: use symbolic names for registers
Hans Wennborg [Mon, 2 Oct 2017 17:44:47 +0000 (17:44 +0000)]
CodeView symbol dumper: use symbolic names for registers

https://reviews.llvm.org/D38469

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

6 years agoEliminate ftrunc if source is know to be rounded
Stanislav Mekhanoshin [Mon, 2 Oct 2017 16:57:07 +0000 (16:57 +0000)]
Eliminate ftrunc if source is know to be rounded

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

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

6 years ago[dwarfdump] Add -show-form
Jonas Devlieghere [Mon, 2 Oct 2017 16:02:04 +0000 (16:02 +0000)]
[dwarfdump] Add -show-form

This enables printing of DWARF form types after the DWARF attribute
types.

Differential revision: https://reviews.llvm.org/D38459

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

6 years ago[X86][SSE] Add PACKSS/PACKUS constant folding tests
Simon Pilgrim [Mon, 2 Oct 2017 15:43:26 +0000 (15:43 +0000)]
[X86][SSE] Add PACKSS/PACKUS constant folding tests

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

6 years agoRegenerate test (missing broadcast constant comments). NFCI.
Simon Pilgrim [Mon, 2 Oct 2017 15:22:35 +0000 (15:22 +0000)]
Regenerate test (missing broadcast constant comments). NFCI.

Still avoiding the floating point comments to prevent linux/windows discrepancies.

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

6 years agoRegenerate test (missing broadcast constant comments). NFCI.
Simon Pilgrim [Mon, 2 Oct 2017 15:21:14 +0000 (15:21 +0000)]
Regenerate test (missing broadcast constant comments). NFCI.

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

6 years agoRegenerate test. NFCI.
Simon Pilgrim [Mon, 2 Oct 2017 15:16:30 +0000 (15:16 +0000)]
Regenerate test. NFCI.

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

6 years agouse range-for-loops; NFCI
Sanjay Patel [Mon, 2 Oct 2017 15:02:06 +0000 (15:02 +0000)]
use range-for-loops; NFCI

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

6 years ago[AsmParser] Support GAS's .print directive
Coby Tayree [Mon, 2 Oct 2017 14:36:31 +0000 (14:36 +0000)]
[AsmParser] Support GAS's .print directive

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

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

6 years agoremove duplicate comments, reposition related functions; NFC
Sanjay Patel [Mon, 2 Oct 2017 14:03:17 +0000 (14:03 +0000)]
remove duplicate comments, reposition related functions; NFC

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

6 years ago[X86][SSE] Fix -Wsign-compare problems introduced in r314658
Bjorn Pettersson [Mon, 2 Oct 2017 12:46:38 +0000 (12:46 +0000)]
[X86][SSE] Fix -Wsign-compare problems introduced in r314658

The refactoring in
"[X86][SSE] Add createPackShuffleMask helper function. NFCI."
resulted in warning when compiling the code (seen in build bots).

This patch restores some types from int to unsigned to avoid
those warnings.

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

6 years ago[Debug info] Handle endianness when moving debug info for split integer values
Bjorn Pettersson [Mon, 2 Oct 2017 12:46:32 +0000 (12:46 +0000)]
[Debug info] Handle endianness when moving debug info for split integer values

Summary:
Take the target's endianness into account when splitting the
debug information in DAGTypeLegalizer::SetExpandedInteger.

This patch fixes so that, for big-endian targets, the fragment
expression corresponding to the high part of a split integer
value is placed at offset 0, in order to correctly represent
the memory address order.

I have attached a PPC32 reproducer where the resulting DWARF
pieces for a 64-bit integer were incorrectly reversed.

Patch by: dstenb

Reviewers: JDevlieghere, aprantl, dblaikie

Reviewed By: JDevlieghere, aprantl, dblaikie

Subscribers: nemanjai

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

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

6 years ago[X86][SSE] Add createPackShuffleMask helper function. NFCI.
Simon Pilgrim [Mon, 2 Oct 2017 10:12:51 +0000 (10:12 +0000)]
[X86][SSE] Add createPackShuffleMask helper function. NFCI.

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

6 years ago[X86][SSE] matchBinaryVectorShuffle - add support for different src/dst value shuffle...
Simon Pilgrim [Mon, 2 Oct 2017 09:45:08 +0000 (09:45 +0000)]
[X86][SSE] matchBinaryVectorShuffle - add support for different src/dst value shuffle types

Preparation for support for combining to PACKSS/PACKUS

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

6 years ago[PowerPC] support ZERO_EXTEND in tryBitPermutation
Hiroshi Inoue [Mon, 2 Oct 2017 09:24:00 +0000 (09:24 +0000)]
[PowerPC] support ZERO_EXTEND in tryBitPermutation

This patch add a support of ISD::ZERO_EXTEND in PPCDAGToDAGISel::tryBitPermutation to increase the opportunity to use rotate-and-mask by reordering ZEXT and ANDI.
Since tryBitPermutation stops analyzing nodes if it hits a ZEXT node while traversing SDNodes, we want to avoid ZEXT between two nodes that can be folded into a rotate-and-mask instruction.

For example, we allow these nodes

      t9: i32 = add t7, Constant:i32<1>
    t11: i32 = and t9, Constant:i32<255>
  t12: i64 = zero_extend t11
t14: i64 = shl t12, Constant:i64<2>

to be folded into a rotate-and-mask instruction.
Such case often happens in array accesses with logical AND operation in the index, e.g. array[i & 0xFF];

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

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

6 years agoFix typo in comment. NFCI.
Simon Pilgrim [Mon, 2 Oct 2017 09:10:50 +0000 (09:10 +0000)]
Fix typo in comment. NFCI.

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

6 years ago[X86] Cleanup uses of computeKnownBits by using MaskedValueIsZero helper instead...
Simon Pilgrim [Mon, 2 Oct 2017 09:08:45 +0000 (09:08 +0000)]
[X86] Cleanup uses of computeKnownBits by using MaskedValueIsZero helper instead. NFCI.

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

6 years ago[X86][LLVM]Expanding Supports lowerInterleaved{store|load}() in X86InterleavedAccess...
Michael Zuckerman [Mon, 2 Oct 2017 07:35:25 +0000 (07:35 +0000)]
[X86][LLVM]Expanding Supports lowerInterleaved{store|load}() in X86InterleavedAccess (VF64 stride 3-4)
I continue to support different VF interleaved and in this pass for this patch,
I added the vf64 stride3 support for both load and store.
I also added support fot the stride4 store.

Reviewers:
1. zvi
2. dorit
3. igorb
4. guyblank

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

Change-Id: I3d238efedf217d1768b348d710de1efa2f19d27b

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

6 years ago[X86] Fix copy pasto in X86FastISel::fastEmitInst_rrrr.
Craig Topper [Mon, 2 Oct 2017 05:46:53 +0000 (05:46 +0000)]
[X86] Fix copy pasto in X86FastISel::fastEmitInst_rrrr.

The 4th operand was not being constrained and the third operand was being constrained twice.

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

6 years ago[X86] Use a bool flag instead of assigning an unsigned to two different values that...
Craig Topper [Mon, 2 Oct 2017 05:46:52 +0000 (05:46 +0000)]
[X86] Use a bool flag instead of assigning an unsigned to two different values that we only use in an equality comparison.

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

6 years ago[X86] Use _NOREX MOVZX instructions for some patterns even in 32-bit mode.
Craig Topper [Mon, 2 Oct 2017 00:44:50 +0000 (00:44 +0000)]
[X86] Use _NOREX MOVZX instructions for some patterns even in 32-bit mode.

This unifies the patterns between both modes. This should be effectively NFC since all the available registers in 32-bit mode statisfy this constraint.

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

6 years ago[Hexagon] Check vector elements for equivalence in the HexagonVectorLoopCarriedReuse...
Ron Lieberman [Mon, 2 Oct 2017 00:34:07 +0000 (00:34 +0000)]
[Hexagon] Check vector elements for equivalence in the HexagonVectorLoopCarriedReuse pass

    If the two instructions being compared for equivalence have corresponding operands
    that are integer constants, then check their values to determine equivalence.

    Patch by Suyog Sarda!

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

6 years ago[Hexagon] Patch to Extract i1 element from vector of i1
Ron Lieberman [Mon, 2 Oct 2017 00:16:15 +0000 (00:16 +0000)]
[Hexagon] Patch to Extract i1 element from vector of i1

This patch extracts 1 element from vector consisting
of elements of size 1 bit at given index.

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

6 years ago[InstCombine] Use APInt for all the math in foldICmpDivConstant
Craig Topper [Sun, 1 Oct 2017 23:53:54 +0000 (23:53 +0000)]
[InstCombine] Use APInt for all the math in foldICmpDivConstant

Summary: This currently uses ConstantExpr to do its math, but as noted in a TODO it can all be done directly on APInt.

Reviewers: spatel, majnemer

Reviewed By: majnemer

Subscribers: llvm-commits

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

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

6 years ago[X86] Change register&memory TEST instructions from MRMSrcMem to MRMDstMem
Craig Topper [Sun, 1 Oct 2017 23:53:53 +0000 (23:53 +0000)]
[X86] Change register&memory TEST instructions from MRMSrcMem to MRMDstMem

Summary:
Intel documentation shows the memory operand as the first operand. But we currently treat it as the second operand. Conceptually the order doesn't matter since it doesn't write memory. We have aliases to parse with the operands in either order and the isel matching is commutable.

For the register&register form order does matter for the assembly parser. PR22995 was previously filed and fixed by changing the register&register form from MRMSrcReg to MRMDestReg to match gas. Ideally the memory form should match by using MRMDestMem.

I believe this supercedes D38025 which was trying to switch the register&register form back to pre-PR22995.

Reviewers: aymanmus, RKSimon, zvi

Reviewed By: aymanmus

Subscribers: llvm-commits

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

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