OSDN Git Service

android-x86/external-llvm.git
6 years ago[Hexagon] Remove 'T' from HasVNN predicates, NFC
Krzysztof Parzyszek [Wed, 20 Jun 2018 13:56:09 +0000 (13:56 +0000)]
[Hexagon] Remove 'T' from HasVNN predicates, NFC

Patch by Sumanth Gundapaneni.

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

6 years ago[mips] Fix the predicates of some DSP instructions from AdditionalPredicates to ASEPr...
Simon Dardis [Wed, 20 Jun 2018 13:29:57 +0000 (13:29 +0000)]
[mips] Fix the predicates of some DSP instructions from AdditionalPredicates to ASEPredicate

Reviewers: atanasyan, abeserminji, smaksimovic

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

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

6 years ago[InstCombine] ignore debuginfo when removing redundant assumes (PR37726)
Sanjay Patel [Wed, 20 Jun 2018 13:22:26 +0000 (13:22 +0000)]
[InstCombine] ignore debuginfo when removing redundant assumes (PR37726)

This is similar to:
rL335083

Fixes::
https://bugs.llvm.org/show_bug.cgi?id=37726

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

6 years ago[RISCV] Add InstAlias definitions for sgt and sgtu
Alex Bradbury [Wed, 20 Jun 2018 12:54:02 +0000 (12:54 +0000)]
[RISCV] Add InstAlias definitions for sgt and sgtu

These are produced by GCC and supported by GAS, but not currently contained in
the pseudoinstruction listing in the RISC-V ISA manual.

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

6 years agoARM: convert ORR instructions to ADD where possible on Thumb.
Tim Northover [Wed, 20 Jun 2018 12:09:44 +0000 (12:09 +0000)]
ARM: convert ORR instructions to ADD where possible on Thumb.

Thumb has more 16-bit encoding space dedicated to ADD than ORR, allowing both a
3-address encoding and a wider range of immediates. So, particularly when
optimizing for code size (but it doesn't make things worse elsewhere) it's
beneficial to select an OR operation to an ADD if we know overflow won't occur.

This is made even better by LLVM's penchant for putting operations in canonical
form by converting the other way.

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

6 years ago[AArch64] Implement FLT_ROUNDS macro.
Tim Northover [Wed, 20 Jun 2018 12:09:01 +0000 (12:09 +0000)]
[AArch64] Implement FLT_ROUNDS macro.

Very similar to ARM implementation, just maps to an MRS.

Should fix PR25191.

Patch by Michael Brase.

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

6 years ago[llvm-exegesis] Add mechanism to add target-specific passes.
Clement Courbet [Wed, 20 Jun 2018 11:54:35 +0000 (11:54 +0000)]
[llvm-exegesis] Add mechanism to add target-specific passes.

Summary:
createX86FloatingPointStackifierPass is disabled until we handle
TracksLiveness correctly.

Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

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

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

6 years ago[llvm-exegesis] Fix failing test.
Guillaume Chatelet [Wed, 20 Jun 2018 11:09:36 +0000 (11:09 +0000)]
[llvm-exegesis] Fix failing test.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

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

6 years ago[llvm-mca][X86] Teach how to identify register writes that implicitly clear the upper...
Andrea Di Biagio [Wed, 20 Jun 2018 10:08:11 +0000 (10:08 +0000)]
[llvm-mca][X86] Teach how to identify register writes that implicitly clear the upper portion of a super-register.

This patch teaches llvm-mca how to identify register writes that implicitly zero
the upper portion of a super-register.

On X86-64, a general purpose register is implemented in hardware as a 64-bit
register. Quoting the Intel 64 Software Developer's Manual: "an update to the
lower 32 bits of a 64 bit integer register is architecturally defined to zero
extend the upper 32 bits".  Also, a write to an XMM register performed by an AVX
instruction implicitly zeroes the upper 128 bits of the aliasing YMM register.

This patch adds a new method named clearsSuperRegisters to the MCInstrAnalysis
interface to help identify instructions that implicitly clear the upper portion
of a super-register.  The rest of the patch teaches llvm-mca how to use that new
method to obtain the information, and update the register dependencies
accordingly.

I compared the kernels from tests clear-super-register-1.s and
clear-super-register-2.s against the output from perf on btver2.  Previously
there was a large discrepancy between the estimated IPC and the measured IPC.
Now the differences are mostly in the noise.

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

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

6 years ago[SLPVectorizer] Split Tree/Reduction cost calls to simplify debugging. NFCI.
Simon Pilgrim [Wed, 20 Jun 2018 09:39:01 +0000 (09:39 +0000)]
[SLPVectorizer] Split Tree/Reduction cost calls to simplify debugging. NFCI.

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

6 years ago[llvm-exegesis] Remove noexcept in r335105.
Clement Courbet [Wed, 20 Jun 2018 09:18:37 +0000 (09:18 +0000)]
[llvm-exegesis] Remove noexcept in r335105.

gcc checks for transitivity (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53903)

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

6 years ago[llvm-exegesis] Fix missing move in r335105.
Clement Courbet [Wed, 20 Jun 2018 09:18:32 +0000 (09:18 +0000)]
[llvm-exegesis] Fix missing move in r335105.

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

6 years ago[Support] Add missing includes of <system_error> for std::error_code
Martin Storsjo [Wed, 20 Jun 2018 09:17:19 +0000 (09:17 +0000)]
[Support] Add missing includes of <system_error> for std::error_code

This fixes compilation with MinGW after SVN r333798, which added
a few functions within _WIN32 ifdefs, functions returning
std::error_code. Include everything that is needed instead of
hoping that this header being inclued transitively (which it apparently
is in MSVC builds).

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

6 years ago[llvm-exegesis] Use a Prototype to defer picking a value for free vars.
Guillaume Chatelet [Wed, 20 Jun 2018 08:52:30 +0000 (08:52 +0000)]
[llvm-exegesis] Use a Prototype to defer picking a value for free vars.

Summary: Introducing a Prototype object to capture Variables that must be set but keeps degrees of freedom as Invalid. This allows exploring non constraint variables later on.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

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

6 years ago[NFC][SCEV] Add tests related to bit masking (PR37793)
Roman Lebedev [Wed, 20 Jun 2018 07:54:11 +0000 (07:54 +0000)]
[NFC][SCEV] Add tests related to bit masking (PR37793)

Summary:
Related to https://bugs.llvm.org/show_bug.cgi?id=37793, https://reviews.llvm.org/D46760#1127287

We'd like to do this canonicalization https://rise4fun.com/Alive/Gmc
But it is currently restricted by rL155136 / rL155362, which says:
```
    // This is a constant shift of a constant shift. Be careful about hiding
    // shl instructions behind bit masks. They are used to represent multiplies
    // by a constant, and it is important that simple arithmetic expressions
    // are still recognizable by scalar evolution.
    //
    // The transforms applied to shl are very similar to the transforms applied
    // to mul by constant. We can be more aggressive about optimizing right
    // shifts.
    //
    // Combinations of right and left shifts will still be optimized in
    // DAGCombine where scalar evolution no longer applies.
```

I think these tests show that for *constants*, SCEV has no issues with that canonicalization.

Reviewers: mkazantsev, spatel, efriedma, sanjoy

Reviewed By: mkazantsev

Subscribers: sanjoy, javed.absar, llvm-commits, stoklund, bixia

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

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

6 years ago[PatternMatch] Add m_Store pattern match helper
Sjoerd Meijer [Wed, 20 Jun 2018 07:27:45 +0000 (07:27 +0000)]
[PatternMatch] Add m_Store pattern match helper

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

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

6 years ago[X86][Znver1] Specify Register Files, RCU; FP scheduler capacity.
Roman Lebedev [Wed, 20 Jun 2018 07:01:14 +0000 (07:01 +0000)]
[X86][Znver1] Specify Register Files, RCU; FP scheduler capacity.

Summary:
First off: i do not have any access to that processor,
so this is purely theoretical, no benchmarks.

I have been looking into b**d**ver2 scheduling profile, and while cross-referencing
the existing b**t**ver2, znver1 profiles, and the reference docs
(`Software Optimization Guide for AMD Family {15,16,17}h Processors`),
i have noticed that only b**t**ver2 scheduling profile specifies these.

Also, there is no mca test coverage.

Reviewers: RKSimon, craig.topper, courbet, GGanesh, andreadb

Reviewed By: GGanesh

Subscribers: gbedwell, vprasad, ddibyend, shivaram, Ashutosh, javed.absar, llvm-commits

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

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

6 years ago[X86] Fix r335097
Clement Courbet [Wed, 20 Jun 2018 06:44:13 +0000 (06:44 +0000)]
[X86] Fix r335097

Missed `Generic` test in llvm-mca.

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

6 years ago[X86] Add sched class WriteLAHFSAHF and fix values.
Clement Courbet [Wed, 20 Jun 2018 06:13:39 +0000 (06:13 +0000)]
[X86] Add sched class WriteLAHFSAHF and fix values.

Summary:
I ran llvm-exegesis on SKX, SKL, BDW, HSW, SNB.
Atom is from Agner and SLM is a guess.
I've left AMD processors alone.

Reviewers: RKSimon, craig.topper

Subscribers: llvm-commits

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

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

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Wed, 20 Jun 2018 05:29:26 +0000 (05:29 +0000)]
[NFC] fix trivial typos in comments

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

6 years ago[DAGCombiner] Add some comments to some true/false arguments to make it obvious what...
Craig Topper [Wed, 20 Jun 2018 04:32:07 +0000 (04:32 +0000)]
[DAGCombiner] Add some comments to some true/false arguments to make it obvious what they are. NFC

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

6 years ago[X86] Remove a fptosi from the test_mm512_mask_reduce_max_pd fast-isel test.
Craig Topper [Wed, 20 Jun 2018 04:32:06 +0000 (04:32 +0000)]
[X86] Remove a fptosi from the test_mm512_mask_reduce_max_pd fast-isel test.

The clang test inadvertently turned a floating point value into a double by having the wrong return type on the test function relative to the intrinsic it was testing.

This resulted in an extra fptosi instruction that propagated into this test when I copied the clang output.

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

6 years ago[SelectionDAG] Don't crash on inline assembly errors when the inline assembly return...
Craig Topper [Wed, 20 Jun 2018 04:32:05 +0000 (04:32 +0000)]
[SelectionDAG] Don't crash on inline assembly errors when the inline assembly return type is a struct.

Summary:
If we get an error building the SelectionDAG for inline assembly we try to continue and still build the DAG.

But if the return type for the inline assembly is a struct we end up crashing because we try to create an UNDEF node with a struct type which isn't valid.

Instead we need to create an UNDEF for each element of the struct and join them with merge_values.

This patch relies on single operand merge_values being handled gracefully by getMergeValues. If the return type is void there will be no VTs returned by ComputeValueVTs and now we just return instead of calling setValue. Hopefully that's ok, I assumed nothing would need to look up the mapped value for void node.

Fixes PR37359

Reviewers: rengolin, rovka, echristo, efriedma, bogner

Reviewed By: efriedma

Subscribers: craig.topper, llvm-commits

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

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

6 years ago[X86] Use binary search of the EVEX->VEX static tables instead of populating two...
Craig Topper [Wed, 20 Jun 2018 04:32:04 +0000 (04:32 +0000)]
[X86] Use binary search of the EVEX->VEX static tables instead of populating two DenseMaps for lookups

Summary:
After r335018, the static tables are guaranteed sorted by the EVEX opcode to convert. We can use this to do a binary search and remove the need for any secondary data structures.

Right now one table is 736 entries and the other is 482 entries. It might make sense to merge the two tables as a follow up. The effort it takes to select the table is probably similar to the extra binary search step it would require for a larger table.

I haven't done any measurements to see if this has any effect on compile time, but I don't imagine that EVEX->VEX conversion is a place we spend a lot of time.

Reviewers: RKSimon, spatel, chandlerc

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years agoAdd more test cases for deopt-operands via regalloc
Philip Reames [Wed, 20 Jun 2018 02:43:46 +0000 (02:43 +0000)]
Add more test cases for deopt-operands via regalloc

This time, focused on reuse of arguments slots.  Only one minor todo here.

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

6 years agoRevert r334980 and 334983
Vlad Tsyrklevich [Wed, 20 Jun 2018 00:02:32 +0000 (00:02 +0000)]
Revert r334980 and 334983

This reverts commits r334980 and r334983 because they were causing build
timeouts on the x86_64-linux-ubsan bot.

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

6 years ago[IR] Introduce helpers to skip debug instructions (NFC)
Vedant Kumar [Tue, 19 Jun 2018 23:42:17 +0000 (23:42 +0000)]
[IR] Introduce helpers to skip debug instructions (NFC)

This patch introduces two helpers to make it easier to ignore debug
intrinsics:

- Instruction::getNextNonDebugInstruction()

This is just like Instruction::getNextNode(), except that it skips debug
info.

- skipDebugInfo(BasicBlock::iterator)

A free function which advances a BasicBlock iterator past any debug
info. This is a no-op when the iterator already points to a non-debug
instruction.

Part of: llvm.org/PR37728
Related to: https://reviews.llvm.org/D47874

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

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

6 years ago[llvm] Document "%T" as deprecated in TestingGuide.rst
Kuba Mracek [Tue, 19 Jun 2018 22:22:48 +0000 (22:22 +0000)]
[llvm] Document "%T" as deprecated in TestingGuide.rst

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

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

6 years ago[InlineSpiller] Fix a crash due to lack of forward progress from remat specifically...
Philip Reames [Tue, 19 Jun 2018 21:19:59 +0000 (21:19 +0000)]
[InlineSpiller] Fix a crash due to lack of forward progress from remat specifically for STATEPOINT

This patch covers up a fairly fundemental issue around remat and register allocation which shows up with psuedo instructions with more vreg uses than there are physical registers.  This patch essentially just disables remat for STATEPOINTs which are the only case we've seen so far, but long term we need a better fix.

For STATEPOINTs specifically, this is a strict improvement.  It unblocks progress towards enabling a currently off-by-default mode which integrates deopt bundle operand lowering with register allocator spilling so that we end up with smaller stack sizes and more optimally placed spills.  Assming no other issues turn up during my next round of integration testing - which based on experience so far, is admittedly unlikely - we might finally be able to enable something I've been working towards in small bits and pieces for years now.  :)

For psuedo ops in general, there are a couple of ideas for a "proper fix" discussed on the bug, but I'm far enough outside my knowledge area to not be able to see any of them through to a successful conclusion.  If anyone wants to help out here, please do.

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

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

6 years ago[MachineOutliner] NFC: Remove insertOutlinerPrologue, rename insertOutlinerEpilogue
Jessica Paquette [Tue, 19 Jun 2018 21:14:48 +0000 (21:14 +0000)]
[MachineOutliner] NFC: Remove insertOutlinerPrologue, rename insertOutlinerEpilogue

insertOutlinerPrologue was not used by any target, and prologue-esque code was
beginning to appear in insertOutlinerEpilogue. Refactor that into one function,
buildOutlinedFrame.

This just removes insertOutlinerPrologue and renames insertOutlinerEpilogue.

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

6 years ago[WebAssembly] Fix liveness tracking info after drop insertion
Heejin Ahn [Tue, 19 Jun 2018 20:30:42 +0000 (20:30 +0000)]
[WebAssembly] Fix liveness tracking info after drop insertion

Summary:
This fixes liveness tracking information after `drop` instruction
insertion in ExplicitLocals pass.

When a drop instruction is inserted to drop a dead register operand, the
original operand should be marked not dead anymore because it is now
used by the new drop instruction. And the operand to the new drop
instruction should be marked killed instead. This bug caused some
programs to fail when `llc` is run with `-verify-machineinstrs` option.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

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

6 years ago[X86] Update fast-isel tests for clang's avx512f reduction intrinsics to match the...
Craig Topper [Tue, 19 Jun 2018 19:14:50 +0000 (19:14 +0000)]
[X86] Update fast-isel tests for clang's avx512f reduction intrinsics to match the codegen from r335070.

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

6 years ago[X86] Add fast-isel tests for clang's AVX512F vector reduction intrinsics.
Craig Topper [Tue, 19 Jun 2018 18:52:15 +0000 (18:52 +0000)]
[X86] Add fast-isel tests for clang's AVX512F vector reduction intrinsics.

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

6 years ago[IR] move shuffle mask queries from TTI to ShuffleVectorInst
Sanjay Patel [Tue, 19 Jun 2018 18:44:00 +0000 (18:44 +0000)]
[IR] move shuffle mask queries from TTI to ShuffleVectorInst

The optimizer is getting smarter (eg, D47986) about differentiating shuffles
based on its mask values, so we should make queries on the mask constant
operand generally available to avoid code duplication.

We'll probably use this soon in the vectorizers and instcombine (D48023 and
https://bugs.llvm.org/show_bug.cgi?id=37806).

We might clean up TTI a bit more once all of its current 'SK_*' options are
covered.

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

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

6 years ago[MIRParser] Update a diagnostic message to use the correct register sigil. NFC
Matt Davis [Tue, 19 Jun 2018 18:39:40 +0000 (18:39 +0000)]
[MIRParser] Update a diagnostic message to use the correct register sigil. NFC

Summary:
Patch r323922 changed the sigil for physical registers to '$',  instead of '%'.
An error message was missed during this change, and reports the wrong sigil.
This patch corrects that diagnostic and the tests that check that error string.

Reviewers: zer0, bjope

Reviewed By: bjope

Subscribers: bjope, thegameg, plotfi, llvm-commits

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

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

6 years ago[Hexagon] Fix the value of HexagonII::TypeCVI_FIRST
Krzysztof Parzyszek [Tue, 19 Jun 2018 18:09:54 +0000 (18:09 +0000)]
[Hexagon] Fix the value of HexagonII::TypeCVI_FIRST

This value is the first vector instruction type in numerical order. The
previous value was incorrect, leaving TypeCVI_GATHER outside of the range
for vector instructions. This caused vector .new instructions to be
incorrectly encoded in the presence of gather.

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

6 years ago[X86] Initialize FMA3Info directly in its constructor instead of relying on std:...
Craig Topper [Tue, 19 Jun 2018 18:06:52 +0000 (18:06 +0000)]
[X86] Initialize FMA3Info directly in its constructor instead of relying on std::call_once

FMA3Info only exists as a managed static. As far as I know the ManagedStatic construction proccess is thread safe. It doesn't look like we ever access the ManagedStatic object without immediately doing a query on it that would require the map to be populated. So I don't think we're ever deferring the calculation of the tables from the construction of the object.

So I think we should be able to just populate the FMA3Info map directly in the constructor and get rid of all of the initGroupsOnce stuff.

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

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

6 years ago[X86] Don't fold unaligned loads into SSE ROUNDPS/ROUNDPD for ceil/floor/nearbyint...
Craig Topper [Tue, 19 Jun 2018 17:51:42 +0000 (17:51 +0000)]
[X86] Don't fold unaligned loads into SSE ROUNDPS/ROUNDPD for ceil/floor/nearbyint/rint/trunc.

Incorrect patterns were added in r334460. This changes them to check alignment properly for SSE.

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

6 years ago[Hexagon] Enforce restrictions on packetizing cache instructions
Krzysztof Parzyszek [Tue, 19 Jun 2018 17:26:20 +0000 (17:26 +0000)]
[Hexagon] Enforce restrictions on packetizing cache instructions

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

6 years agodocs: document CodeView directives
Saleem Abdulrasool [Tue, 19 Jun 2018 16:47:31 +0000 (16:47 +0000)]
docs: document CodeView directives

Add documentation for assembler directives added to support CodeView
emission.

Patch by Ellis Hoag!

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

6 years ago[mips] Mark microMIPS64 as being unsupported.
Simon Dardis [Tue, 19 Jun 2018 16:05:44 +0000 (16:05 +0000)]
[mips] Mark microMIPS64 as being unsupported.

There are no provided instruction definitions for this architecture.

Reviewers: smaksimovic, atanasyan, abeserminji

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

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

6 years ago[mips] Fix the predicates of some aliases
Simon Dardis [Tue, 19 Jun 2018 15:25:01 +0000 (15:25 +0000)]
[mips] Fix the predicates of some aliases

Previously, some aliases were marked as not being available for microMIPS32R6,
but this was overridden at the top level.

Reviewers: atanasyan, abeserminji, smaksimovic

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

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

6 years ago[SLPVectorizer] Remove default OperandValueKind arguments from getArithmeticInstrCost...
Simon Pilgrim [Tue, 19 Jun 2018 13:40:00 +0000 (13:40 +0000)]
[SLPVectorizer] Remove default OperandValueKind arguments from getArithmeticInstrCost calls (NFC)

The getArithmeticInstrCost calls for shuffle vectors entry costs specify TargetTransformInfo::OperandValueKind arguments, but are just using the method's default values. This seems to be a copy + paste issue and doesn't affect the costs in anyway. The TargetTransformInfo::OperandValueProperties default arguments are already not being used.

Noticed while working on D47985.

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

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

6 years ago[PowerPC] Fix label address calculation for ppc32
Strahinja Petrovic [Tue, 19 Jun 2018 13:07:40 +0000 (13:07 +0000)]
[PowerPC] Fix label address calculation for ppc32

This patch fixes calculating address of label on ppc32 (for -fPIC).

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

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

6 years agollvm-exegesis: mark ~ExegesisTarget() as virtual. Fixes build.
Roman Lebedev [Tue, 19 Jun 2018 11:58:10 +0000 (11:58 +0000)]
llvm-exegesis: mark ~ExegesisTarget() as virtual. Fixes build.

/build/llvm/tools/llvm-exegesis/lib/X86/../Target.h:32:3: error: 'exegesis::ExegesisTarget' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor]
  ~ExegesisTarget();
  ^
/build/llvm/tools/llvm-exegesis/lib/X86/Target.cpp:15:7: error: 'exegesis::(anonymous namespace)::ExegesisX86Target' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor]
class ExegesisX86Target : public ExegesisTarget {
      ^

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

6 years agoRe-land r335038 "[llvm-exegesis] A mechanism to add target-specific functionality.""
Clement Courbet [Tue, 19 Jun 2018 11:28:59 +0000 (11:28 +0000)]
Re-land r335038 "[llvm-exegesis] A mechanism to add target-specific functionality.""

Fix typo: LLVM_NATIVE_ARCH -> LLVM_EXEGESIS_NATIVE_ARCH.

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

6 years agoRevert r335038 "[llvm-exegesis] A mechanism to add target-specific functionality."
Clement Courbet [Tue, 19 Jun 2018 10:54:12 +0000 (10:54 +0000)]
Revert r335038 "[llvm-exegesis] A mechanism to add target-specific functionality."

Breaks buildbots.

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

6 years ago[InstCombine] Replacing X86-specific rounding intrinsics with generic floor-ceil
Mikhail Dvoretckii [Tue, 19 Jun 2018 10:49:12 +0000 (10:49 +0000)]
[InstCombine] Replacing X86-specific rounding intrinsics with generic floor-ceil

This patch replaces calls to X86-specific intrinsics with floor-ceil semantics
with calls to target-independent @llvm.floor.* and @llvm.ceil.* intrinsics. This
doesn't affect the resulting machine code, as those intrinsics are lowered to
the same instructions, but exposes these specific rounding cases to generic
optimizations.

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

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

6 years ago[llvm-exegesis] A mechanism to add target-specific functionality.
Clement Courbet [Tue, 19 Jun 2018 10:39:50 +0000 (10:39 +0000)]
[llvm-exegesis] A mechanism to add target-specific functionality.

Summary: This is a step towards implementing memory operands and X87.

Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

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

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

6 years ago[X86] VRNDSCALE* folding from masked and scalar ffloor and fceil patterns
Mikhail Dvoretckii [Tue, 19 Jun 2018 10:37:52 +0000 (10:37 +0000)]
[X86] VRNDSCALE* folding from masked and scalar ffloor and fceil patterns

This patch handles back-end folding of generic patterns created by lowering the
X86 rounding intrinsics to native IR in cases where the instruction isn't a
straightforward packed values rounding operation, but a masked operation or a
scalar operation.

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

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

6 years ago[LoopSimplifyCFG] Invalidate SCEV in LoopSimplifyCFG
David Green [Tue, 19 Jun 2018 09:43:36 +0000 (09:43 +0000)]
[LoopSimplifyCFG] Invalidate SCEV in LoopSimplifyCFG

LoopSimplifyCFG, being a loop pass, needs to preserve scalar
evolution. This invalidates SE for the loops altered during
block merging.

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

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

6 years ago[MCA][NFC] Add generic XOP resource tests
Roman Lebedev [Tue, 19 Jun 2018 09:21:27 +0000 (09:21 +0000)]
[MCA][NFC] Add generic XOP resource tests

Summary:
Based on
* [[ https://support.amd.com/TechDocs/43479.pdf | AMD64 Architecture Programmer’s Manual Volume 6: 128-Bit and 256-Bit XOP and FMA4 Instructions ]],
* [[ https://support.amd.com/TechDocs/24594.pdf | AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions]],
* https://en.wikipedia.org/wiki/XOP_instruction_set

Appears to be only supported in AMD's 15h generation, so only in b**d**ver[1-4],
for which currently llvm has no scheduling profiles.

Reviewers: RKSimon, craig.topper, andreadb, spatel

Reviewed By: RKSimon

Subscribers: gbedwell, llvm-commits

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

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

6 years ago[MCA][NFC] Add generic TBM resource tests
Roman Lebedev [Tue, 19 Jun 2018 09:21:22 +0000 (09:21 +0000)]
[MCA][NFC] Add generic TBM resource tests

Summary:
Based on https://support.amd.com/TechDocs/24594.pdf,
https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#TBM_(Trailing_Bit_Manipulation)

Appears to be only supported in AMD's 15h generation, so only in b**d**ver[1-4],
for which currently llvm has no scheduling profiles.

Reviewers: RKSimon, craig.topper, simark, andreadb

Reviewed By: RKSimon

Subscribers: gbedwell, llvm-commits

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

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

6 years ago[SLPVectorizer] Pull out AltOpcode determination from reorderAltShuffleOperands.
Simon Pilgrim [Tue, 19 Jun 2018 09:16:06 +0000 (09:16 +0000)]
[SLPVectorizer] Pull out AltOpcode determination from reorderAltShuffleOperands.

Minor step towards making the alternate opcode system work with a wider range of opcode pairs.

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

6 years agoRemove valueCoversEntireFragment asserts in ConvertDebugDeclareToDebugValue
Bjorn Pettersson [Tue, 19 Jun 2018 08:41:34 +0000 (08:41 +0000)]
Remove valueCoversEntireFragment asserts in ConvertDebugDeclareToDebugValue

This is a fixup for r334830 causing problems in polly-aosp buildbot.

Focus in r334830 was to fix a problem seen with
ConvertDebugDeclareToDebugValue involving store instructions.
It also added some asserts to find out of similar problems
existed for the ConvertDebugDeclareToDebugValue functions
involving load and phi instructions. One of those asserts seems
to blow in the polly-aosp buildbot, so I'll revert the asserts
while debugging.

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

6 years agoAdd a factory method to ConstantDataArray that allows to pass in the data as StringRef
Adrian Kuegel [Tue, 19 Jun 2018 08:12:28 +0000 (08:12 +0000)]
Add a factory method to ConstantDataArray that allows to pass in the data as StringRef

This simplifies the case if we already have access to the raw data that we need to store in a ConstantDataArray.
The new factor method can also be reused for implementing the factory method that gets the data as ArrayRef.

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

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

6 years ago[LoopInterchange] Move PHI handling to adjustLoopBranches.
Florian Hahn [Tue, 19 Jun 2018 08:03:24 +0000 (08:03 +0000)]
[LoopInterchange] Move PHI handling to adjustLoopBranches.

This patch moves the logic to handle reduction PHI nodes to the end of
adjustLoopBranches. Reduction PHI nodes in the outer loop header can be
moved to the inner loop header and reduction PHI nodes from the inner loop
header can be moved to the outer loop header. In the latter situation,
we have to deal with 1 kind of PHI nodes:

    PHI nodes that are part of inner loop-only reductions.

We can replace the PHI node with the value coming from outside
the inner loop.

Reviewers: mcrosier, efriedma, karthikthecool

Reviewed By: efriedma

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

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

6 years agoTest commit.
Mikhail Dvoretckii [Tue, 19 Jun 2018 07:55:10 +0000 (07:55 +0000)]
Test commit.

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

6 years agoIf the arch is P9, we will select the DFLOADf32/DFLOADf64 pseudo instruction when...
QingShan Zhang [Tue, 19 Jun 2018 06:54:51 +0000 (06:54 +0000)]
If the arch is P9, we will select the DFLOADf32/DFLOADf64 pseudo instruction when we are loading a floating,
and expand it post RA basing on the register pressure. However, we miss to do the add-imm peephole for these pseudo instruction.

Differential Revision: https://reviews.llvm.org/D47568
Reviewed By: Nemanjai

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

6 years ago[RISCV] Add tests for overflow intrinsics
Roger Ferrer Ibanez [Tue, 19 Jun 2018 06:45:47 +0000 (06:45 +0000)]
[RISCV] Add tests for overflow intrinsics

This is using the existing codegen so we can see the change once we custom
lower ISD::{U,S}{ADD,SUB}O nodes.

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

6 years ago[SimplifyIndVars] Eliminate redundant truncs
Max Kazantsev [Tue, 19 Jun 2018 04:48:34 +0000 (04:48 +0000)]
[SimplifyIndVars] Eliminate redundant truncs

This patch adds logic to deal with the following constructions:

  %iv = phi i64 ...
  %trunc = trunc i64 %iv to i32
  %cmp = icmp <pred> i32 %trunc, %invariant

Replacing it with
  %iv = phi i64 ...
  %cmp = icmp <pred> i64 %iv, sext/zext(%invariant)

In case if it is legal. Specifically, if `%iv` has signed comparison users, it is
required that `sext(trunc(%iv)) == %iv`, and if it has unsigned comparison
uses then we require `zext(trunc(%iv)) == %iv`. The current implementation
bails if `%trunc` has other uses than `icmp`, but in theory we can handle more
cases here (e.g. if the user of trunc is bitcast).

Differential Revision: https://reviews.llvm.org/D47928
Reviewed By: reames

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

6 years ago[X86] Add the ability to force an EVEX2VEX mapping table entry from the .td files...
Craig Topper [Tue, 19 Jun 2018 04:24:44 +0000 (04:24 +0000)]
[X86] Add the ability to force an EVEX2VEX mapping table entry from the .td files. Remove remaining manual table entries from the tablegen emitter.

This adds an EVEX2VEXOverride string to the X86 instruction class in X86InstrFormats.td. If this field is set it will add manual entry in the EVEX->VEX tables that doesn't check the encoding information.

Then use this mechanism to map VMOVDU/A8/16, 128-bit VALIGN, and VPSHUFF/I instructions to VEX instructions.

Finally, remove the manual table from the emitter.

This has the bonus of fully sorting the autogenerated EVEX->VEX tables by their EVEX instruction enum value. We may be able to use this to do a binary search for the conversion and get rid of the need to create a DenseMap.

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

6 years ago[X86] Add a new VEX_WPrefix encoding to tag EVEX instruction that have VEX.W==1,...
Craig Topper [Tue, 19 Jun 2018 04:24:42 +0000 (04:24 +0000)]
[X86] Add a new VEX_WPrefix encoding to tag EVEX instruction that have VEX.W==1, but can be converted to their VEX equivalent that uses VEX.W==0.

EVEX makes heavy use of the VEX.W bit to indicate 64-bit element vs 32-bit elements. Many of the VEX instructions were split into 2 versions with different masking granularity.

The EVEX->VEX table generate can collapse the two versions if the VEX version uses is tagged as VEX_WIG. But if the VEX version is instead marked VEX.W==0 we can't combine them because we don't know if there is also a VEX version with VEX.W==1.

This patch adds a new VEX_W1X tag that indicates the EVEX instruction encodes with VEX.W==1, but is safe to convert to a VEX instruction with VEX.W==0.

This allows us to remove a bunch of manual EVEX->VEX table entries. We may want to look into splitting up the VEX_WPrefix field which would simplify the disassembler.

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

6 years agoRevert "[SCEV] Add nuw/nsw to mul ops in StrengthenNoWrapFlags"
Sanjoy Das [Tue, 19 Jun 2018 04:09:44 +0000 (04:09 +0000)]
Revert "[SCEV] Add nuw/nsw to mul ops in StrengthenNoWrapFlags"

This reverts r334428.  It incorrectly marks some multiplications as nuw.  Tim
Shen is working on a proper fix.

Original commit message:

[SCEV] Add nuw/nsw to mul ops in StrengthenNoWrapFlags where safe.

Summary:
Previously we would add them for adds, but not multiplies.

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

6 years ago[X86] Simplify the TSFlags checking code in EvexToVexInstPass. NFCI
Craig Topper [Tue, 19 Jun 2018 03:17:46 +0000 (03:17 +0000)]
[X86] Simplify the TSFlags checking code in EvexToVexInstPass. NFCI

The code was previously checking the L2 and L flag on 3 separate lines, treating the combination as an encoding. Instead its better to think of the L2 bit as being something that can't be done with VEX and early returning. Then we just need to check the L bit.

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

6 years ago[WebAssembly] Remove an extra ';' at the end of a namespace
Heejin Ahn [Tue, 19 Jun 2018 01:23:14 +0000 (01:23 +0000)]
[WebAssembly] Remove an extra ';' at the end of a namespace

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

6 years ago[WebAssembly] Add more utility functions
Heejin Ahn [Tue, 19 Jun 2018 00:32:03 +0000 (00:32 +0000)]
[WebAssembly] Add more utility functions

Summary:
Added more utility functions that will be used in EH-related passes Also
changed `LoopBottom` function to `getBottom` and uses templates to be
able to handle other classes as well, which will be used in CFGSort
later.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

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

6 years ago[WebAssembly] Add WasmEHFuncInfo for unwind destination information
Heejin Ahn [Tue, 19 Jun 2018 00:26:39 +0000 (00:26 +0000)]
[WebAssembly] Add WasmEHFuncInfo for unwind destination information

Summary:
Add WasmEHFuncInfo and routines to calculate and fill in this struct to
keep track of unwind destination information. This will be used in
other EH related passes.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, chrib, llvm-commits

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

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

6 years ago[ARM] Thumb2 constant cmp testcases.
Eli Friedman [Tue, 19 Jun 2018 00:14:10 +0000 (00:14 +0000)]
[ARM] Thumb2 constant cmp testcases.

Shows some missed optimizations for the -7929856 and -2166 testcases.
-7929856 is due to a bug in ARMTargetLowering::getARMCmp, I think;
the -2166 case is a missing pattern.

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

6 years ago[ARM] Testcase for Thumb1 cmp with constants.
Eli Friedman [Tue, 19 Jun 2018 00:12:13 +0000 (00:12 +0000)]
[ARM] Testcase for Thumb1 cmp with constants.

Even if a comparison isn't legal, we should try to prefer constants
which can be materialized with a two-instruction sequence. (Thinking
about it a bit more, there might be some more clever sequence we could
generate for certain comparisons invoving powers of two, but I'm not
sure exactly what that would look like.)

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

6 years ago[ARM] Add Thumb1 coverage for cmn testcases.
Eli Friedman [Tue, 19 Jun 2018 00:09:44 +0000 (00:09 +0000)]
[ARM] Add Thumb1 coverage for cmn testcases.

There's a missed optimization for immediates: we can save two
instructions by using adds instead of movs+mvns+cmp.

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

6 years ago[ARM] Testcase for missed optimization for masking.
Eli Friedman [Tue, 19 Jun 2018 00:08:32 +0000 (00:08 +0000)]
[ARM] Testcase for missed optimization for masking.

When the result of masking is truncated to i16, we should try to use
"bic" instead of "and".

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

6 years ago[ARM] Testcase for missed optimization with i16 compare.
Eli Friedman [Tue, 19 Jun 2018 00:07:30 +0000 (00:07 +0000)]
[ARM] Testcase for missed optimization with i16 compare.

The result looks weird because the DAG actually has an explicit
shift; I haven't figured out why, exactly.

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

6 years ago[WebAssembly] Fixed disassembler unit test failure.
Derek Schuff [Tue, 19 Jun 2018 00:02:34 +0000 (00:02 +0000)]
[WebAssembly] Fixed disassembler unit test failure.

Summary: A recent commit forgot to update the unit tests.

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

Patch by Wouter Van Oortmerssen

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

6 years ago[WebAssembly] Make rethrow instruction take a target BB argument
Heejin Ahn [Mon, 18 Jun 2018 23:54:29 +0000 (23:54 +0000)]
[WebAssembly] Make rethrow instruction take a target BB argument

Summary:
This patch changes the rethrow instruction to take a BB argument in LLVM
backend, like `br` and `br_if`s. This BB is a target catch BB the
rethrow instruction unwinds to. This BB argument will be converted to an
relative depth immediate at the end of CFGStackify pass, as in the same
way of branches.

RETHROW_TO_CALLER is a codegen-only instruction that should be used when
a rethrow instruction does not have an unwind destination BB, i.e., it
should rethrow to its caller function.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

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

6 years ago[VPlan] Add Analysis and Core to LLVM_LINK_COMPONENTS
Heejin Ahn [Mon, 18 Jun 2018 23:51:16 +0000 (23:51 +0000)]
[VPlan] Add Analysis and Core to LLVM_LINK_COMPONENTS

Summary: Without these, build with `-DSHARED_LIB=ON` fails.

Reviewers: dschuff

Subscribers: mgorny, bollu, tschuett, rkruppe, rogfer01, llvm-commits

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

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

6 years agoUtilize new SDNode flag functionality to expand current support for fadd
Michael Berg [Mon, 18 Jun 2018 23:44:59 +0000 (23:44 +0000)]
Utilize new SDNode flag functionality to expand current support for fadd

Summary: This patch originated from D46562 and is a proper subset, with some issues addressed.

Reviewers: spatel, hfinkel, wristow, arsenm, javed.absar

Reviewed By: spatel

Subscribers: wdng, nhaehnle

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

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

6 years ago[X86] Remove ReadAfterLd from avx512_shift_rmbi multiclass.
Craig Topper [Mon, 18 Jun 2018 23:20:57 +0000 (23:20 +0000)]
[X86] Remove ReadAfterLd from avx512_shift_rmbi multiclass.

The instructions that use this class don't have another source register. So I think this was just marking one of the address operands as ReadAfterLd?

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

6 years agoRevert "Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor"
Xin Tong [Mon, 18 Jun 2018 23:20:08 +0000 (23:20 +0000)]
Revert "Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor"

This reverts commit f976cf4cca0794267f28b54e468007fd476d37d9.

I am reverting this because it causes break in a few bots and its going
to take me sometime to look at this.

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

6 years agoSimplify blockaddress usage before giving up in MergeBlockIntoPredecessor
Xin Tong [Mon, 18 Jun 2018 22:59:13 +0000 (22:59 +0000)]
Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor

Summary:
Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor

This is a missing small optimization in MergeBlockIntoPredecessor.

This helps with one simplifycfg test which expects this case to be handled.

Reviewers: davide, spatel, brzycki, asbirlea

Subscribers: llvm-commits

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

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

6 years agoTidy comment language and explanation.
Eric Christopher [Mon, 18 Jun 2018 22:21:19 +0000 (22:21 +0000)]
Tidy comment language and explanation.

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

6 years agoPull non-lazy stub table emission into a separate function alongside
Eric Christopher [Mon, 18 Jun 2018 22:21:18 +0000 (22:21 +0000)]
Pull non-lazy stub table emission into a separate function alongside
the individual stub creation to increase readability a bit in the
non-object file format specific function.

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

6 years agoAdd return statements to make it clear that all of these are mutually exclusive condi...
Eric Christopher [Mon, 18 Jun 2018 22:21:13 +0000 (22:21 +0000)]
Add return statements to make it clear that all of these are mutually exclusive conditions.

else if would have worked just as well, but this keeps the original readability a bit more clear.

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

6 years agoTests for dag combine select (binop) -> select. NFC.
Stanislav Mekhanoshin [Mon, 18 Jun 2018 21:49:07 +0000 (21:49 +0000)]
Tests for dag combine select (binop) -> select. NFC.

Tests will be updated with https://reviews.llvm.org/D48223

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

6 years ago[llvm-mca] Cleanup the header syntax line. Fix a comment. NFC.
Matt Davis [Mon, 18 Jun 2018 21:38:38 +0000 (21:38 +0000)]
[llvm-mca] Cleanup the header syntax line. Fix a comment. NFC.

This patch removes a few dashes from the header comment to make room for the syntax line.

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

6 years ago[WebAssembly] Modified tablegen defs to have 2 parallel instuction sets.
Wouter van Oortmerssen [Mon, 18 Jun 2018 21:22:44 +0000 (21:22 +0000)]
[WebAssembly] Modified tablegen defs to have 2 parallel instuction sets.

Summary:
One for register based, much like the existing definitions,
and one for stack based (suffix _S).

This allows us to use registers in most of LLVM (which works better),
and stack based in MC (which results in a simpler and more readable
assembler / disassembler).

Tried to keep this change as small as possible while passing tests,
follow-up commit will:
- Add reg->stack conversion in MI.
- Fix asm/disasm in MC to be stack based.
- Fix emitter to be stack based.

tests passing:
llvm-lit -v `find test -name WebAssembly`

test/CodeGen/WebAssembly
test/MC/WebAssembly
test/MC/Disassembler/WebAssembly
test/DebugInfo/WebAssembly
test/CodeGen/MIR/WebAssembly
test/tools/llvm-objdump/WebAssembly

Reviewers: dschuff, sbc100, jgravelle-google, sunfish

Subscribers: aheejin, JDevlieghere, llvm-commits

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

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

6 years agorefactor of visitFADD for AllowNewConst cases
Michael Berg [Mon, 18 Jun 2018 21:12:21 +0000 (21:12 +0000)]
refactor of visitFADD for AllowNewConst cases

Summary: Refactoring for all constant cases which require AllowNewConst and some staging for future fmf usage.

Reviewers: spatel, hfinkel, wristow

Reviewed By: spatel

Subscribers: nhaehnle

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

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

6 years ago[AArch64][SVE] Asm: Fix predicate pattern diagnostics.
Sander de Smalen [Mon, 18 Jun 2018 21:03:02 +0000 (21:03 +0000)]
[AArch64][SVE] Asm: Fix predicate pattern diagnostics.

This patch uses the DiagnosticPredicate for SVE predicate patterns
to improve their diagnostics, now giving a 'invalid operand' diagnostic
if the type is not an immediate or one of the expected pattern
labels.

Reviewers: samparker, SjoerdMeijer, javed.absar, fhahn

Reviewed By: fhahn

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

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

6 years ago[AArch64][SVE] Asm: Support for saturating INC/DEC (32bit scalar) instructions.
Sander de Smalen [Mon, 18 Jun 2018 20:50:33 +0000 (20:50 +0000)]
[AArch64][SVE] Asm: Support for saturating INC/DEC (32bit scalar) instructions.

The variants added by this patch are:
- SQINC     signed increment, e.g. sqinc x0, w0, all, mul #4
- SQDEC     signed decrement, e.g. sqdec x0, w0, all, mul #4
- UQINC   unsigned increment, e.g. uqinc w0, all, mul #4
- UQDEC   unsigned decrement, e.g. uqdec w0, all, mul #4

This patch includes asmparser changes to parse a GPR64 as a GPR32 in
order to satisfy the constraint check:
  x0 == GPR64(w0)
in:
  sqinc x0, w0, all, mul #4
         ^___^ (must match)

Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar

Reviewed By: fhahn

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

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

6 years ago[WebAssembly] Cleaned up register accessors in WebAssemblyMachineFunctionInfo.h
Wouter van Oortmerssen [Mon, 18 Jun 2018 20:45:49 +0000 (20:45 +0000)]
[WebAssembly] Cleaned up register accessors in WebAssemblyMachineFunctionInfo.h

Tested: llvm-lit -v `find test -name WebAssembly`

(This is a commit access "test commit" :)

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

6 years ago[x86] regenerate checks and adjust tests
Sanjay Patel [Mon, 18 Jun 2018 20:05:16 +0000 (20:05 +0000)]
[x86] regenerate checks and adjust tests

2 of these tests were clearly not doing what the comments
said they were doing.

The last test was added at rL177933 with no assertions
(presumably it used to crash). But either we don't have
that problem anymore, or this test is folded sooner,
so we don't hit the bug that was fixed by disabling late
FP constant creation. Looking at this as part of reviewing
D48289.

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

6 years ago[docs] Fix indentation of llvm-exegesis command line arguments
Simon Pilgrim [Mon, 18 Jun 2018 20:05:02 +0000 (20:05 +0000)]
[docs] Fix indentation of llvm-exegesis command line arguments

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

6 years ago[X86] Encode the EVEX2VEX exception list information in .td files instead of the...
Craig Topper [Mon, 18 Jun 2018 18:47:07 +0000 (18:47 +0000)]
[X86] Encode the EVEX2VEX exception list information in .td files instead of the emitter source.

Rather than having an exclusion list in tablegen sources, add a flag to the X86 instruction records that can be used to suppress checking for convertibility.

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

6 years ago[NFC] make MIFlag accessor functions consistant with usage model
Michael Berg [Mon, 18 Jun 2018 18:37:48 +0000 (18:37 +0000)]
[NFC] make MIFlag accessor functions consistant with usage model

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

6 years ago[VPlan] Add VPInstruction to VPRecipe transformation.
Florian Hahn [Mon, 18 Jun 2018 18:28:49 +0000 (18:28 +0000)]
[VPlan] Add VPInstruction to VPRecipe transformation.

This patch introduces a VPInstructionToVPRecipe transformation, which
allows us to generate code for a VPInstruction based VPlan re-using the
existing infrastructure.

Reviewers: dcaballe, hsaito, mssimpso, hfinkel, rengolin, mkuper, javed.absar, sguggill

Reviewed By: dcaballe

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

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

6 years ago[ORC] Add an initial implementation of a replacement CompileOnDemandLayer.
Lang Hames [Mon, 18 Jun 2018 18:01:43 +0000 (18:01 +0000)]
[ORC] Add an initial implementation of a replacement CompileOnDemandLayer.

CompileOnDemandLayer2 is a replacement for CompileOnDemandLayer built on the ORC
Core APIs. Functions in added modules are extracted and compiled lazily.
CompileOnDemandLayer2 supports multithreaded JIT'd code, and compilation on
multiple threads.

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

6 years ago[ORC] Keep weak flag on VSO symbol tables during materialization, but treat
Lang Hames [Mon, 18 Jun 2018 18:01:41 +0000 (18:01 +0000)]
[ORC] Keep weak flag on VSO symbol tables during materialization, but treat
materializing weak symbols as strong.

This removes some elaborate flag tweaking and plays nicer with RuntimeDyld,
which relies of weak/common flags to determine whether it should emit a given
weak definition. (Switching to strong up-front makes it appear as if there is
already an overriding definition, which would require an extra back-channel to
override).

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

6 years agoShrink interval after moving copy in removePartialRedundancy
Krzysztof Parzyszek [Mon, 18 Jun 2018 17:16:39 +0000 (17:16 +0000)]
Shrink interval after moving copy in removePartialRedundancy

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

6 years ago[llvm-mca] Use an ordered map to collect hardware statistics. NFC.
Andrea Di Biagio [Mon, 18 Jun 2018 17:04:56 +0000 (17:04 +0000)]
[llvm-mca] Use an ordered map to collect hardware statistics. NFC.

Histogram entries are now ordered by key.  This should improves their
readability when statistics are printed.

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

6 years agoFix typoed cast to avoid assertion in MCFragment::dump.
Nirav Dave [Mon, 18 Jun 2018 16:26:11 +0000 (16:26 +0000)]
Fix typoed cast to avoid assertion in MCFragment::dump.

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