140241 Commits

Author SHA1 Message Date
Simon Pilgrim
1020d5b063 [X86][AVX512DQ] Move v2i64 and v4i64 MUL lowering to tablegen
As suggested by @igorb on D26011

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 17:07:40 +00:00
Saleem Abdulrasool
b5143b06a1 ARM: ensure that the Windows DBZ check is in range
The Windows ARM target expects the compiler to emit a division-by-zero check.
The check would use the form of:

    cmp r?, #0
    cbz .Ltrap
    b .Lbody
  .Lbody:
    ...
  .Ltrap:
    udf #249 @ __brkdiv0

This works great most of the time.  However, if the body of the function is
greater than 127 bytes, the branch target limitation of cbz becomes an issue.
This occurs in the unoptimized code generation cases sometimes (like in
compiler-rt).

Since this is a matter of correctness, possibly pay a small penalty instead.  We
now form this slightly differently:

    cbnz .Lbody
    udf #249 @ __brkdiv0
  .Lbody:
    ...

The positive case is through the branch instead of being the next instruction.
However, because of the basic block layout, the negated branch is going to be
a short distance always (2 bytes away, after the inserted __brkdiv0).

The new t__brkdiv0 instruction is required to explicitly mark the instruction as
a terminator as the generic UDF instruction is not a terminator.

Addresses PR30532!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 16:59:22 +00:00
Greg Clayton
07e9e1a518 Switch all DWARF variables for tags, attributes and forms over to use the llvm::dwarf enumerations instead of using raw uint16_t values. This allows easier debugging as users can see the values of the enumerations in the variables view that will show the enumeration string instead of just a number.
https://reviews.llvm.org/D26013



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 16:32:04 +00:00
Dehao Chen
146c52f30c Add Loop Sink pass to reverse the LICM based of basic block frequency.
Summary: LICM may hoist instructions to preheader speculatively. Before code generation, we need to sink down the hoisted instructions inside to loop if it's beneficial. This pass is a reverse of LICM: looking at instructions in preheader and sinks the instruction to basic blocks inside the loop body if basic block frequency is smaller than the preheader frequency.

Reviewers: hfinkel, davidxl, chandlerc

Subscribers: anna, modocache, mgorny, beanz, reames, dberlin, chandlerc, mcrosier, junbuml, sanjoy, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 16:30:08 +00:00
Vasileios Kalintiris
1de03247dc [mips] Do not allow -opt-bisect-limit to skip the PIC call optimization pass.
r282428 added the MipsOptimizePICCall as an opt-in pass that can be
skipped when using the -opt-bisect-limit option. However, this pass is
needed because it generates code that conforms to the o32 ABI
specification by using the $t9 register for PIC calls with JALR
instructions.

This bug was exposed by the fact that skipFunction() also checks for
the "optnone" attribute. This caused functions with that attribute to
break the requirements of the o32 ABI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285305 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 15:50:36 +00:00
Simon Pilgrim
0de3e81c28 [X86][AVX512DQ] Improve lowering of MUL v2i64 and v4i64
With DQI but without VLX, lower v2i64 and v4i64 MUL operations with v8i64 MUL (vpmullq).

Updated cost table accordingly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 15:27:00 +00:00
Sanjay Patel
f662ae7433 [ValueTracking] fix matchSelectPattern to allow vector splat folds of min/max/abs/nabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 15:26:10 +00:00
Benjamin Kramer
bf85e05280 Remove duplicated default move ctors/move assign. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285302 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 15:23:44 +00:00
Sanjay Patel
df97b257e9 [InstCombine] add tests for missing folds of vector abs/nabs/min/max
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 15:02:45 +00:00
Bjorn Pettersson
498c1670f8 Fix memory issue in AttrBuilder::removeAttribute uses.
Summary:
Found when running Valgrind.

This removes two unnecessary assignments when using
AttrBuilder::removeAttribute.

AttrBuilder::removeAttribute returns a reference to the object.
As the LHSes were the same as the callees, the assignments
resulted in memcpy calls where dst = src.

Commited on behalf-of: dstenb (David Stenberg)

Reviewers: mkuper, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 14:48:09 +00:00
Krzysztof Parzyszek
444277c658 [Hexagon] Do not expand ISD::SELECT for HVX vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 14:30:16 +00:00
Simon Pilgrim
5579104d09 [DAGCombiner] Add vector demanded elements support to computeKnownBits
Currently computeKnownBits returns the common known zero/one bits for all elements of vector data, when we may only be interested in one/some of the elements.

This patch adds a DemandedElts argument that allows us to specify the elements we actually care about. The original computeKnownBits implementation calls with a DemandedElts demanding all elements to match current behaviour. Scalar types set this to 1.

The approach was found to be easier than trying to add a per-element known bits solution, for a similar usefulness given the combines where computeKnownBits is typically used.

I've only added support for a few opcodes so far (the ones that have proven straightforward to test), all others will default to demanding all elements but can be updated in due course.

DemandedElts support could similarly be added to computeKnownBitsForTargetNode in a future commit.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 14:29:28 +00:00
Sanjay Patel
d44b990d12 [InstCombine] auto-generate better checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 13:55:37 +00:00
George Rimar
2eb8a6d30b Revert r285285 "[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large."
It broke BB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 12:18:50 +00:00
Alexey Bataev
d6d83fe649 [SLP] Fix for PR30626: Compiler crash inside SLP Vectorizer.
After successfull horizontal reduction vectorization attempt for PHI node
vectorizer tries to update root binary op by combining vectorized tree
and the ReductionPHI node. But during vectorization this ReductionPHI
can be vectorized itself and replaced by the `undef` value, while the
instruction itself is marked for deletion. This 'marked for deletion'
PHI node then can be used in new binary operation, causing "Use still
stuck around after Def is destroyed" crash upon PHI node deletion.

Also the test is fixed to make it perform actual testing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 12:02:28 +00:00
George Rimar
5e7dda5a1f [Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large.
Elf.h already has code checking that section table does not go past end of file.
Problem is that this check may not work on values greater than UINT64_MAX / Header->e_shentsize
because of calculation overflow.

Parch fixes the issue.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 11:50:04 +00:00
George Rimar
464f0d7886 [Object/ELF] - Do not allow overflow when checking section size/offset.
Overflow was the reason of incorrect passing the check,
patch fixes the case.

Differentail revision: https://reviews.llvm.org/D25514

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 11:44:56 +00:00
George Rimar
2bbde38ea6 [Object/ELF] - Do not crash if string table sh_size is equal to zero.
Revealed using "id_000038,sig_11,src_000015,op_havoc,rep_16" from PR30540,
when sh_size was 0, crash happened.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 11:41:57 +00:00
Sam Parker
1341f74f93 [ARM] Add newline char to test.
Missed a newline in the previous commit.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 10:43:02 +00:00
Sam Parker
a6ec572d31 [ARM] Predicate UMAAL selection on hasDSP.
UMAAL is a DSP instruction and it is not available on thumbv7m
(Cortex-M3) and thumbv6m (Cortex-M0+1) targets. Also fix wrong
CHECK prefix in longMAC.ll test.

Patch by Vadzim Dambrouski.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 09:47:10 +00:00
Dylan McKay
c63ef8d346 [AVR] Generate all of the TableGen files we need
This enables generation of all of the TableGen files that are used
downstream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 08:20:47 +00:00
Nicolai Haehnle
ce0a5230f5 AMDGPU: Fix SILoadStoreOptimizer when writes cannot be merged due register dependencies
Summary:
When finding a match for a merge and collecting the instructions that must
be moved, keep in mind that the instruction we merge might actually use one
of the defs that are being moved.

Fixes piglit spec/arb_enhanced_layouts/execution/component-layout/vs-tcs-load-output[-indirect].

The fact that the ds_read in the test case is not eliminated suggests that
there might be another problem related to alias analysis, but that's a
separate problem: this pass should still work correctly even when earlier
optimization passes missed something or were disabled.

Reviewers: tstellarAMD, arsenm

Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 08:15:07 +00:00
Dylan McKay
4e78b45ba8 [AVR] Compile the disassembler
This also updates references of 'TheAVRTarget' to the new
'getTheAVRTarget()' method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 08:09:15 +00:00
Dylan McKay
8b74dfc756 [AVR] Add AVRISelDAGToDAG.cpp
Summary: This pulls the AVR instruction selector in-tree.

Reviewers: arsenm, kparzysz

Subscribers: llvm-commits, wdng, beanz, japaric, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 07:03:47 +00:00
Dylan McKay
e0d500a642 [AVR] Add the machine code emitter
Reviewers: arsenm, kparzysz

Subscribers: wdng, beanz, japaric, llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 06:56:46 +00:00
Nemanja Ivanovic
e9fdaa1bbb [PowerPC] - No SExt/ZExt needed for count trailing zeros
This patch corresponds to review:
https://reviews.llvm.org/D25896

It just eliminates the redundant ZExt after a count trailing zeros instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 05:17:58 +00:00
Kostya Serebryany
56a90b623f [libFuzzer] speculatively trying to fix the Mac build; second attempt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 00:36:38 +00:00
NAKAMURA Takumi
eb87cccbef xray-extract.cc: Quick fix for mingw, to avoid errc::protocol_error.
errc::protocol_error is winsock-oriented and mingw doesn't include it. (MS does, though)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285261 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 00:34:24 +00:00
Kostya Serebryany
9df8914246 [libFuzzer] revert 285259 -- hit commit too soon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 00:24:34 +00:00
Kostya Serebryany
06289376f7 [libFuzzer] speculatively trying to fix the Mac build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 00:22:39 +00:00
Davide Italiano
cf6a8a6948 [IR] Retire unused getGEPReturnType overload. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 23:46:16 +00:00
Tim Shen
5e89a7d1f9 [APFloat] Fix APFloat::getExactInverse when the input is nullptr. This is a regression introduced by r285105.
Reviewers: kbarton, echristo, iteratee, eugenis

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 23:31:41 +00:00
Justin Bogner
403d906e8b llvm-objdump: Make some error messages more consistent
Most of the version of report_error were quoting the filename and
printing a colon between the file name and the error message, but this
one wasn't doing either of those. Fix the output to be more
consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 22:37:52 +00:00
Vedant Kumar
47e18f4158 [utils] Add a '--unified-report' option to the code coverage prep script
In --unified-report mode, a single coverage report is prepared for all
specified binaries and written to *report_dir*. This mode is compatible
with all existing script options, including the --restrict mode which is
used to limit coverage reporting to certain files or directories.

This should not break any existing users of the script.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 22:07:39 +00:00
Vedant Kumar
1182ed1523 [utils] Use print_function in the code coverage prep script, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 22:07:37 +00:00
Vedant Kumar
a8dbdb73ec [utils] Add an '--only-merge' option to the code coverage prep script
In --only-merge mode, the script terminates after the profile merging
step.  This makes the script less stateful: it's more natural to split
the merge out into a separate step instead of relying on the first
invocation of the script to do it.

This should not break any existing users of the script.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 22:07:35 +00:00
Evandro Menezes
04c77eeb64 [AArch64] Create feature set for Samsung Exynos-M2
Since Exynos-M2 improved the FP square root unit a bit over the one in
Exynos-M1, it does not benefit from using the Newton series for such
operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 22:06:20 +00:00
Victor Leschuk
7614f6d29c DebugInfo: fix incorrect alignment type (NFC)
Change type of some missed DebugInfo-related alignment variables,
that are still uint64_t, to uint32_t.

Original change introduced in r284482.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285242 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 21:32:29 +00:00
Reid Kleckner
9b4e828678 [lit] Work around Windows MSys command line tokenization bug
Summary:
This will allow us to revert LLD r284768, which added spaces to get MSys
echo to print what we want.

Reviewers: ruiu, inglorion, rafael

Subscribers: modocache, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 20:29:27 +00:00
Ehsan Amiri
9434af136b [PPC] Remove testcase from incorrect directory
During my last commit this testcase was put in an incorrect directory. Removing
it. Will put it in the right directory when I can verify everything is correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 20:16:59 +00:00
Tim Northover
1ff4f02fe6 ARM: don't rely on push/pop reglists being in order when folding SP adjust.
It would be a very nice invariant to rely on, but unfortunately it doesn't
necessarily hold (and the causes of mis-sorted reglists appear to be quite
varied) so to be robust the frame lowering code can't assume that the first
register in the list is also the first one that actually gets pushed.

Should fix an issue where we were turning something like:

    push {r8, r4, r7, lr}
    sub sp, #24

into nonsense like:

    push {r2, r3, r4, r5, r6, r7, r8, r4, r7, lr}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 20:01:00 +00:00
Nemanja Ivanovic
73235dc8dc Do not assume that FP vector operands are never legalized by expanding
This patch ensures that if a floating point vector operand is legalized by
expanding, it is legalized through the stack rather than by calling
DAGTypeLegalizer::IntegerToVector which will cause a failure since the operand
is a non-integer type.

This fixes PR 30715.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 19:51:35 +00:00
Sanjoy Das
cf6e9a81f6 Simplify x >=u x >> y and x >=u x udiv y
Summary:
Extends InstSimplify to handle both `x >=u x >> y` and `x >=u x udiv y`.

This is a folloup of rL258422 and
https://github.com/rust-lang/rust/pull/30917 where llvm failed to
optimize away the bounds checking in a binary search.

Patch by Arthur Silva!

Reviewers: sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 19:18:43 +00:00
Chad Rosier
5a50eb6b58 Revert "[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory."
This reverts commit r285191.

LICM appears to rely on the Alias Set Tracker hitting lifetime markers to prevent
code from being moved outside of the original scope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285227 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 19:18:19 +00:00
Nemanja Ivanovic
4e7356cfaf [PowerPC] Implement vec_insert_exp builtins - llvm portion
This revision corresponds to review: https://reviews.llvm.org/D25957.
Committing on behalf of Zaara Syeda.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 19:03:40 +00:00
Kostya Serebryany
3c0deb17ec [libFuzzer] simplify TracePC::HandleTrace even further. Also, when dealing with -exit_on_src_pos, symbolize every PC only once
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 18:52:04 +00:00
Chad Rosier
39d39677e6 Fix test from r285217.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 18:49:16 +00:00
Chad Rosier
1d0dc0fb0b [AArch64] Avoid materializing constant 1 when generating cneg instructions.
Instead of

 cmp w0, #1
 orr w8, wzr, #0x1
 cneg w0, w8, ne

we now generate

 cmp w0, #1
 csinv w0, w0, wzr, eq

PR28965

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 18:15:32 +00:00
Dan Gohman
9eeea0a8bb [WebAssembly] Update the README.txt.
Update the README.txt with newer information, add a link to the Emscripten
page explaining the current easiest way to use the LLVM wasm backend, and
mention that other ways of using the LLVM wasm backend are in development.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 17:44:09 +00:00
Nirav Dave
a72a0d6367 [MC] Fix comma typo in .loc parsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 17:28:58 +00:00