Commit Graph

36053 Commits

Author SHA1 Message Date
Matt Arsenault
6d8c39b760 DAGCombiner: Reduce truncated shl width
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268094 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 19:53:16 +00:00
David Majnemer
359298ea08 [ValueTracking] matchSelectPattern needs to be more careful around FP
matchSelectPattern attempts to see through casts which mask min/max
patterns from being more obvious.  Under certain circumstances, it would
misidentify a sequence of instructions as a min/max because it assumed
that folding casts would preserve the result.  This is not the case for
floating point <-> integer casts.

This fixes PR27575.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 18:40:34 +00:00
Artem Tamazov
39e28634ef [AMDGPU][llvm-mc] Add some missing testcases to trap.s
Differential Revision: http://reviews.llvm.org/D19602

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:41:44 +00:00
Geoff Berry
4c9f41e56f [BasicAA] Treat llvm.assume as not accessing memory in getModRefBehavior(Function)
Reviewers: dberlin, chandlerc, hfinkel, reames, sanjoy

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:18:28 +00:00
Artem Tamazov
f3487e82c4 Fixed/Recommitted r267733 "[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD."
Previously reverted by r267752.

r267733 review:
Differential Revision: http://reviews.llvm.org/D19342

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:04:50 +00:00
Guozhi Wei
d707220214 [PPC] Enable shuffling of VSX vectors
This patch fixes PR27078 by enabling shuffling of vectors if VSX is available.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:00:54 +00:00
Amjad Aboud
2f41b0fa11 Fixed LIT tests that was broken after change in r268054.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:54:18 +00:00
Sanjay Patel
6881bc84c4 auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268061 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:39:37 +00:00
Daniel Sanders
334e32689e [mips][ias] Move createCpRestoreMemOp to MipsTargetStreamer. NFC.
Summary:
This removes the temporary call to isIntegratedAssemblerRequired() which was
added recently. It's effect is now acheived directly in the MipsTargetStreamer
hierarchy.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268058 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:16:49 +00:00
Amjad Aboud
36853e8292 Recommitted r264280 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 in r267004.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:07:55 +00:00
Simon Dardis
260e00965a [mips][FastISel] A store is not a load.
Correct trivial error. One of the failing tests from PR/27458.

Reviewers: dsanders, vkalintiris, mcrosier

Differential Review: http://reviews.llvm.org/D19726



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:07:47 +00:00
Krzysztof Parzyszek
744cc49078 [Hexagon] Optimize addressing modes for load/store
Patch by Jyotsna Verma.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 15:49:13 +00:00
Tom Stellard
ac19ae8d63 AMDGPU/SI: Add offset field to ds_permute/ds_bpermute instructions
Summary:
These instructions can add an immediate offset to the address, like other
ds instructions.

Reviewers: arsenm

Subscribers: arsenm, scchan

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 14:34:26 +00:00
Daniel Sanders
f4d5a508ae [mips][ias] Split expandMemInst between MipsAsmParser and MipsTargetStreamer. Almost NFC.
Summary:
The portion in MipsAsmParser is responsible for figuring out which expansion to
use, while the portion in MipsTargetStreamer is responsible for emitting it.

This allows us to remove the call to isIntegratedAssemblerRequired() which is
currently ensuring the effect of .cprestore only occurs when writing objects.

The small functional change is that the memory offsets are now correctly
printed as signed values.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 13:43:45 +00:00
Daniel Sanders
ae3740223b [mips][ias] Make section sizes a multiple of the alignment.
Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 12:44:07 +00:00
Simon Pilgrim
ea52c95508 [InstCombine][SSE] Added x86 pshufb undef mask tests
FIXME: We currently don't support folding constant pshufb shuffle masks containing undef elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 09:13:53 +00:00
Nikolay Haustov
02cd01c121 AMDGPU/SI: Assembler: Unify parsing/printing of operands.
Summary:
The goal is for each operand type to have its own parse function and
at the same time share common code for tracking state as different
instruction types share operand types (e.g. glc/glc_flat, etc).

Introduce parseAMDGPUOperand which can parse any optional operand.
DPP and Clamp/OMod have custom handling for now. Sam also suggested
to have class hierarchy for operand types instead of table. This
can be done in separate change.

Remove parseVOP3OptionalOps, parseDS*OptionalOps, parseFlatOptionalOps,
parseMubufOptionalOps, parseDPPOptionalOps.
Reduce number of definitions of AsmOperand's and MatchClasses' by using common base class.
Rename AsmMatcher/InstPrinter methods accordingly.
Print immediate type when printing parsed immediate operand.
Use 'off' if offset/index register is unused instead of skipping it to make it more readable (also agreed with SP3).
Update tests.

Reviewers: tstellarAMD, SamWot, artem.tamazov

Subscribers: qcolombet, arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 09:02:30 +00:00
Simon Pilgrim
63d2ca4a73 [InstCombine][SSE] Regenerated x86 pshufb tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268014 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 08:53:35 +00:00
Zlatko Buljan
951fe566b4 [mips][microMIPS] Fix offsets for LLE, LWE, SBE, SCE and SHE instructions
Differential Revision: http://reviews.llvm.org/D18645


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 08:36:54 +00:00
David Majnemer
1766d67d13 [DeadArgumentElimination] Propagate operand bundles to promoted call sites
We neglected to transfer operand bundles when performing argument
promotion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 07:22:36 +00:00
Adam Nemet
7ea09d54b5 [LoopDist] Add missing RUN line in test from r268006
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 07:16:00 +00:00
Adam Nemet
4d336bd208 [LoopDist] Also emit optimization remark on success (-Rpass=)
The option -Rpass=loop-distribute now reports the loops that were
distributed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 07:10:46 +00:00
David Majnemer
419fc9c644 [SLPVectorizer] Add operand bundles to vectorized functions
SLPVectorizing a call site should result in further propagation of its
bundles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268004 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 07:09:51 +00:00
David Majnemer
a89ddf6e7c [LoopVectorize] Add operand bundles to vectorized functions
Also, do not crash when calculating a cost model for loop-invariant
token values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 07:09:48 +00:00
Matt Arsenault
0638337d10 AMDGPU: Stop reporting an addressing mode for unknown addrspace
This was being treated the same as private, which has an immediate
offset. For unknown, it probably means it's for a computation not
actually being used for accessing memory, so it should not have a
nontrivial addressing mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 06:25:10 +00:00
Matt Arsenault
e8448abead DivergenceAnalysis: Fix crash with unreachable blocks
Unreachable blocks may not be in the dominator tree,
so don't crash on them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268001 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 06:17:47 +00:00
David Majnemer
e73d0289be [ArgumentPromotion] Propagate operand bundles to promoted call sites
We neglected to transfer operand bundles when performing argument
promotion.

This fixes PR27568.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 04:56:12 +00:00
Michael Zolotukhin
bf6113b8c0 [PR25281] Remove AAResultsWrapper from preserved analyses of loop vectorizer.
We don't preserve AAResults, because, for one, we don't preserve SCEV-AA.
That fixes PR25281.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 03:31:25 +00:00
Matthias Braun
e39fb36a01 RegisterPressure: Fix default lanemask for missing regunit intervals
In case of missing live intervals for a physical registers
getLanesWithProperty() would report 0 which was not a safe default in
all situations. Add a parameter to pass in a safe default.
No testcase because in-tree targets do not skip computing register unit
live intervals.

Also cleanup the getXXX() functions to not perform the
RequireLiveIntervals checks anymore so we do not even need to return
safe defaults.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 02:44:54 +00:00
Vedant Kumar
17d25e3044 [llvm-cov] Don't emit 'nan%' in reports
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267971 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 01:31:49 +00:00
Hal Finkel
8628001526 [LoopVectorize] Keep hints from original loop on the vector loop
We need to keep loop hints from the original loop on the new vector loop.
Failure to do this meant that, for example:

  void foo(int *b) {
  #pragma clang loop unroll(disable)
    for (int i = 0; i < 16; ++i)
      b[i] = 1;
  }

this loop would be unrolled. Why? Because we'd vectorize it, thus dropping the
hints that unrolling should be disabled, and then we'd unroll it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 01:27:40 +00:00
David Majnemer
00a5029707 [llvm-pdbdump] Restore error messages, handle bad block sizes
We lost the ability to report errors, bring it back.  Also, correctly
validate the block size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 23:47:27 +00:00
David Majnemer
36575f0cb1 [llvm-pdbdump] Correctly read data larger than a block
A bug was introduced when the code was refactored which resulted in a
bad memory access.

This fixes PR27565.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 23:24:23 +00:00
Adam Nemet
f2aab3d154 [LoopDist] Emit optimization remarks (-Rpass*)
I closely followed the precedents set by the vectorizer:

* With -Rpass-missed, the loop is reported with further details pointing
to -Rpass--analysis.

* -Rpass-analysis reports the details why distribution has failed.

* Regardless of -Rpass*, when distribution fails for a loop where
distribution was forced with the pragma, a warning is produced according
to -Wpass-failed.  In this case the analysis info is also printed even
without -Rpass-analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 23:08:32 +00:00
Hal Finkel
01719c8ac0 [Inliner] Preserve llvm.mem.parallel_loop_access metadata
When inlining a call site with llvm.mem.parallel_loop_access metadata, this
metadata needs to be propagated to all cloned memory-accessing instructions.
Otherwise, inlining parts of the loop body will invalidate the annotation.

With this functionality, we now vectorize the following as expected:

  void Body(int *res, int *c, int *d, int *p, int i) {
    res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
  }

  void Test(int *res, int *c, int *d, int *p, int n) {
    int i;

  #pragma clang loop vectorize(assume_safety)
    for (i = 0; i < 1600; i++) {
      Body(res, c, d, p, i);
    }
  }

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 23:00:04 +00:00
Dehao Chen
28fd20cf1e Read discriminators correctly from object file.
Summary:
This is the follow-up patch for http://reviews.llvm.org/D19436
* Update the discriminator reading algorithm to match the assignment algorithm.
* Add test to cover the new algorithm.

Reviewers: dnovillo, echristo, dblaikie

Subscribers: danielcdh, dblaikie, echristo, llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 22:09:37 +00:00
Marcin Koscielnicki
b527cb338d [PowerPC] Fix the EH_SjLj_Setup pseudo.
This instruction is just a control flow marker - it should not
actually exist in the object file.  Unfortunately, nothing catches
it before it gets to AsmPrinter.  If integrated assembler is used,
it's considered to be a normal 4-byte instruction, and emitted as
an all-0 word, crashing the program.  With external assembler,
a comment is emitted.

Fixed by setting Size to 0 and handling it in MCCodeEmitter - this
means the comment will still be emitted if integrated assembler
is not used.

This broke an ASan test, which has been disabled for a long time
as a result (see the discussion on D19657).  We can reenable it
once this lands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 21:24:37 +00:00
Kevin Enderby
bfb3d2356b Fix a bug in llvm-objdump for -private-headers printing the LC_CODE_SIGNATURE Mach-O load command.
rdar://25985653


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 21:07:20 +00:00
Krzysztof Parzyszek
9f608022e3 [RDF] Improve handling of inline-asm
- Keep implicit defs from inline-asm instructions.
- Treat register references from inline-asm as fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:33:33 +00:00
Kevin Enderby
6ede1c09ad Update llvm-objdump for disassembly of ARM Mach-O files to always include the opcode bytes.
As this is the expected behavior of the old darwin otool(1) for ARM Mach-O files.

rdar://25896249


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:14:13 +00:00
Zachary Turner
5515858465 Read the rest of the DBI substreams, and parse source info.
We now read out the rest of the substreams from the DBI streams.  One of
these substreams, the FileInfo substream, contains information about which
source files contribute to each module (aka compiland).  This patch
additionally parses out the file information from that substream, and
dumps it in llvm-pdbdump.

Differential Revision: http://reviews.llvm.org/D19634
Reviewed by: ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:05:18 +00:00
Kit Barton
956cf768e2 This reverts commit r265505.
Revert "[Power9] Implement add-pc, multiply-add, modulo, extend-sign-shift, random number, set bool, and dfp test significance".
This patch has caused a functional regression in SPEC2k6 namd, and a performance regression in mesa-pipe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:00:42 +00:00
Krzysztof Parzyszek
a59d9016fc [Hexagon] Add instruction aliases for vector unsigned compare-equal
Unsigned compare-equal instructions are mapped to signed compare-equal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 19:49:18 +00:00
Matt Arsenault
fb3ad89dbc AMDGPU: Emit error if too much LDS is used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 19:37:35 +00:00
Krzysztof Parzyszek
6af1d8fce6 Reset the TopRPTracker's position in ScheduleDAGMILive::initQueues
ScheduleDAGMI::initQueues changes the RegionBegin to the first non-debug
instruction. Since it does not track register pressure, it does not affect
any RP trackers. ScheduleDAGMILive inherits initQueues from ScheduleDAGMI,
and it does reset the TopTPTracker in its schedule method. Any derived,
target-specific scheduler will need to do it as well, but the TopRPTracker
is only exposed as a "const" object to derived classes. Without the ability
to modify the tracker directly, this leaves a derived scheduler with a
potential of having the TopRPTracker out-of-sync with the CurrentTop.

The symptom of the problem:
  void llvm::ScheduleDAGMILive::scheduleMI(llvm::SUnit *, bool):
  Assertion `TopRPTracker.getPos() == CurrentTop && "out of sync"' failed.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 19:17:44 +00:00
Matt Arsenault
3ba7927b46 AMDGPU: Fix mishandling array allocations when promoting alloca
The canonical form for allocas is a single allocation of the array type.
In case we see a non-canonical array alloca, make sure we aren't
replacing this with an array N times smaller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:38:48 +00:00
Krzysztof Parzyszek
19cc1fb430 [Hexagon] Define certain aliases for vector instructions
Specifically:
  Vd = #0   -> Vd = vxor(Vd, Vd)
  Vdd = #0  -> Vdd.w = vsub(Vdd.w, Vdd.w)
  Vdd = Vss -> Vdd = vcombine(Vss.H, Vss.L)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 16:43:16 +00:00
Simon Dardis
85648b98a9 [mips][atomics] Fix partword atomic binary operation implementation
Currently Mips::emitAtomicBinaryPartword() does not properly respect the
width of pointers. For MIPS64 this causes the memory address that the ll/sc
sequence uses to be truncated. At runtime this causes a segmentation fault.

This can be fixed by applying similar changes as r266204, so that a full 64bit
pointer is loaded.

Reviewers: dsanders

Differential Review: http://reviews.llvm.org/D19651


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 16:26:43 +00:00
Arch D. Robison
e95eedcc04 [SLPVectorizer] Extend SLP Vectorizer to deal with aggregates.
The refactoring portion part was done as r267748.

http://reviews.llvm.org/D14185



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 16:11:45 +00:00
Krzysztof Parzyszek
7ea83df48b [Hexagon] Handle double-vector registers as new-value producers
Patch by Colin LeMahieu.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 15:54:48 +00:00