144949 Commits

Author SHA1 Message Date
Peter Collingbourne
049ef19b9c Address Mehdi's post-commit review comments on r294795.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 03:19:22 +00:00
Evgeny Stupachenko
d46df28e0c Fix PR23384 (under "-lsr-insns-cost" option)
Summary:
The patch adds instructions number generated by a solution
 to LSR cost under "-lsr-insns-cost" option.

Reviewers: qcolombet, hfinkel

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294821 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 02:57:43 +00:00
Ahmed Bougacha
6ea43f266f [ARM] Make f16 interleaved accesses expensive.
There are no vldN/vstN f16 variants, even with +fullfp16.
We could use the i16 variants, but, in practice, even with +fullfp16,
the f16 sequence leading to the i16 shuffle usually gets scalarized.
We'd need to improve our support for f16 codegen before getting there.

Teach the cost model to consider f16 interleaved operations as
expensive.  Otherwise, we are all but guaranteed to end up with
a large block of scalarized vector code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 01:53:04 +00:00
Ahmed Bougacha
bd8e11d920 [ARM] Don't lower f16 interleaved accesses.
There are no vldN/vstN f16 variants, even with +fullfp16.
We could use the i16 variants, but, in practice, even with +fullfp16,
the f16 sequence leading to the i16 shuffle usually gets scalarized.
We'd need to improve our support for f16 codegen before getting there.

Reject f16 interleaved accesses.  If we try to emit the f16 intrinsics,
we'll just end up with a selection failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294818 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 01:53:00 +00:00
Ahmed Bougacha
3b0192d23e [ARM] Unique some redundant CHECK lines. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 01:52:57 +00:00
Wei Mi
8b345aabb9 [LSR] Recommit: Allow formula containing Reg for SCEVAddRecExpr related with outerloop.
The recommit includes some changes of testcases. No functional change to the patch.

In RateRegister of existing LSR, if a formula contains a Reg which is a SCEVAddRecExpr,
and this SCEVAddRecExpr's loop is an outerloop, the formula will be marked as Loser
and dropped.

Suppose we have an IR that %for.body is outerloop and %for.body2 is innerloop. LSR only
handle inner loop now so only %for.body2 will be handled.

Using the logic above, formula like
reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) will be dropped
no matter what because reg({1,+, %size}<%for.body>) is a SCEVAddRecExpr type reg related
with outerloop. Only formula like
reg(%array) + 1*reg({{1,+, %size}<%for.body>,+,1}<nuw><nsw><%for.body2>) will be kept
because the SCEVAddRecExpr related with outerloop is folded into the initial value of the
SCEVAddRecExpr related with current loop.

But in some cases, we do need to share the basic induction variable
reg{0 ,+, 1}<%for.body2> among LSR Uses to reduce the final total number of induction
variables used by LSR, so we don't want to drop the formula like
reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) unconditionally.

From the existing comment, it tries to avoid considering multiple level loops at the same time.
However, existing LSR only handles innermost loop, so for any SCEVAddRecExpr with a loop other
than current loop, it is an invariant and will be simple to handle, and the formula doesn't have
to be dropped.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294814 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 00:50:23 +00:00
Eugene Zelenko
a700a60bfc [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 00:27:28 +00:00
Matthias Braun
4f013f8a83 config-ix.cmake: Search for CMAKE_XCRUN before using it.
This was previously searched in CMakeLists.txt unconditionally but as of
r294371 it is only searched in some circumstances. Repeating the search
in config-ix.cmake to make this robust and hopefully fix the macOS
Asan+Ubsan jenkins build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294811 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 00:14:01 +00:00
Chandler Carruth
44b1f84759 [PM] Fix a bug in how I ported LoopDeletion to the new PM.
This was marking the loop for deletion after the loop was deleted. This
almost works, except that when we do any kind of debug logging it starts
reading the name of the loop from deleted memory or otherwise blowing
up. This can fail in a bunch of ways. I recently added a test that
*always* does this, and it started failing on the sanitizer bots.

The fix is to mark the loop as deleted in the loop PM infrastructure
before we remove the loop. We can do this by passing the updater into
the routine. That also lets us simplify a bunch of other interface
components here for a net win.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 00:09:30 +00:00
Dan Gohman
ab20565a82 [WebAssembly] Remove old experimental disassemler code.
Remove support for disassembling an old experimental wasm binary format, which
is no longer in use anywhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 00:02:23 +00:00
Saleem Abdulrasool
c45deca1e8 vim: add returned keyword
The `returned` keyword was added in SVN r179925.  Update the vim syntax
rules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294808 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 23:57:11 +00:00
Davide Italiano
6e2d3e35b7 [LTO] Share the optimization remarks setup between Thin/Full LTO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294807 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 23:49:38 +00:00
Krzysztof Parzyszek
6eebe31eee [Hexagon] Introduce Hexagon V62
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294805 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 23:46:45 +00:00
Davide Italiano
0d336bb01a [tests] Be explicit about the files we want to remove.
Hopefully Windows will stop whining after this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294801 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:55:37 +00:00
Peter Collingbourne
446f8d76cd IR: Function summary extensions for whole-program devirtualization pass.
The summary information includes all uses of llvm.type.test and
llvm.type.checked.load intrinsics that can be used to devirtualize calls,
including any constant arguments for virtual constant propagation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:29:38 +00:00
Benjamin Kramer
53c27da76d [InstCombine] Move class into anonymous namespace. NFC.
This is necessary to avoid warnings from GCC.
InstCombineLoadStoreAlloca.cpp:238:7: error: 'PointerReplacer' declared
with greater visibility than the type of its field 'PointerReplacer::IC'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294794 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:26:35 +00:00
Davide Italiano
54c3fcaeb1 [lib/LTO] Rework optimization remarkers setup.
This makes this code much more similar to what ThinLTO is
using (also API wise), so now we can probably use a single
code path instead of copying stuff around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294792 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:16:17 +00:00
Benjamin Kramer
0746877d41 [PPC] Silence warning in Release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294791 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:13:34 +00:00
Davide Italiano
bec084b99d [LTO] Make these tests robust across multiple iterations.
Same as r294784, but for regular LTO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:11:06 +00:00
Benjamin Kramer
ae4dfb9994 [InstCombine] Silence unused variable warning in Release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294788 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:04:17 +00:00
Nico Weber
4a827800c6 Revert r294532, it caused PR31935
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294787 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 21:57:30 +00:00
Yaxun Liu
bdc2c07348 Fix invalid addrspacecast due to combining alloca with global var
For function-scope variables with large initialisation list, FE usually 
generates a global variable to hold the initializer, then generates 
memcpy intrinsic to initialize the alloca. InstCombiner::visitAllocaInst 
identifies such allocas which are accessed only by reading and replaces 
them with the global variable. This is done by casting the global variable 
to the type of the alloca and replacing all references.

However, when the global variable is in a different address space which 
is disjoint with addr space 0 (e.g. for IR generated from OpenCL, 
global variable cannot be in private addr space i.e. addr space 0), casting 
the global variable to addr space 0 results in invalid IR for certain 
targets (e.g. amdgpu).

To fix this issue, when the global variable is not in addr space 0, 
instead of casting it to addr space 0, this patch chases down the uses 
of alloca until reaching the load instructions, then replaces load from 
alloca with load from the global variable. If during the chasing 
bitcast and GEP are encountered, new bitcast and GEP based on the global 
variable are generated and used in the load instructions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294786 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 21:46:07 +00:00
Davide Italiano
a613077da7 [ThinLTO] Make this test more robust across multiple runs.
The yaml emitter files are left around otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294784 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 21:35:31 +00:00
Tim Shen
f803c25d0f Fix a silly syntax error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294783 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 21:17:35 +00:00
Dehao Chen
d0b28d942d Encode duplication factor from loop vectorization and loop unrolling to discriminator.
Summary:
This patch starts the implementation as discuss in the following RFC: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106532.html

When optimization duplicates code that will scale down the execution count of a basic block, we will record the duplication factor as part of discriminator so that the offline process tool can find the duplication factor and collect the accurate execution frequency of the corresponding source code. Two important optimization that fall into this category is loop vectorization and loop unroll. This patch records the duplication factor for these 2 optimizations.

The recording will be guarded by a flag encode-duplication-in-discriminators, which is off by default.

Reviewers: probinson, aprantl, davidxl, hfinkel, echristo

Reviewed By: hfinkel

Subscribers: mehdi_amini, anemet, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294782 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 21:09:07 +00:00
Tim Shen
2c44e216a8 [XRay] Implement powerpc64le xray.
Summary:
powerpc64 big-endian is not supported, but I believe that most logic can
be shared, except for xray_powerpc64.cc.

Also add a function InvalidateInstructionCache to xray_util.h, which is
copied from llvm/Support/Memory.cpp. I'm not sure if I need to add a unittest,
and I don't know how.

Reviewers: dberris, echristo, iteratee, kbarton, hfinkel

Subscribers: mehdi_amini, nemanjai, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294781 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 21:03:24 +00:00
Krzysztof Parzyszek
24b6cb2e66 [Hexagon] Remove unused .td files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 19:54:00 +00:00
Ahmed Bougacha
d0491a6b56 [X86] Bitcast subvector before broadcasting it.
Since r274013, we've been looking through bitcasts on broadcast inputs.
In the scalar-folding case (from a load, build_vector, or sc2vec),
the input type didn't matter, as we'd simply bitcast the resulting
scalar back.

However, when broadcasting a 128-bit-lane-aligned element, we create an
EXTRACT_SUBVECTOR.  Use proper types, by creating an extract_subvector
of the original input type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294774 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 19:51:47 +00:00
Kevin Enderby
0aa6910479 Yet another fix llvm-objdump so it picks a good CPU based for Mach-O files,
in this case for CPU_SUBTYPE_ARM64_ALL.

For this cpusubtype it should default to a cyclone CPU
to give proper disassembly without a -mcpu= flag.

rdar://27767188


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294771 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 19:27:10 +00:00
Tim Northover
10fde8b13b GlobalISel: drop lifetime intrinsics during translation.
We don't use them yet and they just cause problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294770 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 19:10:38 +00:00
Marcos Pividori
fc4c8411e4 [libFuzzer] Use stoull instead of stol to ensure 64 bits.
Differential revision: https://reviews.llvm.org/D29831

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294769 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 18:44:14 +00:00
Simon Pilgrim
b5a88e2e66 [X86][AVX512] Add vector rotate tests for AVX512 targets
AVX512 does have vector rotate instructions, but we don't lower to them yet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294766 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 18:06:11 +00:00
Amaury Sechet
863a782973 Autogenerate results for test/CodeGen/X86/peep-test-4.ll . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294765 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 17:57:48 +00:00
Amaury Sechet
ab097ffb48 Autogenerate results for test/CodeGen/X86/pr14314.ll . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294764 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 17:57:46 +00:00
John Brawn
b0221e3835 [ARM] Fix incorrect mask bits in MSR encoding for write_register intrinsic
In the encoding of system registers in the M-class MSR instruction the mask bits
should be 2 for registers that don't take a _<bits> qualifier (the instruction
is unpredictable otherwise), and should also be 2 if the register takes a
_<bits> qualifier but it's not present as no _<bits> is an alias for _nzcvq.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294762 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 17:41:08 +00:00
Amaury Sechet
4bf44e4313 Use autogenerate check in CodeGen/X86/pr16031.ll . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294761 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 17:26:21 +00:00
Mehdi Amini
00b42cc2f1 Fix doc for -opt-bisect-limit: the LTO option prefix for lld is -mllvm
Thanks Davide to catch it in my previous patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294759 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 17:16:00 +00:00
Alexander Kornienko
d3cc1f35e3 Add a virtual destructor for LegalizerInfo.
lib/Target/X86/X86TargetMachine.cpp has a code that deletes an instance of a
LegalizerInfo descendant via a pointer to base.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 17:00:27 +00:00
Amaury Sechet
6553e7c818 Check full codegen in CodeGen/X86/i256-add.ll NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294756 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 16:34:17 +00:00
Matthew Simpson
21785b88f9 [LV] Remove type restriction for vector phi creation
We previously only created a vector phi node for an induction variable if its
type matched the type of the canonical induction variable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294755 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 16:15:26 +00:00
Krzysztof Parzyszek
7f4371b614 [Hexagon] Replace instruction definitions with auto-generated ones
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294753 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 15:33:13 +00:00
Rafael Espindola
940b0c036d Move some error handling down to MCStreamer.
This makes sure we get the same redefinition rules regardless of who
is printing (asm parser, codegen) and to what (asm, obj).

This fixes an unintentional regression in r293936.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294752 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 15:13:12 +00:00
Simon Pilgrim
e5cabf7c4a [X86][SSE] Added chained FDIV test cases for D26855
Tests to demonstrate throughput-latency decision between div and rcp on faster hardware such as Haswell

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 14:56:12 +00:00
Simon Pilgrim
ada0a4f5b0 [DAGCombine] Allow vector constant folding of any value type before type legalization
The patch comes in 2 parts:

1 - it makes use of the SelectionDAG::NewNodesMustHaveLegalTypes flag to tell when it can safely constant fold illegal types.

2 - it correctly resets SelectionDAG::NewNodesMustHaveLegalTypes at the start of each call to SelectionDAGISel::CodeGenAndEmitDAG so all the pre-legalization stages can make use of it - not just the first basic block that gets handled.

Fix for PR30760

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294749 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 14:37:25 +00:00
Simon Pilgrim
3545163cb2 [X86][SSE] Use SDValue::getConstantOperandVal helper. NFCI.
Also reordered an if statement to test low cost comparisons first

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294748 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 14:27:59 +00:00
Simon Pilgrim
c86c991488 [X86][SSE] Add support for extracting target constants from BUILD_VECTOR
In some cases we call getTargetConstantBitsFromNode for nodes that haven't been lowered from BUILD_VECTOR yet

Note: We're getting very close to being able to move most of the constant extraction code from getTargetShuffleMaskIndices into getTargetConstantBitsFromNode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294746 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 14:04:11 +00:00
Simon Pilgrim
8336fc6508 [X86][SSE] Add missing comment describing combing to SHUFPS. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294745 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 13:16:01 +00:00
Chandler Carruth
350138bff9 [PM] Relax the patterns used in the new test I added because some
compilers don't print the typedef name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294729 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 08:48:50 +00:00
Chandler Carruth
1587018791 [PM] Fix a bug in the new loop PM when handling functions with no loops.
Without any loops, we don't even bother to build the standard analyses
used by loop passes. Without these, we can't run loop analyses or
invalidate them properly. Unfortunately, we did these things in the
wrong order which would allow a loop analysis manager's proxy to be
built but then not have the standard analyses built. When we went to do
the invalidation in the proxy thing would fall apart. In the test case
provided, it would actually crash.

The fix is to carefully check for loops first, and to in fact build the
standard analyses before building the proxy. This allows it to
correctly trigger invalidation for those standard analyses.

An alternative might seem to be  to look at whether there are any loops
when doing invalidation, but this doesn't work when during the loop
pipeline run we delete the last loop. I've even included that as a test
case. It is both simpler and more robust to defer building the proxy
until there are definitely the standard set of analyses and indeed
loops.

This bug was uncovered by enabling GlobalsAA in the pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 08:26:58 +00:00
Igor Breger
f062b89364 add #ifdef, fix compilation error in case LLVM_BUILD_GLOBAL_ISEL=OFF
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294726 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 07:33:14 +00:00