133757 Commits

Author SHA1 Message Date
Vassil Vassilev
9ddfbe4c40 [modules] Combine Pass.h, PassSupport.h and PassAnalysisSupport.h into one module.
The header files are designed to be used always together (through Pass.h).

Addresses the first part of https://llvm.org/bugs/show_bug.cgi?id=27991

Patch by Cristina Cristescu and me.

Reviewed by Richard Smith.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 08:00:29 +00:00
Hrvoje Varga
98d31c1b79 [mips][micromips] Implement DCLO, DCLZ, DROTR, DROTR32 and DROTRV instructions
Differential Revision: http://reviews.llvm.org/D16917


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 07:06:25 +00:00
Sean Silva
3312f93c90 Attempt to define friend function more portably.
Patch written by Reid. I verified it locally with clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 07:00:19 +00:00
Chuang-Yu Cheng
c18d21a34d SimplifyCFG is able to detect the pattern:
(i == 5334 || i == 5335)
to:
    ((i & -2) == 5334)

This transformation has some incorrect side conditions. Specifically, the
transformation is only applied when the right-hand side constant (5334 in
the example) is a power of two not equal and not equal to the negated mask.
These side conditions were added in r258904 to fix PR26323. The correct side
condition is that: ((Constant & Mask) == Constant)[(5334 & -2) == 5334].

It's a little bit hard to see why these transformations are correct and what
the side conditions ought to be. Here is a CVC3 program to verify them for
64-bit values:
    ONE  : BITVECTOR(64) = BVZEROEXTEND(0bin1, 63);
    x    : BITVECTOR(64);
    y    : BITVECTOR(64);
    z    : BITVECTOR(64);
    mask : BITVECTOR(64) = BVSHL(ONE, z);
    QUERY( (y & ~mask = y) =>
           ((x & ~mask = y) <=> (x = y OR x = (y |  mask)))
    );

Please note that each pattern must be a dual implication (<--> or iff). One
directional implication can create spurious matches. If the implication is
only one-way, an unsatisfiable condition on the left side can imply a
satisfiable condition on the right side. Dual implication ensures that
satisfiable conditions are transformed to other satisfiable conditions and
unsatisfiable conditions are transformed to other unsatisfiable conditions.

Here is a concrete example of a unsatisfiable condition on the left
implying a satisfiable condition on the right:
    mask = (1 << z)
    (x & ~mask) == y --> (x == y || x == (y | mask))

Substituting y = 3, z = 0 yields:
    (x & -2) == 3 --> (x == 3 || x == 2)

The version of this code before r258904 had no side-conditions and
incorrectly justified itself in comments through one-directional
implication.

Thanks to Chandler for the suggestion!

Author: Thomas Jablin (tjablin)
Reviewers: chandlerc majnemer hfinkel cycheng

http://reviews.llvm.org/D21417

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 04:44:25 +00:00
Craig Topper
2ad3ede66c [X86] Pre-size some SmallVectors using the constructor in the shuffle lowering code instead of using push_back. Some of these already did this but used resize or assign instead of the constructor. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 03:58:45 +00:00
Craig Topper
0a2f9f9514 [X86] Remove else after return. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 03:58:42 +00:00
Craig Topper
c9dd8c46c2 [X86] Inline a couple lambdas into their callers since they are only used once and it all fits on a single line. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272869 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 03:11:00 +00:00
Eli Friedman
3c80c26580 [InstCombine] Don't widen metadata on store-to-load forwarding
The original check for load CSE or store-to-load forwarding is wrong
when the forwarded stored value happened to be a load.

Ref https://github.com/JuliaLang/julia/issues/16894

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

Patch by Yichao Yu!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 02:33:42 +00:00
Vitaly Buka
3cf4eef2a1 Fix test from D21194
Bot sets ASAN_OPTIONS=handle_abort=1 which prevents expected crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 01:52:48 +00:00
Tim Northover
bde073f537 AArch64: allow MOV (imm) alias to be printed
The backend has been around for years, it's pretty ridiculous that we can't
even use the preferred form for printing "MOV" aliases. Unfortunately, TableGen
can't handle the complex predicates when printing so it's a bunch of nasty C++.
Oh well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 01:42:25 +00:00
Reid Kleckner
40ba8343dc [codeview] Regenerate test case with unique identifiers
Clang now emits these, and these match MSVC. Should allow more powerful
merging of type records across TUs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 01:33:59 +00:00
Vitaly Buka
eb7016ef82 Debugging D21194 issues on bot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 01:26:46 +00:00
Eric Christopher
4b29faaa07 Tidy the asm parser: 80-col, whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 01:00:53 +00:00
Matt Arsenault
11e5e3bbe1 AMDGPU: Disable scheduling in some slow tests
Disabling the pre-RA scheduler on large-work-group-registers
causes it to be ~50% slower.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 00:56:47 +00:00
Vitaly Buka
35825a3ed7 Enable libFuzzer's afl_driver to append stderr to a file.
Summary:
[libFuzzer] Enable afl_driver to append stderr to a user specified file.

Append stderr of afl_driver to the file specified by the environmental variable
AFL_DRIVER_STDERR_DUPLICATE_FILENAME if it is set. This lets users see outputs
on crashes without rerunning crashing test cases (which won't work for crashes
that are difficult to reproduce). Before this patch, stderr would only be sent to afl-fuzz
and users would have no way of seeing it.

Reviewers: llvm-commits, aizatsky, kcc, vitalybuka

Subscribers: vitalybuka

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 00:14:42 +00:00
Justin Lebar
60cc4971e1 [IR] [DAE] Copy comdats during DAE, and don't copy comdats in GlobalObject::copyAttributesFrom.
Summary: This reverts the changes to Globals.cpp and IRMover.cpp in
"[IR] Copy comdats in GlobalObject::copyAttributesFrom" (D20631,
rL270743).

The DeadArgElim test is left unchanged, and we change DAE to explicitly
copy comdats.

The reverted change breaks copyAttributesFrom when the destination lives
in a different module from the source.  The decision in D21255 was to
revert this patch and handle comdat copying separately from
copyAttributesFrom.

Reviewers: majnemer, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 23:20:15 +00:00
Justin Lebar
b570d71127 [Bugpoint] Erase comdat annotations after removing a global's initializer.
Summary:
This is necessary to keep the verifier happy after bugpoint removes an
initializer from a global variable with a comdat annotation, because
globals without initializers may not have comdats.

Reviewers: majnemer, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 23:20:12 +00:00
Adam Nemet
2978728dd2 [LV] Make the new getter return a const reference. NFC
LoopVectorizationLegality holds a constant reference to LAI, so this
will have to be const as well.

Also added missed function comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 22:58:27 +00:00
Xinliang David Li
ac1a58e7e9 Address review feedbacks of AddDiscriminator change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 22:20:56 +00:00
Chad Rosier
1e8c62127b [DSE] Hoist a redundant check to simplify logic. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 22:17:38 +00:00
Sanjay Patel
2514d4ab55 fix comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 22:01:28 +00:00
Xinliang David Li
438355c7b4 [PM] Port Add discriminator pass to new PM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:51:30 +00:00
Chad Rosier
57c478eeb8 Typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:41:22 +00:00
Rui Ueyama
fbe558b2f9 [Codeview] Add a class for LF_UDT_MOD_SRC_LINE.
Differential Revision: http://reviews.llvm.org/D21406

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:25:29 +00:00
Davide Italiano
f56a12348e [PM] Remove unneded doFinalization() override from LoopVersioningLICM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:23:54 +00:00
Sanjay Patel
079ac1edc0 [x86, SSE] update packed FP compare tests for direct translation from builtin to IR
The clang side of this was r272840:
http://reviews.llvm.org/rL272840

A follow-up step would be to auto-upgrade and remove these LLVM intrinsics completely.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:22:15 +00:00
Chad Rosier
357edbc1d6 Address a few coding style issues. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272838 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:14:02 +00:00
Kevin Enderby
04195353af Fix llvm-objdump when disassembling a stripped Mach-O binary with the -macho option.
It was printing out nothing in this case.

llvm-objdump tries to disassemble sections a symbol at a time.  In the case of a
fully stripped Mach-O executable the only symbol remaining in the (__TEXT,__text)
section is the special linker defined symbol __mh_execute_header . This
symbol is special in that while it is N_SECT symbol in the (__TEXT,__text)
its address is before the start of the (__TEXT,__text).  It’s address is the
start of the __TEXT segment which is where the mach header is statically
linked. So the code in DisassembleMachO() needs to deal with this case specially.

rdar://26778273


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:14:01 +00:00
Krzysztof Parzyszek
16185a2b7f [Hexagon] Fix/simplify some conditional statements
Fix for PR28138.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:05:04 +00:00
Kevin B. Smith
f258b9a271 [X86]: Fix for uninitialized access introduced in r272797.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:52:19 +00:00
Sanjay Patel
efa2e76536 [x86] delete unnecessary function declarations
Missed this in r272806, r272807.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:51:47 +00:00
George Burgess IV
3cdf3eb380 [CFLAA] Ignore non-pointers, move Attrs to graph nodes.
This patch makes CFLAA ignore non-pointer values, since we can now
sanely do that with the escaping/unknown attributes. Additionally,
StratifiedAttrs make more sense to sit on nodes than edges (since
they're properties of values, and ultimately end up on the nodes of
StratifiedSets). So, this patch puts said attributes on nodes.

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:43:41 +00:00
Tim Northover
4d6b849855 AArch64: stop trying to use 32-bit MOVZs when expanding patchpoints.
Of course the assembly was right but because the opcode was MOVZWi it was
encoded as "movz w16, #65535, lsl #32" which is an unallocated encoding and
would go horribly wrong on a CPU.

No idea how this bug survived this long. It seems nobody is using that aspect
of patchpoints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:33:36 +00:00
Reid Kleckner
0fadb1f37c Axe some trailing whitespace from my last commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:32:42 +00:00
Reid Kleckner
f07202a7aa [codeview] Move deserialization methods out of line
They aren't performance critical and don't need to be inline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:30:34 +00:00
Sanjay Patel
2df18c8dc0 [x86] add folds for x86 vector compare nodes (PR27924)
Ideally, we can get rid of most x86 LLVM intrinsics by transforming them to IR (and some of that happened 
with http://reviews.llvm.org/rL272807), but it doesn't cost much to have some simple folds in the backend
too while we're working on that and as a backstop.

This fixes:
https://llvm.org/bugs/show_bug.cgi?id=27924

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:26:58 +00:00
Matthias Braun
c882f76cf5 Statistic: Add machine parseable json output
- We lacked a short unique identifier for a statistics, so I renamed the
  current "Name" field that just contained the DEBUG_TYPE name of the
  current file to DebugType and added a new "Name" field that contains
  the C++ identifier of the statistic variable.
- Add the -stats-json option which outputs statistics in json format.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:19:16 +00:00
Davide Italiano
227b804262 [LoopSimplify] Analyses do not need to be member variables.
In preparation for porting this pass to the new PM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 18:51:25 +00:00
Reid Kleckner
90392dad06 [codeview] Use ArrayRef instead of a non-const vector reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272817 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 18:48:35 +00:00
Rui Ueyama
69d870720c [pdbdump] Verify LF_{CLASS,ENUM,INTERFACE,STRUCTURE,UNION} records.
Differential Revision: http://reviews.llvm.org/D21361

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272815 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 18:26:59 +00:00
Kevin B. Smith
42abc92144 [X86]: Updated r272801 to promote 16 bit compares with immediate operand
to 32 bits. This is in response to a comment by Eli Friedman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272814 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 18:18:05 +00:00
David Majnemer
b372f89f41 [CodeView] Add support for emitting S_UDT for typedefs
Emit a S_UDT record for typedefs.  We still need to do something for
class types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 18:00:01 +00:00
Amaury Sechet
a2f727daf6 Add support for string attributes in the C API.
Summary: As per title. This completes the C API Attribute support.

Reviewers: Wallbraker, whitequark, echristo, rafael, jyknight

Subscribers: mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 17:50:39 +00:00
Pankaj Gode
7d829a30aa Test commit after access grant. Modified comment by adding a period.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 17:24:52 +00:00
Sanjay Patel
3539217c1c [x86, SSE] remove the GCCBuiltins from the integer min/max intrinsics
This allows us to emit native IR in Clang (next commit).
Also, update the intrinsic tests to show that codegen already knows how to handle
the IR that Clang will soon produce.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 17:17:27 +00:00
Sanjay Patel
83a669a70f [x86] fix function name; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 17:12:29 +00:00
David Majnemer
7f26e26d0c [TargetLibraryInfo] Teach isValidProtoForLibFunc about tan
We would fail to validate the type of the tan function which would cause
downstream users of isValidProtoForLibFunc to assert.

This fixes PR28143.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 16:47:23 +00:00
Kevin B. Smith
746c3b7ff4 [X86]: Quit promoting 8 and 16 bit compares to 32 bit.
Differential Revision: http://reviews.llvm.org/D21144


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 16:37:46 +00:00
Nirav Dave
63a4b3937b Revert "Preserve DebugInfo when replacing values in DAGCombiner"
Reverting due to assertion failure in
lib/CodeGen/SelectionDAG/InstrEmitter.cpp

This reverts commit r272792.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 16:08:50 +00:00
Kevin B. Smith
8800861c19 [X86]: Improve Liveness checking for X86FixupBWInsts.cpp
Differential Revision: http://reviews.llvm.org/D21085


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 16:03:06 +00:00