131053 Commits

Author SHA1 Message Date
Evgeniy Stepanov
64303264b4 [msan] Handle vector compare x86 intrinsics.
This handles SSE and SSE2 cmp_* and comiXX_* intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 01:19:52 +00:00
David Majnemer
7fdc84bb3c [llvm-pdbdump] Try to appease the ASan bot
We didn't check that the file was large enough to hold a super block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 01:00:17 +00:00
Craig Topper
5f1ec2bfa8 [X86] Use nested switches to vary the operand to helper functions that were previously called in multiple cases. This seems to help the inliner reduce code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 00:51:30 +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
Matthias Braun
66bbcee0a9 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.

This re-applies r260806 with LiveVariables manually added to PowerPC to
hopefully not break the stage 2 bots this time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 23:42:51 +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
Adam Nemet
cbd0de139e [LoopDist] Improve debug messages
The next patch will start using these for -Rpass-analysis so they won't
be internal-only anymore.

Move the 'Skipping; ' prefix that some of the message are using into the
'fail' function.  We don't want to include this prefix in
the -Rpass-analysis report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 23:08:30 +00:00
Adam Nemet
e471e9cba8 [LoopDist] Add helper to print debug message when distribution fails. NFC
This will form the basis to emit optimization remarks (-Rpass*).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 23:08:27 +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
19f78ec7df [CodeGen] Remove extra ';'
Squashes a -Wpedantic warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267944 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 21:49:46 +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
53c317f994 [RDF] Recognize tail calls in graph creation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:40:08 +00:00
Amaury Sechet
8f5959b0e1 Fix warning in PDB code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:39:39 +00:00
Matthias Braun
277501abff LiveIntervalAnalysis: No need to deal with dead subregister defs anymore.
The DetectDeadLaneMask already ensures that we have no dead subregister
definitions making the special handling in LiveIntervalAnalysis
unnecessary. This reverts most of r248335.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:35:26 +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
Zachary Turner
58c6e4e9b3 Add parentheses to silence -Wparentheses warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:26:30 +00:00
Krzysztof Parzyszek
93971d9661 [RDF] Add option to keep dead phi nodes in DFG
Dead phi nodes are needed for code motion (such as copy propagation),
where a new use would be placed in a location that would be dominated
by a dead phi. Such a transformation is not legal for copy propagation,
and the existence of the phi would prevent it, but if the phi is not
there, it may appear to be valid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:17:06 +00:00
Chris Bieneman
c5b250ac84 [CMake] [Darwin] Use libtool instead of ar && ranlib
Summary: Using libtool instead of ar and ranlib on Darwin shaves a minute off my clang build. This is because on Darwin libtool is optimized to give hints to the kernel about filesystem interactions that allow it to be faster.

Reviewers: bogner, pete

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:14:19 +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
Yaron Keren
4030c6e2a8 Remove doInitialization() and doFinalization() member declarations without definitions.
Visual C++ 2015 flags this in the IDE.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 19:21:30 +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
Eugene Zelenko
b116cf62de Fix builds broken in r267910.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:27:35 +00:00
Sriraman Tallam
d41672fa69 Add "PIE Level" metadata to module flags.
http://reviews.llvm.org/D19671

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:15:44 +00:00
Eugene Zelenko
aaf3f0426b Fix some Clang-tidy modernize and Include What You Use warnings.
Differential revision: http://reviews.llvm.org/D19673


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:04:41 +00:00
Rong Xu
18e6fc32c0 [PGO] Fix incorrect Twine usage in emitting optimization remarks.
Should not store Twine objects to local variables. This is fixed the test
failures with r267815 in VS2015 X64 build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 17:49:56 +00:00
Rong Xu
2e8a2bbbd1 Minor format change and fixing typos in the comments. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 17:31:22 +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
Chad Rosier
c831d1b1ef [GVN] Minor code cleanup. NFC.
Differential Revision: http://reviews.llvm.org/D18828
Patch by Aditya Kumar!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 16:00:15 +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
Adrian Prantl
ee1e0438b6 Debug Info: Restore the pre-r240853 behavior for DWARF2 bitfields.
The DWARF2 specification of DW_AT_bit_offset is ambiguous for
little-endian machines, but by restoring to the old behavior
we match what debuggers expect and what other popular compilers
generate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 15:37:52 +00:00
Adrian Prantl
9ed561fe46 Debug info: Support DWARF4 bitfields via DW_AT_data_bit_offset.
The DWARF2 specification of DW_AT_bit_offset was written from the perspective of
a big-endian machine with unclear semantics for other systems.  DWARF4
deprecated DW_AT_bit_offset and introduced a new attribute DW_AT_data_bit_offset
that simply counts the number of bits from the beginning of the containing
entity regardless of endianness.

After this patch LLVM emits DW_AT_bit_offset for DWARF 2 or 3 and
DW_AT_data_bit_offset when DWARF 4 or later is requested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 15:37:48 +00:00
Geoff Berry
a7480ba29a [EarlyCSE] Change LoadValue field Value *Data to Instruction *Inst. NFC.
Made in preparation for adding MemorySSA support to EarlyCSE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 15:22:37 +00:00
Kostya Serebryany
361c970533 [libFuzzer] Improve documentation
Reviewers: kcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 15:19:05 +00:00
Krzysztof Parzyszek
12db936b00 [RDF] Handle undefined registers in RDF copy propagation
When updating the graph, make sure that new uses without reaching defs
are handled correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 15:09:19 +00:00
Geoff Berry
629af37374 [EarlyCSE] Sort includes. NFC.
Reviewers: mcrosier

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267890 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 14:59:27 +00:00
Yaron Keren
85c121599e Rangify for loops, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 14:49:44 +00:00
Chad Rosier
4c4e04be2b [Inliner] Formatting. NFC.
Patch by Aditya Kumar!
Differential Revision: http://reviews.llvm.org/D19047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267888 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 14:47:23 +00:00
Ahmed Bougacha
c775e31867 [InstCombine] Remove trailing whitespace. NFC.
r267873.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267887 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 14:36:07 +00:00
Simon Pilgrim
fa0eab1450 [InstCombine][SSE] Add MOVMSK support to SimplifyDemandedUseBits
The MOVMSK instructions copies a vector elements' sign bits to the low bits of a scalar register and zeros the high bits.

This patch adds MOVMSK support to SimplifyDemandedUseBits so that its aware that the upper bits are known to be zero. It also removes the call to MOVMSK if none of the lower bits are actually required and just returns zero.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 12:22:53 +00:00
Craig Topper
dc03033554 [X86] Remove unused operand from a function and all its callers. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 05:58:46 +00:00