103427 Commits

Author SHA1 Message Date
Davide Italiano
653044e2ac [PM] Add GVNSink to the pipeline.
With this, the two pipelines should be in sync again (modulo
LoopUnswitch, but Chandler is actively working on that).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304671 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 23:18:29 +00:00
Saleem Abdulrasool
61a5551f88 ADT: handle special case of ARM environment for SUSE
SUSE treats "gnueabi" as "gnueabihf" so make sure that we normalise the
environment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304670 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 22:31:06 +00:00
Craig Topper
2a4cf84ad2 [InstCombine] Add support for simplifying ctlz/cttz intrinsics based on known bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304669 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 18:50:32 +00:00
Craig Topper
02c1af0c15 [ConstantFolding] Fix constant folding for vector cttz and ctlz intrinsics to understand that the second argument is still a scalar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 18:50:29 +00:00
Stanislav Mekhanoshin
110a2bc818 [AMDGPU] Untangle SDWA pass from SIShrinkInstructions
Remove dependency of SDWA pass on SIShrinkInstructions.
The goal is to move SDWA even higher in the stack to avoid second run
of MachineLICM, MachineCSE and SIFoldOperands.

Also added handling to preserve original src modifiers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 17:39:47 +00:00
Simon Pilgrim
9c32ef6fdb [X86][SSE] Add SCALAR_TO_VECTOR(PEXTRW/PEXTRB) support to faux shuffle combining
Generalized existing SCALAR_TO_VECTOR(EXTRACT_VECTOR_ELT) code to support AssertZext + PEXTRW/PEXTRB cases as well. 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304659 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 11:12:57 +00:00
Craig Topper
079f840dc0 [LazyValueInfo] Use Type::getIntegerBitWidth instead of casting to IntegerType to call getBitWidth. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304656 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 07:47:14 +00:00
Craig Topper
09226ec71c [LazyValueInfo] Make solveBlockValueCast take a CastInst* instead of Instruction*. Makes getOpcode return the appropriate enum without a cast. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304655 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 07:47:08 +00:00
Galina Kistanova
cd680a19b7 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304638 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 05:19:32 +00:00
Galina Kistanova
7273b29259 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304637 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 05:19:10 +00:00
Galina Kistanova
143302b9f0 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304636 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 05:18:46 +00:00
Galina Kistanova
4c20f52dc1 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304635 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 05:11:14 +00:00
Sam Clegg
4efa61f129 [WebAssembly] Refactor WasmObjectWriter::writeObject
The size of this function was getting a little out of.
control.  Split code for writing each section type into
seperate functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 02:01:24 +00:00
Kostya Serebryany
111f62d417 [sanitizer-coverage] one more flavor of coverage: -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304630 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 01:35:47 +00:00
Tom Stellard
c9a1489af2 AMDGPU/GlobalISel: Mark 1-bit integer constants as legal
Summary:
These are mostly legal, but will probably need special lowering for some
cases.

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, llvm-commits, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304628 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 01:13:33 +00:00
Eugene Zelenko
b1bd480c1c [CodeGen] Fix Windows builds which treat warnings as errors, broken in r304621.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304627 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 01:04:06 +00:00
Evgeniy Stepanov
0b656a12fb Revert "[CFI] Remove LinkerSubsectionsViaSymbols."
This reverts commit r304582: breaks cfi-devirt :: anon-namespace.cpp on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304626 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:46:27 +00:00
Stanislav Mekhanoshin
ced381c038 [AMDGPU] Preserve operand order in SIFoldOperands
SIFoldOperands can commute operands even if no folding was done.
This change is to preserve IR is no folding was done.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304625 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:41:52 +00:00
Zachary Turner
a5be24d937 [PDB] Fix use after free.
Previously MappedBlockStream owned its own BumpPtrAllocator that
it would allocate from when a read crossed a block boundary.  This
way it could still return the user a contiguous buffer of the
requested size.  However, It's not uncommon to open a stream, read
some stuff, close it, and then save the information for later.
After all, since the entire file is mapped into memory, the data
should always be available as long as the file is open.

Of course, the exception to this is when the data isn't *in* the
file, but rather in some buffer that we temporarily allocated to
present this contiguous view.  And this buffer would get destroyed
as soon as the strema was closed.

The fix here is to force the user to specify the allocator, this
way it can provide an allocator that has whatever lifetime it
chooses.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304623 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:33:35 +00:00
Matthias Braun
70862df7eb LiveRegUnits: Port recent LivePhysRegs bugfixes
Adjust code to look more like the code in LivePhysRegs and port over the
fix for LivePhysRegs from r304001 and adapt to the new CSR management in
MachineRegisterInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304622 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:26:35 +00:00
Eugene Zelenko
5067e6a434 [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304621 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:22:41 +00:00
Stanislav Mekhanoshin
9a4d5c41c3 [AMDGPU] V_DIV_FIXUP_F16 is not a commutable operation
Differential Revision: https://reviews.llvm.org/D33808

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304619 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:16:44 +00:00
Alexey Bataev
c20deb63f8 [SLP] Improve comments and naming of functions/variables/members, NFC.
Fixed some comments, added an additional description of the algorithms,
improved readability of the code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304616 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:08:21 +00:00
Sanjay Patel
6a66c94b42 [x86] simplify code for vector icmp pred transforms; NFCI
Organizing by transform is smaller and easier to read than a squashed switch with fall-throughs.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304611 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 23:21:53 +00:00
Kostya Serebryany
fef6c49a5c [sanitizer-coverage] refactor the code to make it easier to add more sections in future. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 23:13:44 +00:00
Alexey Bataev
cb453a0d29 Revert "[SLP] Improve comments and naming of functions/variables/members, NFC."
This reverts commit 6e311de8b907aa20da9a1a13ab07c3ce2ef4068a.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304609 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 23:09:15 +00:00
Philip Reames
b72c01108d [Statepoint] Be consistent about using deopt naming [NFCI]
We'd called this "vm state" in the early days, but have long since standardized on calling it "deopt" in line with the operand bundle tag.  Fix a few cases we'd missed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304607 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 23:03:26 +00:00
Matthias Braun
3310b59ffc RegisterScavenging: Add ScavengerTest pass
This pass allows to run the register scavenging independently of
PrologEpilogInserter to allow targeted testing.

Also adds some basic register scavenging tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 23:01:42 +00:00
Quentin Colombet
1067c966a6 [RABasic] Properly update the LiveRegMatrix when LR splitting occur
Prior to this patch we used to not touch the LiveRegMatrix while doing
live-range splitting. In other words, when live-range splitting was
occurring, the LiveRegMatrix was not reflecting the changes.
This is generally fine because it means the query to the LiveRegMatrix
will be conservately correct. However, when decisions are taken based on
what is going to happen on the interferences (e.g., when we spill a
register and know that it is going to be available for another one), we
might hit an assertion that the color used for the assignment is still
in use.

This patch makes sure the changes on the live-ranges are properly
reflected in the LiveRegMatrix, so the assertions don't break.
An alternative could have been to remove the assertion, but it would
make the invariants of the code and the general reasoning more
complicated in my opnion.

http://llvm.org/PR33057

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304603 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 22:46:31 +00:00
Quentin Colombet
9f43f266be [RABasic] Properly initialize the pass
Use the initializeXXX method to initialize the RABasic pass in the
pipeline. This enables us to take advantage of the .mir infrastructure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304602 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 22:46:26 +00:00
Xinliang David Li
13596b2bfe Fix debug build test failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304600 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 22:38:48 +00:00
Xinliang David Li
118cef0ca3 [PartialInlining] Minor cost anaysis tuning
Also added a test option and 2 cost analysis related tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304599 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 22:08:04 +00:00
David Blaikie
ffc893deb7 FunctionAttrs: Skip it if the effective SCC (ignoring optnone functions) is empty
Minor optimization but mostly simplifies my debugging so I'm not dealing
with empty SCCNodeSets while investigating issues in this optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304597 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 21:24:17 +00:00
Matthias Braun
465de97122 RegisterScavenging: Move scavenging logic from PEI to RegisterScavenging; NFC
These parts do not depend on any PrologEpilogInserter logic and
therefore better fits RegisterScaveging.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 21:02:03 +00:00
Zachary Turner
efbf6a8cda Fix build error on gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 21:00:22 +00:00
Jun Bum Lim
2961ee384e [InlineCost] Enable the new switch cost heuristic
Summary:
This is to enable the new switch inline cost heuristic (r301649) by removing the
old heuristic as well as the flag itself.
In my experiment for LLVM test suite and spec2000/2006, +17.82% performance and
8% code size reduce was observed in spec2000/vertex with O3 LTO in AArch64.
No significant code size / performance regression was found in O3/O2/Os. No
significant complain was reported from the llvm-dev thread.

Reviewers: hans, chandlerc, eraman, haicheng, mcrosier, bmakam, eastig, ddibyend, echristo

Reviewed By: echristo

Subscribers: javed.absar, kristof.beyls, echristo, aemerson, rengolin, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304594 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 20:42:54 +00:00
Alexey Bataev
37aaa827f4 [SLP] Improve comments and naming of functions/variables/members, NFC.
Summary:
Fixed some comments, added an additional description of the algorithms,
improved readability of the code.

Reviewers: anemet

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304593 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 20:39:27 +00:00
Ahmed Bougacha
3f86a859d8 [X86] Correctly broadcast NaN-like integers as float on AVX.
Since r288804, we try to lower build_vectors on AVX using broadcasts of
float/double.  However, when we broadcast integer values that happen to
have a NaN float bitpattern, we lose the NaN payload, thereby changing
the integer value being broadcast.

This is caused by ConstantFP::get, to which we pass the splat i32 as
a float (by bitcasting it using bitsToFloat).  ConstantFP::get takes
a double parameter, so we end up lossily converting a single-precision
NaN to double-precision.

Instead, avoid any kinds of conversions by directly building an APFloat
from the splatted APInt.

Note that this also fixes another piece of code (broadcast of
subvectors), that currently isn't susceptible to the same problem.

Also note that we could really just use APInt and ConstantInt
throughout: the constant pool type doesn't matter much.  Still, for
consistency, use the appropriate type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304590 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 20:02:59 +00:00
Zachary Turner
c0160aa0c7 Fix build error with clang and gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304589 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 20:00:10 +00:00
Zachary Turner
42d60ef585 [CodeView] Support CodeView subsections in any order.
Previously we would expect certain subsections to appear
in a certain order because some subsections would reference
other subsections, but in practice we need to support
arbitrary orderings since some object file and PDB file
producers generate them this way.  This also paves the
way for supporting Yaml <-> Object File conversion of
CodeView, since Object Files typically have quite a
large number of subsections in their debug info.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304588 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 19:49:14 +00:00
Keno Fischer
a1a34351e6 [SROA] Fix crash due to bad bitcast
Summary:
As shown in the test case, SROA was crashing when trying to split
stores (to the alloca) of loads (from anywhere), because it assumed
the pointer operand to the loads and stores had to have the same
address space. This isn't the case. Make sure to use the correct
pointer type for both the load and the store.

Reviewed By: yaxunl
Differential Revision: https://reviews.llvm.org/D32593

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304585 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 19:04:17 +00:00
Evgeniy Stepanov
03ceeb1a86 [CFI] Remove LinkerSubsectionsViaSymbols.
Since D17854 LinkerSubsectionsViaSymbols is unnecessary.

It is interfering with ThinLTO implementation of CFI-ICall, where
the aliases used on the !LinkerSubsectionsViaSymbols branch are
needed to export jump tables to ThinLTO backends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304582 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 18:45:14 +00:00
David Blaikie
6cc5d91953 BitcodeWriter: Removing unnecessary std::function in favor of template
More cleanup from post-commit discussion on r304516

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304579 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 18:25:29 +00:00
Evgeniy Stepanov
93d430ca14 Skip CFI for dead functions.
Differential Revision: https://reviews.llvm.org/D33805

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304578 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 18:24:23 +00:00
Evgeniy Stepanov
a667b70dbe Move summary dead stripping before regular LTO.
This way dead stripping results are recorded in combined summary and
can be used in regular LTO passes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304577 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 18:24:17 +00:00
Sanjay Patel
f1a1cf19c1 [x86] fix formatting; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304576 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 18:14:31 +00:00
Matt Arsenault
7796b916f8 AMDGPU: Register AMDGPUAlwaysInline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304574 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 18:02:42 +00:00
Reid Kleckner
8147ef1372 Re-land "COFF: migrate def parser from LLD to LLVM"
This reverts commit r304561 and re-lands r303490 & co.

The fix was to use "SymbolName" when translating LLD's internal export
list to lib/Object's short export struct. The SymbolName reflects the
actual symbol name, which may include fastcall and stdcall mangling bits
not included in the /EXPORT or .def file EXPORTS name:

@@ -434,8 +434,7 @@ std::vector<COFFShortExport> createCOFFShortExportFromConfig() {
   std::vector<COFFShortExport> Exports;
   for (Export &E1 : Config->Exports) {
     COFFShortExport E2;
-    E2.Name = E1.Name;
+    // Use SymbolName, which will have any stdcall or fastcall qualifiers.
+    E2.Name = E1.SymbolName;
     E2.ExtName = E1.ExtName;
     E2.Ordinal = E1.Ordinal;
     E2.Noname = E1.Noname;

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304573 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 17:53:06 +00:00
Konstantin Zhuravlyov
e0fcf72467 AMDGPU: Make auto waitcnt before barrier a feature
Differential Revision: https://reviews.llvm.org/D33793


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304571 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 17:40:26 +00:00
Sanjay Patel
d496b07e32 [TargetLowering] fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304569 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 17:35:02 +00:00