87281 Commits

Author SHA1 Message Date
Scott Egerton
4f17f73d87 [mips] Implemented the .hword directive.
Summary:
In order to pass the tests, this required marking R_MIPS_16 relocations
as needing to point to the symbol and not the section.

Reviewers: vkalintiris, dsanders

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 16:11:51 +00:00
Krzysztof Parzyszek
5e17ebd723 [Hexagon] Use zero-extending loads for anyext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 16:01:01 +00:00
Silviu Baranga
23340531a1 [LV] Add support for insertelt/extractelt processing during type truncation
Summary:
While shrinking types according to the required bits, we can
encounter insert/extract element instructions. This will cause us to
reach an llvm_unreachable statement.

This change adds support for truncating insert/extract element
operations, and adds a regression test.

Reviewers: jmolloy

Subscribers: mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 15:38:17 +00:00
Roman Gareev
78d3a49fad Tweak the LICM code to reuse the first sub-loop instead of creating a new one
LICM starts with an *empty* AST, and then merges in each sub-loop. While the
add code is appropriate for sub-loop 2 and up, it's utterly unnecessary for
sub-loop 1. If the AST starts off empty, we can just clone/move the contents
of the subloop into the containing AST.

Reviewed-by: Philip Reames <listmail@philipreames.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 14:48:50 +00:00
Scott Egerton
894a6f0e19 Reverted r260879 as it caused test failures in lld.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 10:04:38 +00:00
Scott Egerton
77405b1467 [mips] Removed the SHF_ALLOC flag from the .pdr section.
Summary:
This section is used for debug information and has no need to be
in memory at runtime. With this patch, LLVM now emits the same flags as 
the GNU assembler. This patch also fixes an error when compiling 
the Linux kernel, The error is that there are relocations within the 
.pdr section in a VDSO.

Reviewers: vkalintiris, dsanders

Subscribers: llvm-commits, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 09:34:15 +00:00
Igor Breger
0dd3e9d55e AVX512: Change store size of kmask. Store size of v8i1, v4i1 , v2i1 and i1 are changed to 16 bits.
If KMOVB not supported (require AVX512DQ) only KMOVW can be used so store size should be 2 bytes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 08:25:28 +00:00
Chandler Carruth
6f603acaaa [PM/AA] Wire BasicAA's new pass manager class up to the pass registry.
This ensures that all of the various pieces are working. The next patch
will wire up commandline-driven alias analysis chain building and allow
BasicAA to work with the AAManager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260838 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 23:46:24 +00:00
Chandler Carruth
26bf6ea447 [PM/AA] Actually wire the AAManager I built for the new pass manager
into the new pass manager and fix the latent bugs there.

This lets everything live together nicely, but it isn't really useful
yet. I never finished wiring the AA layer up for the new pass manager,
and so subsequent patches will change this to do that wiring and get AA
stuff more fully integrated into the new pass manager. Turns out this is
necessary even to get functionattrs ported over. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 23:32:00 +00:00
Duncan P. N. Exon Smith
9b2a3ba3ec Support: Fix incremental build when re-configuring targets
r180893 added an indirect include of llvm/Config/Targets.def to
llvm/Support/CodeGen.h, which in turn is included by things like
llvm/IR/Module.h.  After a full build of LLVM and Clang, ninja had to
rebuild 1274 files after reconfiguring.

This commit strips CodeGen.h back down to just a pile of enums and moves
the expensive includes over to CodeGenCWrappers.h (which is only
included in two places).  This gets ninja down to 88 files if you
reconfigure with, e.g., -DLLVM_TARGETS_TO_BUILD=X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 22:58:43 +00:00
Simon Pilgrim
34963650b8 [X86][AVX] Lower shuffles as repeated lane shuffles then lane-crossing shuffles
This patch attempts to represent a shuffle as a repeating shuffle (recognisable by is128BitLaneRepeatedShuffleMask) with the source input(s) in their original lanes, followed by a single permutation of the 128-bit lanes to their final destinations.

On AVX2 we can additionally attempt to match using 64-bit sub-lane permutation. AVX2 can also now match a similar 'broadcasted' repeating shuffle.

This patch has several benefits:

 * Avoids prematurely matching with lowerVectorShuffleByMerging128BitLanes which can require both inputs to have their input lanes permuted before shuffling.
 * Can replace PERMPS/PERMD instructions - although these are useful for cross-lane unary shuffling, they require their shuffle mask to be pre-loaded (and increase register pressure).
 * Matching the repeating shuffle makes use of a lot of existing shuffle lowering.

There is an outstanding minor AVX1 regression (combine_unneeded_subvector1 in vector-shuffle-combining.ll) of a previously 128-bit shuffle + subvector splat being converted to a subvector splat + (2 instruction) 256-bit shuffle, I intend to fix this in a followup patch for review.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 21:54:04 +00:00
Craig Topper
ea5732dc11 Remove Proc feature flags for X86 processors that are used to inherit features from one processor to another. This exposed extra features to the -mattr command line that we shouldn't. Replace with just inherited listconcats.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 21:35:37 +00:00
Kostya Serebryany
2d7392fe48 [libFuzzer] remove std::vector operations from hot paths, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 17:56:51 +00:00
Sanjay Patel
5fb1d32848 [x86-64] allow mfence even with -mno-sse (PR23203)
As shown in:
https://llvm.org/bugs/show_bug.cgi?id=23203
...we currently die because lowering believes that mfence is allowed without SSE2 on x86-64,
but the instruction def doesn't know that.

I don't know if allowing mfence without SSE is right, but if not, at least now it's consistently wrong. :)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 17:26:29 +00:00
Benjamin Kramer
34ae7b5808 [ConstantFolding] Reduce APInt and APFloat copying.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 16:54:14 +00:00
Benjamin Kramer
8d6707c823 [AggressiveAntiDepBreaker] Skip some unnecessary BitVector copies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 16:39:39 +00:00
Benjamin Kramer
7a3eeaef9e Use ArrayRef to hide SmallVector details, kill a useless vector copy along the way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 16:01:12 +00:00
Krzysztof Parzyszek
712fa7e936 [Hexagon] Replace use of "std::map::emplace" with "insert"
Gcc 4.7.2-4 does not seem to have "emplace" in its implementation of map.
This should fix the build failure on polly-amd64-linux.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 14:06:01 +00:00
Chandler Carruth
2c37b35a91 [attrs] Move the norecurse deduction to operate on the node set rather
than the SCC object, and have it scan the instruction stream directly
rather than relying on call records.

This makes the behavior of this routine consistent between libc routines
and LLVM intrinsics for libc routines. We can go and start teaching it
about those being norecurse, but we should behave the same for the
intrinsic and the libc routine rather than differently. I chatted with
James Molloy and the inconsistency doesn't seem intentional and likely
is due to intrinsic calls not being modelled in the call graph analyses.

This also fixes a bug where we would deduce norecurse on optnone
functions, when generally we try to handle optnone functions as-if they
were replaceable and thus unanalyzable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 08:47:51 +00:00
NAKAMURA Takumi
ae2af9f101 HexagonFrameLowering.cpp: Appease msc18 to give an explicit constructor SlotInfo() instead of member initializers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 07:29:49 +00:00
Kostya Serebryany
49429cee7f [libFuzzer] don't require seed in fuzzer::Mutate, instead use the global Fuzzer object for fuzzer::Mutate. This makes custom mutators fast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 06:24:18 +00:00
Matthias Braun
7eaa93aa2b LiveIntervalAnalysis: Remove LiveVariables requirement
This requirement was a huge hack to keep LiveVariables alive because it
was optionally used by TwoAddressInstructionPass and PHIElimination.
However we have AnalysisUsage::addUsedIfAvailable() which we can use in
those passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 04:35:31 +00:00
Matt Arsenault
626ceb277f AMDGPU: Prepare for reducing private element size.
Tests for the new scalarize all private access options will be
included with a future commit.

The only functional change is to make the split/scalarize behavior
for private access of > 4 element vectors to be consistent
with the flat/global handling. This makes the spilling worse
in the two changed tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 04:18:53 +00:00
Kostya Serebryany
5a08f1b013 [libFuzzer] remove the C++-ish variant of FuzzerDriver from the interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 03:59:26 +00:00
Kostya Serebryany
d1eacb8ffc [libFuzzer] simplify CTOR of MutationDispatcher
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 03:46:26 +00:00
Kostya Serebryany
1d35d47455 [libFuzzer] get rid of MutationDispatcher::Impl (simplify the code; NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 03:37:24 +00:00
Kostya Serebryany
efb0cc7640 [libFuzzer] get rid of UserSuppliedFuzzer; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 03:25:16 +00:00
Kostya Serebryany
728ca1266f [libFuzzer] simplify the code around Random. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 03:00:53 +00:00
Kostya Serebryany
f71ac00d01 [libFuzzer] remove UserSuppliedFuzzer from the interface (it was a bad idea).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 02:39:30 +00:00
Kostya Serebryany
e6d7e3d948 [libFuzzer] provide a plain C interface for custom mutators (experimental)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 02:29:38 +00:00
Tom Stellard
224ee47ca1 AMDGPU/SI: Add llvm.amdgcn.mov.dpp intrinsic
This intrinsic will be used to expose dpp functionality to higher-level
languages. It will map to the dpp version of v_mov_b32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 02:09:49 +00:00
Keno Fischer
11adcc4de0 [Cloning] Clone every Function's Debug Info
Summary:
Export the CloneDebugInfoMetadata utility, which clones all debug info
associated with a function into the first module. Also use this function
in CloneModule on each function we clone (the CloneFunction entrypoint
already does this).

Without this, cloning a module will lead to DI quality regressions,
especially since r252219 reversed the Function <-> DISubprogram edge
(before we could get lucky and have this edge preserved if the
DISubprogram itself was, e.g. due to location metadata).

This was verified to fix missing debug information in julia and
a unittest to verify the new behavior is included.

Patch by Yichao Yu! Thanks!

Reviewers: loladiro, pcc
Differential Revision: http://reviews.llvm.org/D17165

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 02:04:29 +00:00
Matt Arsenault
e31b74e98b Add AMDGPU related triple vendors/OSes
As support expands to more runtimes, we'll need to
distinguish between more than just HSA and unknown.
This also lets us stop using unknown everywhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 01:56:21 +00:00
Matt Arsenault
0bbac93e5d AMDGPU: Cleanup includes and random macros
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 01:24:08 +00:00
Matt Arsenault
53ea122b3d AMDGPU: Add intrinsics for sin/cos
These provide direct access to the hardware instruction without
the unit version required like llvm.sin/llvm.cos lowering requires.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 01:19:56 +00:00
Matt Arsenault
a4c1dc826a AMDGPU: Rename intrinsic to better match instruction name
Also fixes missing f32 test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 01:03:00 +00:00
Tom Stellard
61b6c32d08 AMDGPU/SI: Add instruction defs for VOP1 DPP instructions
Reviewers: nhaustov, cfang, arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 00:51:31 +00:00
Matt Arsenault
58bc131398 AMDGPU: Fix broken condition causing warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 00:36:10 +00:00
Pirama Arumuga Nainar
d313df118a Don't combine fp_round (fp_round x) if f80 to f16 is generated
Summary:
This patch skips DAG combine of fp_round (fp_round x) if it results in
an fp_round from f80 to f16.

fp_round from f80 to f16 always generates an expensive (and as yet,
unimplemented) libcall to __truncxfhf2.  This prevents selection of
native f16 conversion instructions from f32 or f64.  Moreover, the first
(value-preserving) fp_round from f80 to either f32 or f64 may become a
NOP in platforms like x86.

Reviewers: ab

Subscribers: srhines, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 00:08:05 +00:00
Alexey Samsonov
9afad92e6b Fix Windows buildbot breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 23:51:06 +00:00
Tom Stellard
98ef447825 AMDGPU/SI: Detect uniform branches and emit s_cbranch instructions
Reviewers: arsenm

Subscribers: mareko, MatzeB, qcolombet, arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 23:45:29 +00:00
Yunzhong Gao
6784b3ca2d Disable the vzeroupper insertion pass on PS4.
Differential Revision: http://reviews.llvm.org/D16837



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 23:37:57 +00:00
Derek Schuff
ba4e9d05f5 [WebAssembly] Report more meaningful error messages for some unsupported
ops.

Computed gotos and RETURNADDR may never be supported; we can do
FRAMEADDR in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 22:56:03 +00:00
Krzysztof Parzyszek
b762ae1118 [Hexagon] Optimize stack slot spills
Replace spills to memory with spills to registers, if possible. This
applies mostly to predicate registers (both scalar and vector), since
they are very limited in number. A spill of a predicate register may
happen even if there is a general-purpose register available. In cases
like this the stack spill/reload may be eliminated completely.

This optimization will consider all stack objects, regardless of where
they came from and try to match the live range of the stack slot with
a dead range of a register from an appropriate register class.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 22:53:35 +00:00
Krzysztof Parzyszek
866bbdb53b [Hexagon] Mark HVX registers as volatile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 22:26:44 +00:00
Derek Schuff
0d7bc82046 [WebAssembly] Update test expectations after r260737
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 22:05:08 +00:00
Krzysztof Parzyszek
3a028998ba [Hexagon] Recognize more cases in copyPhysReg and stack slot load/store
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260748 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 21:56:41 +00:00
Reid Kleckner
43c4ddff1c [codeview] Describe local variables in registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 21:48:30 +00:00
Rong Xu
2ee5bb8ea1 [PGO] Add another interface for annotateValueSite
Add another interface to function annotateValueSite() which directly uses the
VauleData array.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 21:36:17 +00:00
Dan Gohman
f97f532728 [WebAssembly] Fix byval for empty types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 21:30:18 +00:00