147571 Commits

Author SHA1 Message Date
Derek Schuff
490024c934 [WebAssembly] Update use of Attributes after r299875
This fixes the failing WebAssemblyLowerEmscriptenEHSjLj tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300072 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 16:03:00 +00:00
Dmitry Preobrazhensky
405c945bb5 [AMDGPU][MC] Corrected encoding of V_MQSAD_U32_U8 for CI
Corrected encoding of V_MQSAD_U32_U8 for CI

See bug 32552: https://bugs.llvm.org//show_bug.cgi?id=32552

Reviewers: vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300070 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 15:36:09 +00:00
Easwaran Raman
6f3228cc82 Fix the bootstrap failure caused by r299986.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 15:26:15 +00:00
Sanjay Patel
e930b092c4 [InstCombine] morph an existing instruction instead of creating a new one
One potential way to make InstCombine (very slightly?) faster is to recycle instructions 
when possible instead of creating new ones. It's not explicitly stated AFAIK, but we don't
consider this an "InstSimplify". We could, however, make a new layer to house transforms 
like this if that makes InstCombine more manageable (just throwing out an idea; not sure 
how much opportunity is actually here).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300067 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 15:11:33 +00:00
Dmitry Preobrazhensky
df5e51ce8f [AMDGPU][MC] Corrected ds_wrxchg2* to support two offsets
Fixed bug 28227: https://bugs.llvm.org//show_bug.cgi?id=28227

Reviewers: vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300066 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 14:29:45 +00:00
Jonas Paulsson
c2dad95b1e Fix a RUN line in new test.
Use '2>&1 |' and not '|&' to pipe debug output to FileCheck

Hopefully handles a "shell parser error" on
llvm-clang-x86_64-expensive-checks-win

test/Transforms/SLPVectorizer/SystemZ/SLP-cmp-cost-query.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300064 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 14:25:08 +00:00
Serge Pavlov
e4957d5a3e Remove redundant type casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300063 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 14:13:00 +00:00
Ed Maste
944d939ce1 Fix detection of backtrace() availability on FreeBSD
On FreeBSD backtrace is not part of libc and depends on libexecinfo
being available. Instead of using manual checks we can use the builtin
CMake module FindBacktrace.cmake to detect availability of backtrace()
in a portable way.

Patch By:	Alex Richardson
Differential Revision:	https://reviews.llvm.org/D27143


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300062 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 13:51:00 +00:00
Jonas Paulsson
0b09474fe1 [SLPVectorizer] Pass the right type argument to getCmpSelInstrCost()
In getEntryCost(), make the scalar type for a compare instruction that of the
operands, not i1. This is needed in order to call getCmpSelInstrCost() for a
compare in a sensible way, the same way as the LoopVectorizer does.

New test: test/Transforms/SLPVectorizer/SystemZ/SLP-cmp-cost-query.ll

Review: Matthew Simpson
https://reviews.llvm.org/D31601

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300061 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 13:29:25 +00:00
Benjamin Kramer
4e5abdf67c [MachineBlockPlacment] Add an assert to ensure there is no order dependency on DenseMap iteration order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300060 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 13:26:31 +00:00
Benjamin Kramer
2b37175e41 [MachineBlockPlacement] Clean up data structures a bit.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300059 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 13:26:28 +00:00
Jonas Paulsson
16b23e95d5 [LoopVectorizer] Improve handling of branches during cost estimation.
The cost for a branch after vectorization is very different depending on if
the vectorizer will if-convert the block (branch is eliminated), or if
scalarized and predicated blocks will be produced (branch duplicated before
each block). There is also the case of remaining scalar branches, such as the
back-edge branch.

This patch handles these cases differently with TTI based cost estimates.

Review: Matthew Simpson
https://reviews.llvm.org/D31175

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300058 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 13:13:15 +00:00
Igor Breger
e353fb8d83 [GlobalIsel][X86] support G_CONSTANT selection.
Summary: [GlobalISel][X86] support G_CONSTANT selection. Add regbank select tests.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: llvm-commits, dberris, rovka, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 12:54:54 +00:00
Jonas Paulsson
43d439da88 [LoopVectorizer, TTI] New method supportsEfficientVectorElementLoadStore()
Since SystemZ supports vector element load/store instructions, there is no
need for extracts/inserts if a vector load/store gets scalarized.

This patch lets Target specify that it supports such instructions by means of
a new TTI hook that defaults to false.

The use for this is in the LoopVectorizer getScalarizationOverhead() method,
which will with this patch produce a smaller sum for a vector load/store on
SystemZ.

New test: test/Transforms/LoopVectorize/SystemZ/load-store-scalarization-cost.ll

Review: Adam Nemet
https://reviews.llvm.org/D30680

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300056 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 12:41:37 +00:00
Dmitry Preobrazhensky
fcce15e390 [AMDGPU][MC] Corrected src0 size for s_cbranch_join
Fix for bug 28159: https://bugs.llvm.org//show_bug.cgi?id=28159

Reviewers: vpykhtin, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300055 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 12:40:19 +00:00
Jonas Paulsson
2778098e17 [SystemZ] Updated test fp-cast.ll
This did not get included in the previous commit for SystemZ cost functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300053 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 12:11:41 +00:00
Jonas Paulsson
c33bdfa7b1 [SystemZ] TargetTransformInfo cost functions implemented.
getArithmeticInstrCost(), getShuffleCost(), getCastInstrCost(),
getCmpSelInstrCost(), getVectorInstrCost(), getMemoryOpCost(),
getInterleavedMemoryOpCost() implemented.

Interleaved access vectorization enabled.

BasicTTIImpl::getCastInstrCost() improved to check for legal extending loads,
in which case the cost of the z/sext instruction becomes 0.

Review: Ulrich Weigand, Renato Golin.
https://reviews.llvm.org/D29631

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300052 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 11:49:08 +00:00
Krasimir Georgiev
6120b8f9e9 [DWARF] Fix compiler warnings in DWARFContext.cpp, NFCi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300051 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 11:33:26 +00:00
Piotr Padlewski
715890b279 [LangRef] fix documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300050 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 11:18:19 +00:00
Sam Kolton
9a421935fb [AMDGPU] SDWA: make pass global
Summary: Remove checks for basic blocks.

Reviewers: vpykhtin, rampitec, arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300040 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 09:36:05 +00:00
George Rimar
2b0a45f335 [DWARF] - Refactoring of DWARFContextInMemory implementation.
This change is basically relative to D31136, where I initially wanted to
implement some relocations handling optimization which shows it can give
significant boost. Though even without any caching algorithm looks
code can have some cleanup at first.

Refactoring separates out code for taking symbol address, used in relocations
computation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300039 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 08:59:15 +00:00
Chandler Carruth
76dc6181d8 [IR] Rename the class templates for the case iterator and case handle to
not collide with the naming convention for template *arguments*. In at
least one case they actually collided and this confuses MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300038 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 08:48:39 +00:00
Daniel Sanders
81de2d08ab [globalisel][tablegen] Add experimental support for OperandWithDefaultOps, PredicateOperand, and OptionalDefOperand
Summary:
As far as instruction selection is concerned, all three appear to be same thing.

Support for these operands is experimental since AArch64 doesn't make use
of them and the in-tree targets that do use them (AMDGPU for
OperandWithDefaultOps, AMDGPU/ARM/Hexagon/Lanai for PredicateOperand, and ARM
for OperandWithDefaultOps) are not using tablegen-erated GlobalISel yet.

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

Reviewed By: rovka

Subscribers: inglorion, aemerson, rengolin, mehdi_amini, dberris, kristof.beyls, igorb, tpr, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300037 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 08:23:08 +00:00
Bjorn Pettersson
a22205806d [LoadCombine] Avoid analysing dead basic blocks
Summary:
Dead basic blocks may be forming a loop, for which SSA form is
fulfilled, but with a circular def-use chain. LoadCombine could
enter an infinite loop when analysing such dead code. This patch
solves the problem by simply avoiding to analyse all basic blocks
that aren't forward reachable, from function entry, in LoadCombine.

Fixes https://bugs.llvm.org/show_bug.cgi?id=27065

Reviewers: mehdi_amini, chandlerc, grosser, Bigcheese, davide

Reviewed By: davide

Subscribers: dberlin, zzheng, bjope, grandinj, Ka-Ka, materi, jholewinski, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300034 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 08:07:55 +00:00
Piotr Padlewski
3512d22fea Invariant.group and mustalias docs fixes
Summary:
Alias analysis would like to know that
invariant.group.barrier returns pointer that mustalias,
but this can't imply that we can replace one pointer with another

Reviewers: dberlin, sanjoy

Subscribers: llvm-commits, chandlerc, hfinkel, nlewycky, amharc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300033 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 07:59:35 +00:00
Chandler Carruth
ddfada260a [IR] Redesign the case iterator in SwitchInst to actually be an iterator
and to expose a handle to represent the actual case rather than having
the iterator return a reference to itself.

All of this allows the iterator to be used with common STL facilities,
standard algorithms, etc.

Doing this exposed some missing facilities in the iterator facade that
I've fixed and required some work to the actual iterator to fully
support the necessary API.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300032 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 07:27:28 +00:00
Craig Topper
00b79068c4 [IR] Fix copy and paste mistake in comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300031 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 05:57:46 +00:00
Craig Topper
96d92eadca [InstCombine][IR] Add a commutable BinOp matcher. Use it to reduce some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300030 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 05:49:28 +00:00
Serguei Katkov
4f5f4e9e2a [BPI] Refactor post domination calculation and simple fix for ColdCall
Collection of PostDominatedByUnreachable and PostDominatedByColdCall have been
split out of heuristics itself. Update of the data happens now for each basic
block (before update for PostDominatedByColdCall might be skipped if
unreachable or matadata heuristic handled this basic block).

This separation allows re-ordering of heuristics without loosing
the post-domination information.

Reviewers: sanjoy, junbuml, vsk, chandlerc, reames

Reviewed By: chandlerc

Subscribers: llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 05:42:14 +00:00
Serguei Katkov
81e9372c9e [INC] Test commit. NFC.
Just an update of comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300026 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 04:41:35 +00:00
Kannan Narayanan
d3302ddc52 [AMDGPU] Add a new pass to insert waitcnts. Leave under an option for testing.
Based on comments in https://reviews.llvm.org/D31161.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300023 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 03:25:12 +00:00
Kyle Butt
92625cfb47 CodeGen: BlockPlacement: Clear ComputedEdges between functions.
Not clearing was causing non-deterministic compiles for large files. Addresses
for MachineBasicBlocks would end up colliding and we would lay out a block that
we assumed had been pre-computed when it had not been.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300022 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 03:18:20 +00:00
Bob Haarman
4a0d76ba2f ThinLTOBitcodeWriter: keep comdats together, rename if leader is renamed
Summary:
COFF requires that every comdat contain a symbol with the same name as
the comdat. ThinLTOBitcodeWriter renames symbols, which may cause this
requirement to be violated. This change avoids such violations by
renaming comdats if their leaders are renamed. It also keeps comdats
together when splitting modules.

Reviewers: pcc, mehdi_amini, tejohnson

Reviewed By: pcc

Subscribers: rnk, Prazek, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300019 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 01:43:07 +00:00
Derek Schuff
e9dc13a183 Revert "[WebAssembly] Update use of Attributes after r299875"
This reverts commit 2a0eb61dcccb15058d5b2a572bb3da0cf47fd550, r300015

I raced with rnk on the commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 01:17:31 +00:00
Derek Schuff
2a0eb61dcc [WebAssembly] Update use of Attributes after r299875
This fixes the failing WebAssemblyLowerEmscriptenEHSjLj tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300015 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 01:09:34 +00:00
Reid Kleckner
06090406b0 [IR] Add AttributeSet to hide AttributeSetNode* again, NFC
Summary:
For now, it just wraps AttributeSetNode*. Eventually, it will hold
AvailableAttrs as an inline bitset, and adding and removing enum
attributes will be super cheap.

This sinks AttributeSetNode back down to lib/IR/AttributeImpl.h.

Reviewers: pete, chandlerc

Subscribers: llvm-commits, jfb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 00:38:00 +00:00
Yi Kong
824c3767b3 Remove xgene1 from host detection
This is not a supported mcpu tuning option. We should treat it as
"generic" variant.

Also, add record for cortex-a35.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300003 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:39:55 +00:00
Matt Arsenault
8c86ad544b AMDGPU: Insert wait at start of callee functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:29:31 +00:00
Matt Arsenault
56db90276b AMDGPU: Refactor SIMachineFunctionInfo slightly
Prepare for handling non-entry functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:29:28 +00:00
Matt Arsenault
938bfaf893 AMDGPU: Refactor argument lowering
Split into smaller functions and prepare for handling
non-entry functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299998 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:29:24 +00:00
Matt Arsenault
651ac56097 AMDGPU: Fix folding reg_sequence into copy to phys reg
This was producing an illegal reg_sequence defining
a physical register with virtual register inputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299997 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:29:19 +00:00
Matt Arsenault
3bca0534ee AMDGPU: Prune unecessary include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:29:16 +00:00
Evgeniy Stepanov
adabd2ad34 [asan] Give global metadata private linkage.
Internal linkage preserves names like "__asan_global_foo" which may
account to 2% of unstripped binary size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:28:13 +00:00
Balaram Makam
7feea4e245 [AArch64] Fix scheduling info for INS(vector, general) instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299994 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:14:10 +00:00
Vedant Kumar
15d522b811 Avoid some string copies, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299993 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:11:46 +00:00
Andrew Kaylor
b66309b465 Minor updates to floating point intrinsic documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299991 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 21:52:40 +00:00
Zvi Rackover
f14c498699 InstSimplify: A shuffle of a splat is always the splat itself
Summary:
Fold:
 shuffle (splat-shuffle), undef, M --> splat-shuffle

Reviewers: spatel, RKSimon, craig.topper

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299990 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 21:37:02 +00:00
Zvi Rackover
4fb7a1861e [DAGCombine] Add more test cases for shuffle of splat. NFC.
Tests added contain splat-masks with undef elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299988 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 21:16:59 +00:00
Easwaran Raman
9a12eacf3d [x86] Relax the check in areLoadsFromSameBasePtr
Check if the scale operand is identical (doesn't have to be 1) and
do not check the chaain operand.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299986 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 21:05:02 +00:00
Anna Thomas
3d57035bd9 [LV] Avoid vectorizing first order recurrence when phi uses are outside loop
In the vectorization of first order recurrence, we vectorize such
that the last element in the vector will be the one extracted to pass into the
scalar remainder loop. However, this is not true when there is a phi (other
than the primary induction variable) is used outside the loop.
In such a case, we need the value from the second last iteration (i.e.
the phi value), not the last iteration (which would be the phi update).
I've added a test case for this. Also see PR32396.

A follow up patch would generate the correct code gen for such cases,
and turn this vectorization on.

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

Reviewers: mssimpso

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299985 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 21:02:00 +00:00