OSDN Git Service

android-x86/external-llvm.git
7 years ago[X86] Don't base domain decisions on VEXTRACTF128/VINSERTF128 if only AVX1 is available.
Craig Topper [Sat, 11 Feb 2017 05:32:57 +0000 (05:32 +0000)]
[X86] Don't base domain decisions on VEXTRACTF128/VINSERTF128 if only AVX1 is available.

Seems the execution dependency pass likes to use FP instructions when most of the consuming code is integer if a vextractf128 instruction produced the register. Without AVX2 we don't have the corresponding integer instruction available.

This patch suppresses the domain on these instructions to GenericDomain if AVX2 is not supported so that they are ignored by domain fixing. If AVX2 is supported we'll report the correct domain and allow them to switch between integer and fp.

Overall I think this produces better results in the modified test cases.

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

7 years agoAddress Mehdi's post-commit review comments on r294795.
Peter Collingbourne [Sat, 11 Feb 2017 03:19:22 +0000 (03:19 +0000)]
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

7 years agoFix PR23384 (under "-lsr-insns-cost" option)
Evgeny Stupachenko [Sat, 11 Feb 2017 02:57:43 +0000 (02:57 +0000)]
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

7 years ago[ARM] Make f16 interleaved accesses expensive.
Ahmed Bougacha [Sat, 11 Feb 2017 01:53:04 +0000 (01:53 +0000)]
[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

7 years ago[ARM] Don't lower f16 interleaved accesses.
Ahmed Bougacha [Sat, 11 Feb 2017 01:53:00 +0000 (01:53 +0000)]
[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

7 years ago[ARM] Unique some redundant CHECK lines. NFC.
Ahmed Bougacha [Sat, 11 Feb 2017 01:52:57 +0000 (01:52 +0000)]
[ARM] Unique some redundant CHECK lines. NFC.

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

7 years ago[LSR] Recommit: Allow formula containing Reg for SCEVAddRecExpr related with outerloop.
Wei Mi [Sat, 11 Feb 2017 00:50:23 +0000 (00:50 +0000)]
[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

7 years ago[MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Sat, 11 Feb 2017 00:27:28 +0000 (00:27 +0000)]
[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

7 years agoconfig-ix.cmake: Search for CMAKE_XCRUN before using it.
Matthias Braun [Sat, 11 Feb 2017 00:14:01 +0000 (00:14 +0000)]
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

7 years ago[PM] Fix a bug in how I ported LoopDeletion to the new PM.
Chandler Carruth [Sat, 11 Feb 2017 00:09:30 +0000 (00:09 +0000)]
[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

7 years ago[WebAssembly] Remove old experimental disassemler code.
Dan Gohman [Sat, 11 Feb 2017 00:02:23 +0000 (00:02 +0000)]
[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

7 years agovim: add `returned` keyword
Saleem Abdulrasool [Fri, 10 Feb 2017 23:57:11 +0000 (23:57 +0000)]
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

7 years ago[LTO] Share the optimization remarks setup between Thin/Full LTO.
Davide Italiano [Fri, 10 Feb 2017 23:49:38 +0000 (23:49 +0000)]
[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

7 years ago[Hexagon] Introduce Hexagon V62
Krzysztof Parzyszek [Fri, 10 Feb 2017 23:46:45 +0000 (23:46 +0000)]
[Hexagon] Introduce Hexagon V62

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

7 years ago[tests] Be explicit about the files we want to remove.
Davide Italiano [Fri, 10 Feb 2017 22:55:37 +0000 (22:55 +0000)]
[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

7 years agoIR: Function summary extensions for whole-program devirtualization pass.
Peter Collingbourne [Fri, 10 Feb 2017 22:29:38 +0000 (22:29 +0000)]
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

7 years ago[InstCombine] Move class into anonymous namespace. NFC.
Benjamin Kramer [Fri, 10 Feb 2017 22:26:35 +0000 (22:26 +0000)]
[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

7 years ago[lib/LTO] Rework optimization remarkers setup.
Davide Italiano [Fri, 10 Feb 2017 22:16:17 +0000 (22:16 +0000)]
[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

7 years ago[PPC] Silence warning in Release builds.
Benjamin Kramer [Fri, 10 Feb 2017 22:13:34 +0000 (22:13 +0000)]
[PPC] Silence warning in Release builds.

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

7 years ago[LTO] Make these tests robust across multiple iterations.
Davide Italiano [Fri, 10 Feb 2017 22:11:06 +0000 (22:11 +0000)]
[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

7 years ago[InstCombine] Silence unused variable warning in Release builds.
Benjamin Kramer [Fri, 10 Feb 2017 22:04:17 +0000 (22:04 +0000)]
[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

7 years agoRevert r294532, it caused PR31935
Nico Weber [Fri, 10 Feb 2017 21:57:30 +0000 (21:57 +0000)]
Revert r294532, it caused PR31935

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

7 years agoFix invalid addrspacecast due to combining alloca with global var
Yaxun Liu [Fri, 10 Feb 2017 21:46:07 +0000 (21:46 +0000)]
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

7 years ago[ThinLTO] Make this test more robust across multiple runs.
Davide Italiano [Fri, 10 Feb 2017 21:35:31 +0000 (21:35 +0000)]
[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

7 years agoFix a silly syntax error.
Tim Shen [Fri, 10 Feb 2017 21:17:35 +0000 (21:17 +0000)]
Fix a silly syntax error.

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

7 years agoEncode duplication factor from loop vectorization and loop unrolling to discriminator.
Dehao Chen [Fri, 10 Feb 2017 21:09:07 +0000 (21:09 +0000)]
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

7 years ago[XRay] Implement powerpc64le xray.
Tim Shen [Fri, 10 Feb 2017 21:03:24 +0000 (21:03 +0000)]
[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

7 years ago[Hexagon] Remove unused .td files
Krzysztof Parzyszek [Fri, 10 Feb 2017 19:54:00 +0000 (19:54 +0000)]
[Hexagon] Remove unused .td files

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

7 years ago[X86] Bitcast subvector before broadcasting it.
Ahmed Bougacha [Fri, 10 Feb 2017 19:51:47 +0000 (19:51 +0000)]
[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

7 years agoYet another fix llvm-objdump so it picks a good CPU based for Mach-O files,
Kevin Enderby [Fri, 10 Feb 2017 19:27:10 +0000 (19:27 +0000)]
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

7 years agoGlobalISel: drop lifetime intrinsics during translation.
Tim Northover [Fri, 10 Feb 2017 19:10:38 +0000 (19:10 +0000)]
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

7 years ago[libFuzzer] Use stoull instead of stol to ensure 64 bits.
Marcos Pividori [Fri, 10 Feb 2017 18:44:14 +0000 (18:44 +0000)]
[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

7 years ago[X86][AVX512] Add vector rotate tests for AVX512 targets
Simon Pilgrim [Fri, 10 Feb 2017 18:06:11 +0000 (18:06 +0000)]
[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

7 years agoAutogenerate results for test/CodeGen/X86/peep-test-4.ll . NFC
Amaury Sechet [Fri, 10 Feb 2017 17:57:48 +0000 (17:57 +0000)]
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

7 years agoAutogenerate results for test/CodeGen/X86/pr14314.ll . NFC
Amaury Sechet [Fri, 10 Feb 2017 17:57:46 +0000 (17:57 +0000)]
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

7 years ago[ARM] Fix incorrect mask bits in MSR encoding for write_register intrinsic
John Brawn [Fri, 10 Feb 2017 17:41:08 +0000 (17:41 +0000)]
[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

7 years agoUse autogenerate check in CodeGen/X86/pr16031.ll . NFC
Amaury Sechet [Fri, 10 Feb 2017 17:26:21 +0000 (17:26 +0000)]
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

7 years agoFix doc for `-opt-bisect-limit`: the LTO option prefix for lld is -mllvm
Mehdi Amini [Fri, 10 Feb 2017 17:16:00 +0000 (17:16 +0000)]
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

7 years agoAdd a virtual destructor for LegalizerInfo.
Alexander Kornienko [Fri, 10 Feb 2017 17:00:27 +0000 (17:00 +0000)]
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

7 years agoCheck full codegen in CodeGen/X86/i256-add.ll NFC
Amaury Sechet [Fri, 10 Feb 2017 16:34:17 +0000 (16:34 +0000)]
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

7 years ago[LV] Remove type restriction for vector phi creation
Matthew Simpson [Fri, 10 Feb 2017 16:15:26 +0000 (16:15 +0000)]
[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

7 years ago[Hexagon] Replace instruction definitions with auto-generated ones
Krzysztof Parzyszek [Fri, 10 Feb 2017 15:33:13 +0000 (15:33 +0000)]
[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

7 years agoMove some error handling down to MCStreamer.
Rafael Espindola [Fri, 10 Feb 2017 15:13:12 +0000 (15:13 +0000)]
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

7 years ago[X86][SSE] Added chained FDIV test cases for D26855
Simon Pilgrim [Fri, 10 Feb 2017 14:56:12 +0000 (14:56 +0000)]
[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

7 years ago[DAGCombine] Allow vector constant folding of any value type before type legalization
Simon Pilgrim [Fri, 10 Feb 2017 14:37:25 +0000 (14:37 +0000)]
[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

7 years ago[X86][SSE] Use SDValue::getConstantOperandVal helper. NFCI.
Simon Pilgrim [Fri, 10 Feb 2017 14:27:59 +0000 (14:27 +0000)]
[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

7 years ago[X86][SSE] Add support for extracting target constants from BUILD_VECTOR
Simon Pilgrim [Fri, 10 Feb 2017 14:04:11 +0000 (14:04 +0000)]
[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

7 years ago[X86][SSE] Add missing comment describing combing to SHUFPS. NFCI
Simon Pilgrim [Fri, 10 Feb 2017 13:16:01 +0000 (13:16 +0000)]
[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

7 years ago[PM] Relax the patterns used in the new test I added because some
Chandler Carruth [Fri, 10 Feb 2017 08:48:50 +0000 (08:48 +0000)]
[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

7 years ago[PM] Fix a bug in the new loop PM when handling functions with no loops.
Chandler Carruth [Fri, 10 Feb 2017 08:26:58 +0000 (08:26 +0000)]
[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

7 years agoadd #ifdef, fix compilation error in case LLVM_BUILD_GLOBAL_ISEL=OFF
Igor Breger [Fri, 10 Feb 2017 07:33:14 +0000 (07:33 +0000)]
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

7 years agoFix doc for `-opt-bisect-limit`: the LTO option is linker specific
Mehdi Amini [Fri, 10 Feb 2017 07:21:06 +0000 (07:21 +0000)]
Fix doc for `-opt-bisect-limit`: the LTO option is linker specific

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

7 years ago[X86][GlobalISel] Add general-purpose Register Bank
Igor Breger [Fri, 10 Feb 2017 07:05:56 +0000 (07:05 +0000)]
[X86][GlobalISel] Add general-purpose Register Bank

Summary:
[X86][GlobalISel] Add general-purpose Register Bank.
Add trivial  handling of G_ADD legalization .
Add Regestry Bank selection for COPY and G_ADD  instructions

Reviewers: rovka, zvi, ab, t.p.northover, qcolombet

Reviewed By: qcolombet

Subscribers: qcolombet, mgorny, dberris, kristof.beyls, llvm-commits

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

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

7 years ago[XRay][graph] Disambiguate name of type from member name
Dean Michael Berris [Fri, 10 Feb 2017 06:59:25 +0000 (06:59 +0000)]
[XRay][graph] Disambiguate name of type from member name

Follow-up to D29005.

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

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

7 years ago[XRay] A graph Class for the llvm-xray graph
Dean Michael Berris [Fri, 10 Feb 2017 06:36:08 +0000 (06:36 +0000)]
[XRay] A graph Class for the llvm-xray graph

Summary:
In preparation for graph comparison and filtering, this is a library for
representing graphs in LLVM. This will enable easier encapsulation and reuse
of graphs in llvm-xray.

Depends on D28999, D28225

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

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

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

7 years ago[LoopUnswitch] Remove BFI usage (dead code)
Philip Reames [Fri, 10 Feb 2017 06:12:06 +0000 (06:12 +0000)]
[LoopUnswitch] Remove BFI usage (dead code)

Chandler mentioned at the last social that the need for BFI in the new pass manager was causing a slight hiccup for this pass.  Given this code has been checked in, but off for over a year, it makes sense to just remove it for now.

Note that there's nothing wrong with the general idea - it's actually a quite good one - and once we have the infrastructure in place to implement this without the full recompuation on every loop, we absolutely should.

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

7 years agoRevert "[XRay] A graph Class for the llvm-xray graph"
Dean Michael Berris [Fri, 10 Feb 2017 06:05:46 +0000 (06:05 +0000)]
Revert "[XRay] A graph Class for the llvm-xray graph"

Broke tests, reverting.

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

7 years ago[XRay] A graph Class for the llvm-xray graph
Dean Michael Berris [Fri, 10 Feb 2017 05:40:37 +0000 (05:40 +0000)]
[XRay] A graph Class for the llvm-xray graph

Summary:
In preparation for graph comparison and filtering, this is a library for
representing graphs in LLVM. This will enable easier encapsulation and reuse
of graphs in llvm-xray.

Depends on D28999, D28225

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

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

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

7 years ago[SelectionDAG] Dump the DAG after legalizing vector ops and after the second type...
Craig Topper [Fri, 10 Feb 2017 05:05:57 +0000 (05:05 +0000)]
[SelectionDAG] Dump the DAG after legalizing vector ops and after the second type legalization

Summary:
With -debug, we aren't dumping the DAG after legalizing vector ops. In particular, on X86 with AVX1 only, we don't dump the DAG after we split 256-bit integer ops into pairs of 128-bit ADDs since this occurs during vector legalization.

I'm only dumping if the legalize vector ops changes something since we don't print anything during legalize vector ops. So this dump shows up right after the first type-legalization dump happens. So if nothing changed this second dump is unnecessary.

Having said that though, I think we should probably fix legalize vector ops to log what its doing.

Reviewers: RKSimon, eli.friedman, spatel, arsenm, chandlerc

Reviewed By: RKSimon

Subscribers: wdng, llvm-commits

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

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

7 years agoopt-viewer: fix HtmlFormatter encoding
Adam Nemet [Fri, 10 Feb 2017 04:50:18 +0000 (04:50 +0000)]
opt-viewer: fix HtmlFormatter encoding

Summary: Small fix to HtmlFormatter, defaults to ascii encoding, so utf-8 output may get `UnicodeEncodeError: 'ascii' codec can't encode character ... ordinal not in range(128)` during write.

Patch by Brian Cain!

Reviewers: anemet, fhahn

Reviewed By: anemet

Subscribers: llvm-commits

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

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

7 years agoTemporarily revert "For X86-64 linux and PPC64 linux align int128 to 16 bytes."
Eric Christopher [Fri, 10 Feb 2017 04:35:32 +0000 (04:35 +0000)]
Temporarily revert "For X86-64 linux and PPC64 linux align int128 to 16 bytes."
until we can get better TargetMachine::isCompatibleDataLayout to compare - otherwise
we can't code generate existing bitcode without a string equality data layout.

This reverts commit r294702.

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

7 years ago[GlobalISel] Return an Expected<RuleMatcher> for each SDAG pattern. NFC.
Ahmed Bougacha [Fri, 10 Feb 2017 04:00:17 +0000 (04:00 +0000)]
[GlobalISel] Return an Expected<RuleMatcher> for each SDAG pattern. NFC.

Instead of emitting the matcher code directly, return the rule matcher
and the skip reason as an Expected<RuleMatcher>.

This will let us record all matchers and process them before emission.

It's a somewhat unconventional use of Error, but it's nicer than, say,
std::pair, because of the bool conversions.

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

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

7 years agoSubtargetFeature: Increase MAX_SUBTARGET_FEATURES
Matthias Braun [Fri, 10 Feb 2017 03:48:50 +0000 (03:48 +0000)]
SubtargetFeature: Increase MAX_SUBTARGET_FEATURES

The ARM target is getting really close to the current limit of 128
subtarget features already breaking out of tree enhancements. Increase
the size once more to 196.

I filed http://llvm.org/PR31926 to request a proper solution.

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

7 years agoFor X86-64 linux and PPC64 linux align int128 to 16 bytes.
Eric Christopher [Fri, 10 Feb 2017 03:32:21 +0000 (03:32 +0000)]
For X86-64 linux and PPC64 linux align int128 to 16 bytes.

For other platforms we should find out what they need and likely
make the same change, however, a smaller additional change is easier
for platforms we know have it specified in the ABI. As part of this
rewrite some of the handling in the backends for data layout and update
a bunch of testcases.

Based on a patch by Simonas Kazlauskas!

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

7 years ago[TableGen][AsmWriterEmitter] Use a deterministic order to sort InstrAliases
Quentin Colombet [Fri, 10 Feb 2017 02:43:09 +0000 (02:43 +0000)]
[TableGen][AsmWriterEmitter] Use a deterministic order to sort InstrAliases

Inside an alias group, when ordering instruction aliases, we rely
on the priority field to sort them.
When the priority is not set or more generally when there is a tie between
two aliases, we used to rely on the lexicographic order. However, this
order can change for the anonymous records when more instruction, intrinsic,
etc. are inserted.

For instance, given two anonymous records r1 and r2 with respective name
A_999 and A_1000, their lexicography order will be r2 then r1. Now, if
an instruction is added before them, their name will become respectively
A_1000 and A_1001, thus the lexicography order will be r1 then r2, i.e.,
it changed.

If that happens in an alias group, the assembly output would prefer a
different alias for no apparent good reasons.

A way to fix that is to use proper priority for all aliases, but we
can also make the tie breaker comparison smarter and use a deterministic
ordering. This is what this patch does.

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

7 years agoAMDGPU: Fix trailing whitespace
Matt Arsenault [Fri, 10 Feb 2017 02:42:31 +0000 (02:42 +0000)]
AMDGPU: Fix trailing whitespace

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

7 years agoAMDGPU : Add trap handler support.
Wei Ding [Fri, 10 Feb 2017 02:15:29 +0000 (02:15 +0000)]
AMDGPU : Add trap handler support.

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

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

7 years ago[AMDGPU] Override PSet for M0
Stanislav Mekhanoshin [Fri, 10 Feb 2017 02:07:58 +0000 (02:07 +0000)]
[AMDGPU] Override PSet for M0

This change returns empty PSet list for M0 register. Otherwise its
PSet as defined by tablegen is SReg_32. This results in incorrect
register pressure calculation every time an instruction uses M0.
Such uses count as SReg_32 PSet and inadequately increase pressure
on SGPRs.

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

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

7 years ago[CMake] Fix pthread handling for out-of-tree builds
Eric Fiselier [Fri, 10 Feb 2017 01:59:20 +0000 (01:59 +0000)]
[CMake] Fix pthread handling for out-of-tree builds

LLVM defines `PTHREAD_LIB` which is used by AddLLVM.cmake and various projects
to correctly link the threading library when needed. Unfortunately
`PTHREAD_LIB` is defined by LLVM's `config-ix.cmake` file which isn't installed
and therefore can't be used when configuring out-of-tree builds. This causes
such builds to fail since `pthread` isn't being correctly linked.

This patch attempts to fix that problem by renaming and exporting
`LLVM_PTHREAD_LIB` as part of`LLVMConfig.cmake`. I renamed `PTHREAD_LIB`
because It seemed likely to cause collisions with downstream users of
`LLVMConfig.cmake`.

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

7 years ago[libFuzzer] Export external functions on tests.
Marcos Pividori [Fri, 10 Feb 2017 01:40:28 +0000 (01:40 +0000)]
[libFuzzer] Export external functions on tests.

We need to export external functions so they are found when calling
GetProcAddress() on Windows. But we can't use `__declspec(dllexport)` because
we want the targets to be completely independent from the fuzz engines and don't
depend on other header files. Also, we don't want to include platform specific
code managed with conditional macros.
So, the solution is to add the exported symbols with linker flags in cmake.

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

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

7 years ago[libFuzzer] Use dynamic loading for External Functions on Windows.
Marcos Pividori [Fri, 10 Feb 2017 01:35:46 +0000 (01:35 +0000)]
[libFuzzer] Use dynamic loading for External Functions on Windows.

Replace weak aliases with dynamic loading.
Weak aliases were generating some problems when linking for MT on Windows. For
MT, compiler-rt's libraries are statically linked to the main executable the
same than libFuzzer, so if we use weak aliases, we are providing two different
default implementations for the same weak function and the linker fails.

In this diff I re implement ExternalFunctions() using dynamic loading, so it
works in both cases (MD and MT). Also, dynamic loading is simpler, since we are
not defining any auxiliary external function, and we don't need to deal with
weak aliases.
This is equivalent to the implementation using dlsym(RTLD_DEFAULT, FnName) for
Posix.

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

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

7 years agoUpdate test/CodeGen/X86/sse-align-10.ll to use FileCheck instead of grep
David L. Jones [Fri, 10 Feb 2017 01:35:31 +0000 (01:35 +0000)]
Update test/CodeGen/X86/sse-align-10.ll to use FileCheck instead of grep

Patch by Jorge Gorbe (lethalantidote).

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

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

7 years ago[MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Fri, 10 Feb 2017 01:33:54 +0000 (01:33 +0000)]
[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@294685 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LoadCombine] Change test to not use instcombine.
Michael J. Spencer [Fri, 10 Feb 2017 00:44:08 +0000 (00:44 +0000)]
[LoadCombine] Change test to not use instcombine.

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

7 years ago[WebAssembly] Pass an MCContext to WebAssemblyMCCodeEmitter. NFC.
Dan Gohman [Fri, 10 Feb 2017 00:14:42 +0000 (00:14 +0000)]
[WebAssembly] Pass an MCContext to WebAssemblyMCCodeEmitter. NFC.

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

7 years agoFix syntax error
Matthias Braun [Fri, 10 Feb 2017 00:09:20 +0000 (00:09 +0000)]
Fix syntax error

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

7 years agoARMSubtarget.h: Change to one line per enum element; NFC
Matthias Braun [Fri, 10 Feb 2017 00:06:44 +0000 (00:06 +0000)]
ARMSubtarget.h: Change to one line per enum element; NFC

Change syntax to have enum elements sorted alphabetically and one per
line as that is more merge/cherry pick friendly.

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

7 years ago[Support] Extend SLEB128 encoding support.
Dan Gohman [Fri, 10 Feb 2017 00:02:58 +0000 (00:02 +0000)]
[Support] Extend SLEB128 encoding support.

Add support for padded SLEB128 values, and support for writing SLEB128
values to buffers rather than to ostreams, similar to the existing
ULEB128 support.

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

7 years agoAdd an additional set of braces to deal with subobject initialization.
Eric Christopher [Fri, 10 Feb 2017 00:02:09 +0000 (00:02 +0000)]
Add an additional set of braces to deal with subobject initialization.

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

7 years agodocs/conf.py: Suppress sphinx highlighting failure warnings
Matthias Braun [Fri, 10 Feb 2017 00:00:22 +0000 (00:00 +0000)]
docs/conf.py: Suppress sphinx highlighting failure warnings

The pygments syntax highlighting package used by sphinx fails to parse
newer LLVM constructs or valid (at least to me) gas constructs like
`.secrel32 _function_name + 0`.

Disable this particular warning so the build doesn't abort as fixing
pygments doesn't seem a workable option here.

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

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

7 years ago[PM] Add Argument Promotion to the pass pipeline.
Chandler Carruth [Thu, 9 Feb 2017 23:54:57 +0000 (23:54 +0000)]
[PM] Add Argument Promotion to the pass pipeline.

This needs explicit requires of the optimization remark emission before
loop pass pipelines containing LICM as we no longer get it from the
inliner -- Argument Promotion may invalidate it. Technically the inliner
could also have broken this, but it never came up in testing.

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

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

7 years ago[NewGVN] Fix test so that it doesn't rely on InstCombine anymore.
Davide Italiano [Thu, 9 Feb 2017 23:48:10 +0000 (23:48 +0000)]
[NewGVN] Fix test so that it doesn't rely on InstCombine anymore.

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

7 years ago[PM] Port ArgumentPromotion to the new pass manager.
Chandler Carruth [Thu, 9 Feb 2017 23:46:27 +0000 (23:46 +0000)]
[PM] Port ArgumentPromotion to the new pass manager.

Now that the call graph supports efficient replacement of a function and
spurious reference edges, we can port ArgumentPromotion to the new pass
manager very easily.

The old PM-specific bits are sunk into callbacks that the new PM simply
doesn't use. Unlike the old PM, the new PM simply does argument
promotion and afterward does the update to LCG reflecting the promoted
function.

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

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

7 years agoWholeProgramDevirt: Check that VCP candidate functions are defined before evaluating...
Peter Collingbourne [Thu, 9 Feb 2017 23:46:26 +0000 (23:46 +0000)]
WholeProgramDevirt: Check that VCP candidate functions are defined before evaluating them.

This was crashing before.

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

7 years agoLowerMemIntrinsics: Fix include guard
Matthias Braun [Thu, 9 Feb 2017 23:43:28 +0000 (23:43 +0000)]
LowerMemIntrinsics: Fix include guard

I hope this fixes the clang-stage2-cmake-modules jenkins build.

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

7 years ago[PM/LCG] Teach LCG to support spurious reference edges.
Chandler Carruth [Thu, 9 Feb 2017 23:30:14 +0000 (23:30 +0000)]
[PM/LCG] Teach LCG to support spurious reference edges.

Somewhat amazingly, this only requires teaching it to clean them up when
deleting a dead function from the graph. And we already have exactly the
necessary data structures to do that in the parent RefSCCs.

This allows ArgPromote to work in a much simpler way be merely letting
reference edges linger in the graph after the causing IR is deleted. We
will clean up these edges when we run any function pass over the IR, but
don't remove them eagerly.

This avoids all of the quadratic update issues both in the current pass
manager and in my previous attempt with the new pass manager.

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

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

7 years ago[ARM] Add support for armv7ve triple in llvm (PR31358).
George Burgess IV [Thu, 9 Feb 2017 23:29:14 +0000 (23:29 +0000)]
[ARM] Add support for armv7ve triple in llvm (PR31358).

Gcc supports target armv7ve which is armv7-a with virtualization
extensions. This change adds support for this in llvm for gcc
compatibility.

Also remove redundant FeatureHWDiv, FeatureHWDivARM for a few models as
this is specified automatically by FeatureVirtualization.

Patch by Manoj Gupta.

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

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

7 years ago[PM/LCG] Teach the LazyCallGraph how to replace a function without
Chandler Carruth [Thu, 9 Feb 2017 23:24:13 +0000 (23:24 +0000)]
[PM/LCG] Teach the LazyCallGraph how to replace a function without
disturbing the graph or having to update edges.

This is motivated by porting argument promotion to the new pass manager.
Because of how LLVM IR Function objects work, in order to change their
signature a new object needs to be created. This is efficient and
straight forward in the IR but previously was very hard to implement in
LCG. We could easily replace the function a node in the graph
represents. The challenging part is how to handle updating the edges in
the graph.

LCG previously used an edge to a raw function to represent a node that
had not yet been scanned for calls and references. This was the core
of its laziness. However, that model causes this kind of update to be
very hard:
1) The keys to lookup an edge need to be `Function*`s that would all
   need to be updated when we update the node.
2) There will be some unknown number of edges that haven't transitioned
   from `Function*` edges to `Node*` edges.

All of this complexity isn't necessary. Instead, we can always build
a node around any function, always pointing edges at it and always using
it as the key to lookup an edge. To maintain the laziness, we need to
sink the *edges* of a node into a secondary object and explicitly model
transitioning a node from empty to populated by scanning the function.
This design seems much cleaner in a number of ways, but importantly
there is now exactly *one* place where the `Function*` has to be
updated!

Some other cleanups that fall out of this include having something to
model the *entry* edges more accurately. Rather than hand rolling parts
of the node in the graph itself, we have an explicit `EdgeSequence`
object that gives us exactly the functionality needed. We also have
a consistent place to define the edge iterators and can use them for
both the entry edges and the internal edges of the graph.

The API used to model the separation between a node and its edges is
intentionally very thin as most clients are expected to deal with nodes
that have populated edges. We model this exactly as an optional does
with an additional method to populate the edges when that is
a reasonable thing for a client to do. This is based on API design
suggestions from Richard Smith and David Blaikie, credit goes to them
for helping pick how to model this without it being either too explicit
or too implicit.

The patch is somewhat noisy due to shifting around iterator types and
new syntax for walking the edges of a node, but most of the
functionality change is in the `Edge`, `EdgeSequence`, and `Node` types.

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

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

7 years ago[WebAssembly] Refactor void return peephole using MaybeRewriteToFallthrough. NFC.
Dan Gohman [Thu, 9 Feb 2017 23:19:03 +0000 (23:19 +0000)]
[WebAssembly] Refactor void return peephole using MaybeRewriteToFallthrough. NFC.

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

7 years ago[InstCombine] allow (X * C2) << C1 --> X * (C2 << C1) for vectors
Sanjay Patel [Thu, 9 Feb 2017 23:13:04 +0000 (23:13 +0000)]
[InstCombine] allow (X * C2) << C1 --> X * (C2 << C1) for vectors

This fold already existed for vectors but only when 'C1' was a splat
constant (but 'C2' could be any constant).

There were no tests for any vector constants, so I'm adding a test
that shows non-splat constants for both operands.

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

7 years agoDe-duplicate some code for creating an AARGetter suitable for the legacy PM.
Peter Collingbourne [Thu, 9 Feb 2017 23:11:52 +0000 (23:11 +0000)]
De-duplicate some code for creating an AARGetter suitable for the legacy PM.

I'm about to use this in a couple more places.

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

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

7 years agoDon't try to link to the 4.0 release notes
Hans Wennborg [Thu, 9 Feb 2017 23:03:34 +0000 (23:03 +0000)]
Don't try to link to the 4.0 release notes

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

7 years agolit.rst: Fix sphinx complaint about multiple option definitions
Matthias Braun [Thu, 9 Feb 2017 23:03:22 +0000 (23:03 +0000)]
lit.rst: Fix sphinx complaint about multiple option definitions

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

7 years ago[docs] Fix typo
Jonathan Roelofs [Thu, 9 Feb 2017 23:02:37 +0000 (23:02 +0000)]
[docs] Fix typo

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

7 years agoFix build break from r294633.
Adrian McCarthy [Thu, 9 Feb 2017 22:49:35 +0000 (22:49 +0000)]
Fix build break from r294633.

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

7 years ago[X86] Remove duplicate call to getValueType. NFCI.
Simon Pilgrim [Thu, 9 Feb 2017 22:35:59 +0000 (22:35 +0000)]
[X86] Remove duplicate call to getValueType. NFCI.

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

7 years agoX86: Introduce relocImm-based patterns for cmp.
Peter Collingbourne [Thu, 9 Feb 2017 22:02:28 +0000 (22:02 +0000)]
X86: Introduce relocImm-based patterns for cmp.

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

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

7 years agoAMDGPU: Add pass to expand memcpy/memmove/memset
Matt Arsenault [Thu, 9 Feb 2017 22:00:42 +0000 (22:00 +0000)]
AMDGPU: Add pass to expand memcpy/memmove/memset

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

7 years agoX86: Teach X86InstrInfo::analyzeCompare to recognize compares of symbols.
Peter Collingbourne [Thu, 9 Feb 2017 21:58:24 +0000 (21:58 +0000)]
X86: Teach X86InstrInfo::analyzeCompare to recognize compares of symbols.

This requires that we communicate to X86InstrInfo::optimizeCompareInstr
that the second operand is neither a register nor an immediate. The way we
do that is by setting CmpMask to zero.

Note that there were already instructions where the second operand was not a
register nor an immediate, namely X86::SUB*rm, so also set CmpMask to zero
for those instructions. This seems like a latent bug, but I was unable to
trigger it.

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

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

7 years agoIntroduce NativeRawSymbol for PDB reading.
Adrian McCarthy [Thu, 9 Feb 2017 21:51:19 +0000 (21:51 +0000)]
Introduce NativeRawSymbol for PDB reading.

This is a stub for a new concrete implementation of IPDBRawSymbol.
Nothing uses this uses this implementation yet.  My plan is to
locally switch lldb-pdbdump from the DIA reader to the Native one
and flesh out the implementations of these method stubs in the order
they're needed.

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