OSDN Git Service

android-x86/external-llvm.git
6 years ago[X86] Handle EAX being live when calling chkstk for x86_64
Martin Storsjo [Tue, 6 Mar 2018 06:00:13 +0000 (06:00 +0000)]
[X86] Handle EAX being live when calling chkstk for x86_64

EAX can turn out to be alive here, when shrink wrapping is done
(which is allowed when using dwarf exceptions, contrary to the
normal case with WinCFI).

This fixes PR36487.

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

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

6 years agoUpdated docs in CrashRecoveryContext.h
Serge Pavlov [Tue, 6 Mar 2018 04:00:30 +0000 (04:00 +0000)]
Updated docs in CrashRecoveryContext.h

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

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

6 years agoRevert "[DWARFv5] Emit file 0 to the line table."
Paul Robinson [Tue, 6 Mar 2018 03:15:21 +0000 (03:15 +0000)]
Revert "[DWARFv5] Emit file 0 to the line table."
Caused an asan failure.

This reverts commit d54883f081186cdcce74e6f98cfc0438579ec019.
aka r326758

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

6 years ago[MergeICmp] Simplify how BCECmpBlock instructions are blacklisted
Xin Tong [Tue, 6 Mar 2018 02:24:02 +0000 (02:24 +0000)]
[MergeICmp] Simplify how BCECmpBlock instructions are blacklisted

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

6 years ago[MergeICmp] Fix printing. NFC
Xin Tong [Tue, 6 Mar 2018 02:04:57 +0000 (02:04 +0000)]
[MergeICmp] Fix printing. NFC

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

6 years ago[DWARFv5] Emit file 0 to the line table.
Paul Robinson [Tue, 6 Mar 2018 01:59:56 +0000 (01:59 +0000)]
[DWARFv5] Emit file 0 to the line table.

DWARF v5 specifies that the root file (also given in the DW_AT_name
attribute of the compilation unit DIE) should be emitted explicitly to
the line table's list of files.  This makes the line table more
independent of the .debug_info section.

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

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

6 years agoDisable llvm-opt-fuzzer/exec-options.ll on Windows, it is too flaky
Reid Kleckner [Mon, 5 Mar 2018 23:18:13 +0000 (23:18 +0000)]
Disable llvm-opt-fuzzer/exec-options.ll on Windows, it is too flaky

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

6 years ago[X86] cvttpd2dq lowering has been supported for some time
Simon Pilgrim [Mon, 5 Mar 2018 23:00:39 +0000 (23:00 +0000)]
[X86] cvttpd2dq lowering has been supported for some time

Tests in vec_fp_to_int.ll

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

6 years ago[InstSimplify] remove redundant folds
Sanjay Patel [Mon, 5 Mar 2018 22:46:48 +0000 (22:46 +0000)]
[InstSimplify] remove redundant folds

The 'hasOneUse' check is a giveaway that something's not right.
We never need to check that in InstSimplify because we don't
create new instructions here.

These are all handled as icmp simplifies which then trigger
existing select simplifies, so there's no need to duplicate
a composite fold of the two.

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

6 years agoGlobalISel: IRTranslate llvm.fabs.* intrinsic
Volkan Keles [Mon, 5 Mar 2018 22:31:55 +0000 (22:31 +0000)]
GlobalISel: IRTranslate llvm.fabs.* intrinsic

Summary:
Fabs is a common floating-point operation, especially for some expansions. This patch adds
a new generic opcode for llvm.fabs.* intrinsic in order to avoid building/matching this intrinsic.

Reviewers: qcolombet, aditya_nandakumar, dsanders, rovka

Reviewed By: aditya_nandakumar

Subscribers: kristof.beyls, javed.absar, llvm-commits

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

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

6 years ago[RewriteStatepoints] Fix stale parse points
Daniel Neilson [Mon, 5 Mar 2018 22:27:30 +0000 (22:27 +0000)]
[RewriteStatepoints] Fix stale parse points

Summary:
RewriteStatepointsForGC collects parse points for further processing.
During the collection if a callsite is found in an unreachable block
(DominatorTree::isReachableFromEntry()) then all unreachable blocks are
removed by removeUnreachableBlocks(). Some of the removed blocks could
have been reachable according to DominatorTree::isReachableFromEntry().
In this case the collected parse points became stale and resulted in a
crash when accessed.

The fix is to unconditionally canonicalize the IR to
removeUnreachableBlocks and then collect the parse points.

The added test crashes with the old version and passes with this patch.

Patch by Yevgeny Rouban!

Reviewed by: Anna

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

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

6 years ago[X86] Add silvermont fp arithmetic cost model tests
Simon Pilgrim [Mon, 5 Mar 2018 22:13:22 +0000 (22:13 +0000)]
[X86] Add silvermont fp arithmetic cost model tests

Add silvermont to existing high coverage tests instead of repeating in slm-arith-costs.ll

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

6 years ago[AMDGPU] Remove unused AMDOpenCL triple environment
Tony Tye [Mon, 5 Mar 2018 21:39:41 +0000 (21:39 +0000)]
[AMDGPU] Remove unused AMDOpenCL triple environment

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

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

6 years ago[AVR] Fix the test suite after r326500.
Dylan McKay [Mon, 5 Mar 2018 20:56:25 +0000 (20:56 +0000)]
[AVR] Fix the test suite after r326500.

r326500 subtly changed the way the instructions are printed.

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

6 years ago[SLP] Additional tests for stores vectorization, NFC.
Alexey Bataev [Mon, 5 Mar 2018 20:20:12 +0000 (20:20 +0000)]
[SLP] Additional tests for stores vectorization, NFC.

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

6 years agoRe-commit: Make STATISTIC() values available programmatically
Daniel Sanders [Mon, 5 Mar 2018 19:38:16 +0000 (19:38 +0000)]
Re-commit: Make STATISTIC() values available programmatically

Summary:
It can be useful for tools to be able to retrieve the values of variables
declared via STATISTIC() directly without having to emit them and parse
them back. Use cases include:
* Needing to report specific statistics to a test harness
* Wanting to post-process statistics. For example, to produce a percentage of
  functions that were fully selected by GlobalISel

Make this possible by adding llvm::GetStatistics() which returns an
iterator_range that can be used to inspect the statistics that have been
touched during execution. When statistics are disabled (NDEBUG and not
LLVM_ENABLE_STATISTICS) this method will return an empty range.

This patch doesn't address the effect of multiple compilations within the same
process. In such situations, the statistics will be cumulative for all
compilations up to the GetStatistics() call.

Reviewers: qcolombet, rtereshin, aditya_nandakumar, bogner

Reviewed By: rtereshin, bogner

Subscribers: llvm-commits, mgorny

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

This re-commit fixes a missing include of <vector> which it seems clang didn't
mind but G++ and MSVC objected to. It seems that, clang was ok with std::vector
only being forward declared at the point of use since it was fully defined
eventually but G++/MSVC both rejected it at the point of use.

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

6 years agoOn Windows we need to be able to process response files with Windows-style
Dmitry Mikulin [Mon, 5 Mar 2018 19:34:33 +0000 (19:34 +0000)]
On Windows we need to be able to process response files with Windows-style
path names.

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

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

6 years ago[PowerPC] Do not emit record-form rotates when record-form andi suffices
Nemanja Ivanovic [Mon, 5 Mar 2018 19:27:16 +0000 (19:27 +0000)]
[PowerPC] Do not emit record-form rotates when record-form andi suffices

Up until Power9, the performance profile for rlwinm., rldicl. and andi. looked
more or less equivalent. However with Power9, the rotates are still 2-way
cracked whereas the and-immediate is not.

This patch just ensures that we don't emit record-form rotates when an andi.
is adequate.

As first pointed out by Carrot in https://bugs.llvm.org/show_bug.cgi?id=30833
(this patch is a fix for that PR).

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

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

6 years ago[x86] auto-generate full checks for fabs tests
Sanjay Patel [Mon, 5 Mar 2018 19:11:20 +0000 (19:11 +0000)]
[x86] auto-generate full checks for fabs tests

Also, change the x86-64 test to optimized and remove the
unnecessary platform specification from the RUN lines..

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

6 years agoOn Windows expansion of regex file name patterns is the responsibility of each
Dmitry Mikulin [Mon, 5 Mar 2018 18:54:56 +0000 (18:54 +0000)]
On Windows expansion of regex file name patterns is the responsibility of each
tool. Fix ar to do that.

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

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

6 years agoFix an unused variable warning introduced by rr326703. NFC
Eric Liu [Mon, 5 Mar 2018 18:36:39 +0000 (18:36 +0000)]
Fix an unused variable warning introduced by rr326703. NFC

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

6 years ago[llvm-pdbdump] Dump restrict type qualifier
Aaron Smith [Mon, 5 Mar 2018 18:29:43 +0000 (18:29 +0000)]
[llvm-pdbdump] Dump restrict type qualifier

Reviewers: zturner, llvm-commits, rnk

Reviewed By: zturner

Subscribers: majnemer

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

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

6 years ago[InstCombine] Don't blow up in foldICmpWithCastAndCast on vector icmp instructions.
Daniel Neilson [Mon, 5 Mar 2018 18:05:51 +0000 (18:05 +0000)]
[InstCombine] Don't blow up in foldICmpWithCastAndCast on vector icmp instructions.

Summary:
Presently, InstCombiner::foldICmpWithCastAndCast() implicitly assumes that it is
only invoked with icmp instructions of integer type. If that assumption is broken,
and it is called with an icmp of vector type, then it fails (asserts/crashes).

This patch addresses the deficiency. It allows it to simplify
icmp (ptrtoint x), (ptrtoint/c) of vector type into a compare of the inputs,
much as is done when the type is integer.

Reviewers: apilipenko, fedor.sergeev, mkazantsev, anna

Reviewed By: anna

Subscribers: llvm-commits

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

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

6 years ago[InstCombine] Add constant vector support to getMinimumFPType for visitFPTrunc.
Craig Topper [Mon, 5 Mar 2018 18:04:12 +0000 (18:04 +0000)]
[InstCombine] Add constant vector support to getMinimumFPType for visitFPTrunc.

This patch teaches getMinimumFPType to support shrinking a vector of ConstantFPs. This should improve our ability to combine vector fptrunc with fp binops.

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

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

6 years agoRevert r326723: Make STATISTIC() values available programmatically
Daniel Sanders [Mon, 5 Mar 2018 17:52:43 +0000 (17:52 +0000)]
Revert r326723: Make STATISTIC() values available programmatically

Despite building cleanly on my machine in three separate configs, it's failing on pretty much all bots due to missing includes among other things. Investigating.

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

6 years ago[AArch64] Harden test case
Evandro Menezes [Mon, 5 Mar 2018 17:42:18 +0000 (17:42 +0000)]
[AArch64] Harden test case

NFC

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

6 years agoMake STATISTIC() values available programmatically
Daniel Sanders [Mon, 5 Mar 2018 17:41:45 +0000 (17:41 +0000)]
Make STATISTIC() values available programmatically

Summary:
It can be useful for tools to be able to retrieve the values of variables
declared via STATISTIC() directly without having to emit them and parse
them back. Use cases include:
* Needing to report specific statistics to a test harness
* Wanting to post-process statistics. For example, to produce a percentage of
  functions that were fully selected by GlobalISel

Make this possible by adding llvm::GetStatistics() which returns an
iterator_range that can be used to inspect the statistics that have been
touched during execution. When statistics are disabled (NDEBUG and not
LLVM_ENABLE_STATISTICS) this method will return an empty range.

This patch doesn't address the effect of multiple compilations within the same
process. In such situations, the statistics will be cumulative for all
compilations up to the GetStatistics() call.

Reviewers: qcolombet, rtereshin, aditya_nandakumar, bogner

Reviewed By: rtereshin, bogner

Subscribers: llvm-commits, mgorny

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

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

6 years agofix PR36582
Sebastian Pop [Mon, 5 Mar 2018 17:35:49 +0000 (17:35 +0000)]
fix PR36582

The error occurs when reading i16 elements (as in the testcase) from a v8i8
with a pattern of <0,2,4,6>. As all the data in the vector is accessed, the
operation is not a VUZP. The patch stops the pattern recognition of VUZP when
EXTRACT_VECTOR_ELT has a different element type than BUILD_VECTOR.

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

6 years ago[IPSCCP] Add getCompare which returns either true, false, undef or null.
Florian Hahn [Mon, 5 Mar 2018 17:33:50 +0000 (17:33 +0000)]
[IPSCCP] Add getCompare which returns either true, false, undef or null.

getCompare returns true, false or undef constants if the comparison can
be evaluated, or nullptr if it cannot. This is in line with what
ConstantExpr::getCompare returns. It also allows us to use
ConstantExpr::getCompare for comparing constants.

Reviewers: davide, mssimpso, dberlin, anna

Reviewed By: davide

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

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

6 years ago[AArch64] Improve code generation of constant vectors
Evandro Menezes [Mon, 5 Mar 2018 17:02:47 +0000 (17:02 +0000)]
[AArch64] Improve code generation of constant vectors

Use the whole gammut of constant immediates available to set up a vector.
Instead of using, for example, `mov w0, #0xffff; dup v0.4s, w0`, which
transfers between register files, use the more efficient `movi v0.4s, #-1`
instead.  Not limited to just a few values, but any immediate value that can
be encoded by all the variants of `FMOV`, `MOVI`, `MVNI`, thus eliminating
the need to there be patterns to optimize special cases.

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

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

6 years ago[MachineScheduler] Dump SUnits before calling SchedImpl->initialize()
Jonas Paulsson [Mon, 5 Mar 2018 16:31:49 +0000 (16:31 +0000)]
[MachineScheduler] Dump SUnits before calling SchedImpl->initialize()

This is a NFC simple patch that changes the DEBUG dumping in the
MachineScheduler so that the dumping of the built SUnits is done before the
SchedImpl->initialize() is called.

This is better on SystemZ, since it has a strategy that does some dumping at
the start of the region, and it is not possible to easily read it if it is
output above a long list of SU.

Review: Javed Absar
https://reviews.llvm.org/D44089

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

6 years agoAMDGPU/GlobalISel: Add InstrMapping for G_EXTRACT
Matt Arsenault [Mon, 5 Mar 2018 16:25:18 +0000 (16:25 +0000)]
AMDGPU/GlobalISel: Add InstrMapping for G_EXTRACT

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

6 years agoAMDGPU/GlobalISel: Make some G_EXTRACTs legal
Matt Arsenault [Mon, 5 Mar 2018 16:25:15 +0000 (16:25 +0000)]
AMDGPU/GlobalISel: Make some G_EXTRACTs legal

As far as I can tell legalization of weird sizes for the
output type isn't implemented.

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

6 years agoAMDGPU: Fix build warning about override
Matt Arsenault [Mon, 5 Mar 2018 16:25:10 +0000 (16:25 +0000)]
AMDGPU: Fix build warning about override

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

6 years ago[CVP] fix formatting; NFC
Sanjay Patel [Mon, 5 Mar 2018 16:08:34 +0000 (16:08 +0000)]
[CVP] fix formatting; NFC

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

6 years agoFuzzer: remove temporary files after we're done with them.
Tim Northover [Mon, 5 Mar 2018 15:49:00 +0000 (15:49 +0000)]
Fuzzer: remove temporary files after we're done with them.

These were just copies of the relevant fuzzer binary with (presumably)
meaningful suffixes, but accounted for more than 10% of my build
directory (> 8GB). Hard drive space is cheap, but not that cheap.

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

6 years agoTableGen: Resolve all template args simultaneously in ResolveMulticlassDefARgs
Nicolai Haehnle [Mon, 5 Mar 2018 15:21:19 +0000 (15:21 +0000)]
TableGen: Resolve all template args simultaneously in ResolveMulticlassDefARgs

Summary:
Use the new resolver interface more explicitly, and avoid traversing
all the initializers multiple times.

Change-Id: I679e86988b309d19f25e6cca8b0b14ea150198a6

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Resolve all template args simultaneously in AddSubMultiClass
Nicolai Haehnle [Mon, 5 Mar 2018 15:21:15 +0000 (15:21 +0000)]
TableGen: Resolve all template args simultaneously in AddSubMultiClass

Summary:
Use the new resolver interface more explicitly, and avoid traversing
all the initializers multiple times.

Change-Id: Ia4dcc6d42dd8b65e6079d318c6a202f36f320fee

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Resolve all template args simultaneously in AddSubClass
Nicolai Haehnle [Mon, 5 Mar 2018 15:21:11 +0000 (15:21 +0000)]
TableGen: Resolve all template args simultaneously in AddSubClass

Summary:
Use the new resolver interface more explicitly, and avoid traversing
all the initializers multiple times.

Add a test case for a pattern that was broken by an earlier version
of this change.

An additional change is that we now remove *all* template arguments
after resolving them.

Change-Id: I86c828c8cc84c18b052dfe0f64c0d5cbf3c4e13c

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Reimplement !foreach using the resolving mechanism
Nicolai Haehnle [Mon, 5 Mar 2018 15:21:04 +0000 (15:21 +0000)]
TableGen: Reimplement !foreach using the resolving mechanism

Summary:
This changes the syntax of !foreach so that the first "parameter" is
a new syntactic variable: !foreach(x, lst, expr) will define the
variable x within the scope of expr, and evaluation of the !foreach
will substitute elements of the given list (or dag) for x in expr.

Aside from leading to a nicer syntax, this allows more complex
expressions where x is deeply nested, or even constant expressions
in which x does not occur at all.

!foreach is currently not actually used anywhere in trunk, but I
plan to use it in the AMDGPU backend. If out-of-tree targets are
using it, they can adjust to the new syntax very easily.

Change-Id: Ib966694d8ab6542279d6bc358b6f4d767945a805

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits, tpr

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

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

6 years agoTableGen: Introduce an abstract variable resolver interface
Nicolai Haehnle [Mon, 5 Mar 2018 15:20:51 +0000 (15:20 +0000)]
TableGen: Introduce an abstract variable resolver interface

Summary:
The intention is to allow us to more easily restructure how resolving is
done, e.g. resolving multiple variables simultaneously, or using the
resolving mechanism to implement !foreach.

Change-Id: I4b976b54a32e240ad4f562f7eb86a4d663a20ea8

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoPass Divergence Analysis data to Selection DAG to drive divergence
Alexander Timofeev [Mon, 5 Mar 2018 15:12:21 +0000 (15:12 +0000)]
Pass Divergence Analysis data to Selection DAG to drive divergence
dependent instruction selection.

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

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

6 years ago[Power9] Add more missing instructions to the Power 9 scheduler
Stefan Pintilie [Mon, 5 Mar 2018 14:34:59 +0000 (14:34 +0000)]
[Power9] Add more missing instructions to the Power 9 scheduler

Adding more instructions using InstRW so that we can move away from ItinRW
and ultimately have a complete Power 9 scheduler.

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

6 years agoTableGen: Allow NAME in template arguments in defm in multiclass
Nicolai Haehnle [Mon, 5 Mar 2018 14:01:38 +0000 (14:01 +0000)]
TableGen: Allow NAME in template arguments in defm in multiclass

Summary:
NAME has already worked for def in a multiclass, since the (protoype)
record including its NAME variable is created before parsing the
superclasses. Since defm's do not have an associated single record,
support for NAME has to be implemented differently here.

Original test cases provided by Artem Belevich (tra)

Change-Id: I933b74f328c0ff202e7dc23a35b78f3505760cc9

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

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

6 years agoTableGen: Use DefInit::getDef() instead of the type's getRecord()
Nicolai Haehnle [Mon, 5 Mar 2018 14:01:30 +0000 (14:01 +0000)]
TableGen: Use DefInit::getDef() instead of the type's getRecord()

The former simply makes more sense: we want to access the data here in
the backend, not information about the type.

More importantly, removing users of RecordRecTy::getRecord() allows us
more freedom to refactor the frontend.

Change-Id: Iee8905fd22cdb9b11c42ca03246c03d8fe4dd77f

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

6 years ago[MergeICmp] We can discard initial blocks that do other work
Xin Tong [Mon, 5 Mar 2018 13:54:47 +0000 (13:54 +0000)]
[MergeICmp] We can discard initial blocks that do other work

Summary:
 We can discard initial blocks that do other work
We do not need to limit ourselves to just the first block in the chain.

Reviewers: courbet, davide

Reviewed By: courbet

Subscribers: llvm-commits

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

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

6 years ago[WebAssembly] Add validation to reloc section
Nicholas Wilson [Mon, 5 Mar 2018 13:32:38 +0000 (13:32 +0000)]
[WebAssembly] Add validation to reloc section

We now check relocations offsets are within range, and the relocation
index is valid.

Also updated tests which contained invalid Wasm files that were
previously not checked.

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

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

6 years ago[ARM][Asm] VMOVSRR and VMOVRRS need sequential S registers
Oliver Stannard [Mon, 5 Mar 2018 13:27:26 +0000 (13:27 +0000)]
[ARM][Asm] VMOVSRR and VMOVRRS need sequential S registers

These instructions require that the two S registers are adjacent (but not the R
registers), because only the first register is included in the encoding, but we
were not checking this in the assembler.

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

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

6 years ago[WebAssembly] Reorder reloc sections to come between symtab and name
Nicholas Wilson [Mon, 5 Mar 2018 12:59:03 +0000 (12:59 +0000)]
[WebAssembly] Reorder reloc sections to come between symtab and name

This is required in order to enable relocs to be validated
as they are read in.

Also update tests with new section ordering.

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

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

6 years ago[WebAssembly] Fix tests with invalid yaml (required CODE section missing)
Nicholas Wilson [Mon, 5 Mar 2018 12:28:01 +0000 (12:28 +0000)]
[WebAssembly] Fix tests with invalid yaml (required CODE section missing)

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

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

6 years ago[WebAssembly] Attach a name to globals similarly to function naming
Nicholas Wilson [Mon, 5 Mar 2018 12:16:32 +0000 (12:16 +0000)]
[WebAssembly] Attach a name to globals similarly to function naming

This allows LLD to print the name for an InputGlobal when encountering
an error.

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

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

6 years agoFix location of comment in EmitPopInst
Thomas Preud'homme [Mon, 5 Mar 2018 11:49:00 +0000 (11:49 +0000)]
Fix location of comment in EmitPopInst

Comment about folding return in LDM was not moved along with the
corresponding code in r242714. This commit fixes that.

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

6 years ago[Bash-autocompletion] Pass all flags in shell command-line to Clang
Yuka Takahashi [Mon, 5 Mar 2018 08:54:20 +0000 (08:54 +0000)]
[Bash-autocompletion] Pass all flags in shell command-line to Clang

Previously, we passed "#" to --autocomplete to indicate to enable cc1
flags. For example, when -cc1 or -Xclang was passed to bash, bash
executed `clang --autocomplete=#-<flag they want to complete>`.

However, this was not a good implementation because it depends -Xclang
and -cc1 parsing to shell. So I changed this to pass all flags shell
has, so that Clang can handle them internally.

I had to change many testcases because API spec changed quite a lot.

Reviewers: teemperor, v.g.vassilev

Subscribers: cfe-commits

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

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

6 years ago[MergeICmps][NFC] Improve logging.
Clement Courbet [Mon, 5 Mar 2018 08:21:47 +0000 (08:21 +0000)]
[MergeICmps][NFC] Improve logging.

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

6 years ago[X86] Replace usages of X86Subtarget::hasFp256 with hasAVX. Remove hasFP256.
Craig Topper [Mon, 5 Mar 2018 00:13:35 +0000 (00:13 +0000)]
[X86] Replace usages of X86Subtarget::hasFp256 with hasAVX. Remove hasFP256.

Almost none of these usages were FP specific. And we had no clear guideliness on when to use hasAVX vs hasFP256.

I might also remove hasInt256 too since its an alias for hasAVX2.

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

6 years ago[X86] Add a DAG combine to turn stores of vXi1 constants into scalar stores.
Craig Topper [Sun, 4 Mar 2018 19:33:15 +0000 (19:33 +0000)]
[X86] Add a DAG combine to turn stores of vXi1 constants into scalar stores.

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

6 years ago[X86] Add a 32-bit mode command line to avx512-mask-op.ll. Add tests for storing...
Craig Topper [Sun, 4 Mar 2018 19:33:13 +0000 (19:33 +0000)]
[X86] Add a 32-bit mode command line to avx512-mask-op.ll. Add tests for storing v2i1 and v4i1 constants.

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

6 years ago[DAGCombiner] Add a peekThroughBitcast to MergeStoresOfConstantsOrVecElts to fix...
Craig Topper [Sun, 4 Mar 2018 18:51:46 +0000 (18:51 +0000)]
[DAGCombiner] Add a peekThroughBitcast to MergeStoresOfConstantsOrVecElts to fix a crash if we are storing a bitcast of a constant.

Loading a constant into a k-register in AVX512 requires a bitcast from a scalar constant. In the test case here we have a k-register store that gets split into multiple parts of KNL. MergeConsecutiveStores sees each of these pieces as a consecutive store and looks through the bitcast to find the underly scalar constant. But when we went to create the combined store we didn't look through the same bitcast.

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

6 years ago[X86][X87] Add X87 folded integer arithmetic tests
Simon Pilgrim [Sun, 4 Mar 2018 15:00:19 +0000 (15:00 +0000)]
[X86][X87] Add X87 folded integer arithmetic tests

Add tests for FIADD/FISUB/FISUBR/FIMUL/FIDIV/FIDIVR

Shows we have more FILD stack usage than necessary (arg load, spill, reload to x87)

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

6 years ago[X86][MMX] Remove completed _mm_cvtsi32_si64 todo
Simon Pilgrim [Sun, 4 Mar 2018 14:57:26 +0000 (14:57 +0000)]
[X86][MMX] Remove completed _mm_cvtsi32_si64 todo

rL322525 - mmx zero constant support
rL322553 - mmx i32 zero extended value
rL326497 - mmx i64 general constant handling

Not all constants are folded, we generate some on the GPRs (similar to SSE build vector) where appropriate

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

6 years ago[X86] Fix unused variable in release builds.
Craig Topper [Sun, 4 Mar 2018 02:14:16 +0000 (02:14 +0000)]
[X86] Fix unused variable in release builds.

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

6 years ago[X86] Combine (store (v1i1 (scalar_to_vector (i8 X)))) -> (store (i8 X)).
Craig Topper [Sun, 4 Mar 2018 01:48:02 +0000 (01:48 +0000)]
[X86] Combine (store (v1i1 (scalar_to_vector (i8 X)))) -> (store (i8 X)).

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

6 years ago[X86] Lower v1i1/v2i1/v4i1/v8i1 load/stores to i8 load/store during op legalization...
Craig Topper [Sun, 4 Mar 2018 01:48:00 +0000 (01:48 +0000)]
[X86] Lower v1i1/v2i1/v4i1/v8i1 load/stores to i8 load/store during op legalization if AVX512DQ is not supported.

We were previously doing this with isel patterns. Moving it to op legalization gives us chance to see the required bitcast earlier. And it lets us remove some isel patterns.

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

6 years ago[CallSiteSplitting] fix use after-free
Fedor Indutny [Sat, 3 Mar 2018 22:34:38 +0000 (22:34 +0000)]
[CallSiteSplitting] fix use after-free

Iterating through predecessors of `TailBB` while removing their
terminators leads to use after-free, because the predecessor list is
changing on each removal.

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

6 years ago[CallSiteSplitting] properly split musttail calls
Fedor Indutny [Sat, 3 Mar 2018 21:40:14 +0000 (21:40 +0000)]
[CallSiteSplitting] properly split musttail calls

Summary:
`musttail` calls can't be naively splitted. The split blocks must
include not only the call instruction itself, but also (optional)
`bitcast` and `return` instructions that follow it.

Clone `bitcast` and `ret`, place them into the split blocks, and
remove the tail block when done.

Reviewers: junbuml, mcrosier, davidxl, davide, fhahn

Reviewed By: fhahn

Subscribers: JDevlieghere, llvm-commits

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

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

6 years ago[InstCombine] add test for vectors with undef elts; NFC
Sanjay Patel [Sat, 3 Mar 2018 18:00:15 +0000 (18:00 +0000)]
[InstCombine] add test for vectors with undef elts; NFC

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

6 years ago[InstCombine] (~X) - (~Y) --> Y - X
Sanjay Patel [Sat, 3 Mar 2018 17:53:25 +0000 (17:53 +0000)]
[InstCombine] (~X) - (~Y) --> Y - X

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

6 years ago[InstCombine] add tests for notnotsub; NFC
Sanjay Patel [Sat, 3 Mar 2018 17:20:37 +0000 (17:20 +0000)]
[InstCombine] add tests for notnotsub; NFC

As shown in D44043, we may need this fold in the backend,
but it's also missing in the IR optimizer.

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

6 years ago[X86] This bit-test TODO has been moved in PR36551
Simon Pilgrim [Sat, 3 Mar 2018 16:31:17 +0000 (16:31 +0000)]
[X86] This bit-test TODO has been moved in PR36551

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

6 years ago[X86] Remove 'else' after return. NFC
Craig Topper [Sat, 3 Mar 2018 05:18:21 +0000 (05:18 +0000)]
[X86] Remove 'else' after return. NFC

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

6 years ago[ThinLTO] Revert r325320: Import global variables
Chandler Carruth [Fri, 2 Mar 2018 23:40:08 +0000 (23:40 +0000)]
[ThinLTO] Revert r325320: Import global variables

This caused some links to fail with ThinLTO due to missing symbols as
well as causing some binaries to have failures at runtime. We're working
with the author to get a test case, but want to get the tree green
again.

Further, it appears to introduce a data race. While the test usage of
threads was disabled in r325361 & r325362, that isn't an acceptable fix.
I've reverted both of these as well. This code needs to be thread safe.
Test cases for this are already on the original commit thread.

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

6 years ago[LegalizeVectorTypes] When scalarizing the operand of a unary op like TRUNC, use...
Craig Topper [Fri, 2 Mar 2018 23:27:50 +0000 (23:27 +0000)]
[LegalizeVectorTypes] When scalarizing the operand of a unary op like TRUNC, use a SCALAR_TO_VECTOR rather than a single element BUILD_VECTOR to convert back to a vector type.

X86 considers v1i1 a legal type under AVX512 and as such a truncate from a v1iX type to v1i1 can be turned into a scalar truncate plus a conversion to v1i1. We would much prefer a v1i1 SCALAR_TO_VECTOR over a one element BUILD_VECTOR.

During lowering we were detecting the v1i1 BUILD_VECTOR as a splat BUILD_VECTOR like we try to do for v2i1/v4i1/etc. In this case we create (select i1 splat_elt, v1i1 all-ones, v1i1 all-zeroes). That goes through some more legalization and we end up with a CMOV choosing between 0 and 1 in scalar and a scalar_to_vector.

Arguably we could detect the v1i1 BUILD_VECTOR and do this better in X86 target code. But just using a SCALAR_TO_VECTOR in legalization is much easier.

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

6 years agoImplementation of MRI "delete" command.
Dmitry Mikulin [Fri, 2 Mar 2018 23:23:48 +0000 (23:23 +0000)]
Implementation of MRI "delete" command.

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

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

6 years ago[AggressiveInstCombine] Use use_empty() instead of !getNumUses(), NFC
Vedant Kumar [Fri, 2 Mar 2018 23:22:49 +0000 (23:22 +0000)]
[AggressiveInstCombine] Use use_empty() instead of !getNumUses(), NFC

use_empty() runs in O(1), whereas getNumUses() runs in O(# uses).

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

6 years ago[InstCombine] rearrange visitFMul; NFCI
Sanjay Patel [Fri, 2 Mar 2018 23:06:45 +0000 (23:06 +0000)]
[InstCombine] rearrange visitFMul; NFCI

Put the simplest non-FMF folds first, so it's easier to
see what's left to fix/group/add with the FMF folds.

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

6 years agoAdd DBG_VALUE support to the linear DAG scheduler
Adrian Prantl [Fri, 2 Mar 2018 22:59:51 +0000 (22:59 +0000)]
Add DBG_VALUE support to the linear DAG scheduler

The fast/linear DAG scheduler doesn't lower DBG_VALUEs except for
function entry nodes.

Patch by Joshua Cranmer!

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

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

6 years ago[llvm-symbolizer] Use correct path when resolving .gnu_debuglink in .debug
Francis Ricci [Fri, 2 Mar 2018 22:56:45 +0000 (22:56 +0000)]
[llvm-symbolizer] Use correct path when resolving .gnu_debuglink in .debug

Summary:
The symbolizer was checking for .debug as a subdirectory of the
binary file itself, not of the directory containing the binary. This led to
a failure to find split debug info when it was contained in a .debug directory.

Reviewers: rnk, glider, zturner

Subscribers: llvm-commits, aprantl

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

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

6 years ago[Utils] Salvage debug info in block simplification
Vedant Kumar [Fri, 2 Mar 2018 22:46:48 +0000 (22:46 +0000)]
[Utils] Salvage debug info in block simplification

In stage2 -O3 builds of llc, this results in small but measurable
increases in the number of variables with locations, and in the number
of unique source variables overall.

(According to llvm-dwarfdump --statistics, there are 123 additional
variables with locations, which is just a 0.006% improvement).

The size of the .debug_loc section of the llc dsym increases by 0.004%.

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

6 years ago[Hexagon] Generate valignb for shifting shuffles (instead of vdelta)
Krzysztof Parzyszek [Fri, 2 Mar 2018 22:22:19 +0000 (22:22 +0000)]
[Hexagon] Generate valignb for shifting shuffles (instead of vdelta)

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

6 years ago[RISCV] Implement MC relaxations for compressed instructions.
Sameer AbuAsal [Fri, 2 Mar 2018 22:04:12 +0000 (22:04 +0000)]
[RISCV] Implement MC relaxations for compressed instructions.

Summary:
     This patch implements relaxation for RISCV in the MC layer.
      The following relaxations are currently handled:
      1) Relax C_BEQZ to BEQ and C_BNEZ to BNEZ in RISCV.
      2) Relax and C_J $imm  to JAL x0, $imm  and CJAL to JAL ra, $imm.

Reviewers: asb, llvm-commits, efriedma

Reviewed By: asb

Subscribers: shiva0217

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

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

6 years agoMake llvm::djbHash an inline function.
Rui Ueyama [Fri, 2 Mar 2018 22:00:38 +0000 (22:00 +0000)]
Make llvm::djbHash an inline function.

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

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

6 years ago[Utils] Salvage debug info in recursive inst deletion
Vedant Kumar [Fri, 2 Mar 2018 21:36:35 +0000 (21:36 +0000)]
[Utils] Salvage debug info in recursive inst deletion

In stage2 -O3 builds of llc, this results in a 0.3% increase in the
number of variables with locations, and a 0.2% increase in the number of
unique source variables overall.

The size of the .debug_loc section of the llc dsym increases by 0.5%.

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

6 years ago[unittests] Make some parseIR calls more readable, NFC
Vedant Kumar [Fri, 2 Mar 2018 21:36:33 +0000 (21:36 +0000)]
[unittests] Make some parseIR calls more readable, NFC

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

6 years ago[WebAssembly] Avoid cast ExprType to wasm::ValType
Sam Clegg [Fri, 2 Mar 2018 21:33:14 +0000 (21:33 +0000)]
[WebAssembly] Avoid cast ExprType to wasm::ValType

This cast was causing invalid signatures to be written
for libcall functions.

Add an MC test which includes a call to builtin memcpy.

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

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

6 years ago[InstCombine] Rewrite the binary op shrinking in visitFPTrunc to avoid creating overl...
Craig Topper [Fri, 2 Mar 2018 21:25:18 +0000 (21:25 +0000)]
[InstCombine] Rewrite the binary op shrinking in visitFPTrunc to avoid creating overly small ConstantFPs that we'll just need to extend again.

Instead of returning the smaller FP constant we now return the minimal Type the constant can fit into. We also return the Type of the input to any fp extends. The legality checks are then done on just the size of these Types. If we find something profitable we then emit FPTruncs in front of the smaller binop and assume those FPTruncs will be constant folded or combined with any ConstantFPs or fpextends.

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

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

6 years ago[SystemZ] Fix test cases after r326613
Ulrich Weigand [Fri, 2 Mar 2018 21:22:42 +0000 (21:22 +0000)]
[SystemZ] Fix test cases after r326613

I forgot to check in the updated test cases after the r326613 commit.

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

6 years agoReland "[WebAssembly] More uses of uint8_t for single byte values"
Heejin Ahn [Fri, 2 Mar 2018 20:52:59 +0000 (20:52 +0000)]
Reland "[WebAssembly] More uses of uint8_t for single byte values"

Summary:
Original change was D43991 (rL326541) and was reverted by rL326571 and
rL326572. This adds also the necessary MCCodeEmitter patch.

Reviewers: sbc100

Subscribers: jfb, dschuff, sbc100, jgravelle-google, sunfish, llvm-commits, ncw

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

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

6 years ago[SystemZ] Allow LRV/STRV with volatile memory accesses
Ulrich Weigand [Fri, 2 Mar 2018 20:51:59 +0000 (20:51 +0000)]
[SystemZ] Allow LRV/STRV with volatile memory accesses

The byte-swapping loads and stores do not actually perform multiple
accesses to their memory operand, so they are OK to use with volatile
memory operands as well.  Remove overly cautious check.

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

6 years ago[SystemZ] Add support for anyregcc calling convention
Ulrich Weigand [Fri, 2 Mar 2018 20:40:11 +0000 (20:40 +0000)]
[SystemZ] Add support for anyregcc calling convention

This adds back-end support for the anyregcc calling convention
for use with patchpoints.

Since all registers are considered call-saved with anyregcc
(except for 0 and 1 which may still be clobbered by PLT stubs
and the like), this required adding support for saving and
restoring vector registers in prologue/epilogue code for the
first time.  This is not used by any other calling convention.

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

6 years ago[SystemZ] Support stackmaps and patchpoints
Ulrich Weigand [Fri, 2 Mar 2018 20:39:30 +0000 (20:39 +0000)]
[SystemZ] Support stackmaps and patchpoints

This adds back-end support for the @llvm.experimental.stackmap and
@llvm.experimental.patchpoint intrinsics.

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

6 years ago[SystemZ] Fix common-code users of stack size
Ulrich Weigand [Fri, 2 Mar 2018 20:38:41 +0000 (20:38 +0000)]
[SystemZ] Fix common-code users of stack size

On SystemZ we need to provide a register save area of 160 bytes to
any called function.  This size needs to be added when allocating
stack in the function prologue.  However, it was not accounted for
as part of MachineFrameInfo::getStackSize(); instead the back-end
used a private routine getAllocatedStackSize().

This is OK for code-gen purposes, but it breaks other users of
the getStackSize() routine, in particular it breaks the recently-
added -stack-size-section feature.

Fix this by updating the main stack size tracked by common code
(in emitPrologue) instead of using the private routine.

No change in code generation intended.

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

6 years ago[SystemZ] Support vector registers in inline asm
Ulrich Weigand [Fri, 2 Mar 2018 20:36:34 +0000 (20:36 +0000)]
[SystemZ] Support vector registers in inline asm

This adds support for specifying vector registers for use with inline
asm statements, either via the 'v' constraint or by explicit register
names (v0 ... v31).

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

6 years ago[InstCombine] partly fix FMF for fmul+log2 fold
Sanjay Patel [Fri, 2 Mar 2018 20:32:46 +0000 (20:32 +0000)]
[InstCombine] partly fix FMF for fmul+log2 fold

The code was checking that all of the instructions in the
sequence are 'fast', but that's not necessary. The final
multiply is all that we need to check (tests adjusted).
The fmul doesn't need to be fully 'fast' either, but that
can be another patch.

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

6 years ago[InstCombine] add tests for rL169025; NFC
Sanjay Patel [Fri, 2 Mar 2018 19:26:13 +0000 (19:26 +0000)]
[InstCombine] add tests for rL169025; NFC

This narrow fold was added with no motivation or test cases
a bit over 5 years ago. Removing a constant operand is a
good canonicalization? We should handle Y*2.0 too then?

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

6 years agoFix more spelling mistakes in comments of LLVM Analysis passes
Vedant Kumar [Fri, 2 Mar 2018 18:57:02 +0000 (18:57 +0000)]
Fix more spelling mistakes in comments of LLVM Analysis passes

Patch by Reshabh Sharma!

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

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

6 years ago[PatternMatch, InstSimplify] fix m_NaN to work with vector constants and use it
Sanjay Patel [Fri, 2 Mar 2018 18:36:08 +0000 (18:36 +0000)]
[PatternMatch, InstSimplify] fix m_NaN to work with vector constants and use it

This is NFC for the moment (and independent of any potential NaN semantic
controversy). Besides making the code in InstSimplify easier to read, the
motivation is to eventually allow undef elements in vector constants to
match too. A proposal to add the base logic for that is in D43792.

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

6 years ago[Hexagon] Handle VACOPY in isel lowering
Krzysztof Parzyszek [Fri, 2 Mar 2018 18:35:57 +0000 (18:35 +0000)]
[Hexagon] Handle VACOPY in isel lowering

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

6 years ago[X86][BTVER2] Fix throughput of YMM bitwise instructions
Simon Pilgrim [Fri, 2 Mar 2018 18:20:35 +0000 (18:20 +0000)]
[X86][BTVER2] Fix throughput of YMM bitwise instructions

These instructions are double-pumped, split into 2 128-bit ops and then passing through either FPU pipe.

Found while testing llvm-mca (D43951)

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

6 years ago[X86] Reject xmm16-31 in inline asm constraints when AVX512 is disabled
Craig Topper [Fri, 2 Mar 2018 18:19:40 +0000 (18:19 +0000)]
[X86] Reject xmm16-31 in inline asm constraints when AVX512 is disabled

Fixes PR36532

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

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

6 years ago[InstCombine] Allow fptrunc (fpext X)) to be reduced to a single fpext/ftrunc
Craig Topper [Fri, 2 Mar 2018 18:16:51 +0000 (18:16 +0000)]
[InstCombine] Allow fptrunc (fpext X)) to be reduced to a single fpext/ftrunc

If we are only truncating bits from the extend we should be able to just use a smaller extend.

If we are truncating more than the extend we should be able to just use a fptrunc since the presense of the fpextend shouldn't affect rounding.

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

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