133740 Commits

Author SHA1 Message Date
Rui Ueyama
6b7e0cc92c [codeview] Use hashBufferV8 to verify all type records.
Differential Revision: http://reviews.llvm.org/D21393

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:39:17 +00:00
Zachary Turner
e8d381d02c Resubmit "[pdb] Change type visitor pattern to be dynamic."
There was a regression introduced during type stream merging when
visiting a field list record.  This has been fixed in this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:22:27 +00:00
Rafael Espindola
1f4afa2405 dos2unix this test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:21:11 +00:00
Zachary Turner
575a9fbcc9 Revert "[pdb] Change type visitor pattern to be dynamic."
This reverts commit fb0dd311e1ad945827b8ffd5354f4810e2be1579.

This breaks some llvm-readobj tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:09:04 +00:00
Zachary Turner
fb0dd311e1 [pdb] Change type visitor pattern to be dynamic.
This allows better catching of compiler errors since we can use
the override keyword to verify that methods are actually
overridden.

Also in this patch I've changed from storing a boolean Error
code everywhere to returning an llvm::Error, to propagate richer
error information up the call stack.

Reviewed By: ruiu, rnk
Differential Revision: http://reviews.llvm.org/D21410

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 18:00:28 +00:00
Davide Italiano
705956ea8f [PM] Revert the port of MergeLoadStoreMotion to the new pass manager.
Daniel Berlin expressed some real concerns about the port and proposed
and alternative approach. I'll revert this for now while working on a
new patch, which I hope to put up for review shortly. Sorry for the churn.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 17:40:53 +00:00
Chad Rosier
8e662dc4d5 [DSE] Minor style cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 17:06:04 +00:00
Sanjay Patel
255484c723 remove old FileCheck lines that are no longer used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 17:04:16 +00:00
Sanjay Patel
f449b0e944 [DAG] Remove redundant FMUL in Newton-Raphson SQRT code
When calculating a square root using Newton-Raphson with two constants,
a naive implementation is to use five multiplications (four muls to calculate
reciprocal square root and another one to calculate the square root itself).
However, after some reassociation and CSE the same result can be obtained
with only four multiplications. Unfortunately, there's no reliable way to do
such a reassociation in the back-end. So, the patch modifies NR code itself
so that it directly builds optimal code for SQRT and doesn't rely on any
further reassociation.

Patch by Nikolai Bozhenov!

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:58:54 +00:00
Wei Ding
4edb79d2d9 AMDGPU: Add v_mad 16-bit instructions definition.
Differential Revision: http://reviews.llvm.org/D21362

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:50:04 +00:00
Adam Nemet
b4b586ba9c [LLE] New test to check that no versioning for symbolic strides occurs. NFC
This is currently only performed in the Vectorizer.  I will change this
as symbolic stride collection is moved to LAA.

This test will track when the actual functional change occurs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:45:29 +00:00
Matt Arsenault
ce9eebb1ec LangRef: Note expectations when loading with extra alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272914 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:33:41 +00:00
Igor Laevsky
bf43bfa0c0 Revert r272891 "[JumpThreading] Prevent dangling pointer problems in BranchProbabilityInfo"
It was causing failures in Profile-i386 and Profile-x86_64 tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:25:53 +00:00
Reid Kleckner
71b1fedfef [PATCH] Fix RuntimeDyldCOFFI386 to handle relocations with a non-zero addend
This fixes IMAGE_REL_I386_DIR32, IMAGE_REL_I386_DIR32NB,
IMAGE_REL_I386_SECREL, and IMAGE_REL_I386_REL32 relocations.

Based on patch by Jon Turney <jon.turney@dronecode.org.uk>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:21:41 +00:00
Rafael Espindola
b72793375f Don't print (PLT) on arm.
The R_ARM_PLT32 relocation is deprecated and is not produced by MC.

This means that the code being deleted is dead from the .o point of
view and was making the .s more confusing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 16:09:53 +00:00
Sanjay Patel
2c8c45d695 [x86] autoupgrade and remove SSE2/SSE41 integer min/max intrinsics
Follow-up to:
http://reviews.llvm.org/rL272806
http://reviews.llvm.org/rL272807


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:48:30 +00:00
Daniel Sanders
7b8f692aa1 Remove redundant -mattr options from llvm-objdump commands.
The -mattr options in these four tests have no effect on the output of
llvm-objdump. In the case of the two Mips tests, removing the -mattr option
left duplicate RUN lines so the duplicates have been removed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:47:19 +00:00
Rafael Espindola
4b205a57a6 Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:44:06 +00:00
Rafael Espindola
cb6c7a5185 Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:40:24 +00:00
Rafael Espindola
bb6bdeccf1 Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:31:06 +00:00
Rafael Espindola
5f2b7065a7 Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 15:22:01 +00:00
Rui Ueyama
43c7bd0b82 [codeview] Pass CVRecord to visitTypeBegin callback.
Both parameters to visitTypeBegin are actually members of CVRecord,
so we can just pass CVRecord instead of destructuring it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 14:47:23 +00:00
Rui Ueyama
70154cb57e [codeview] Remove unused parameter.
Differential Revision: http://reviews.llvm.org/D21433

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 14:41:22 +00:00
Vasileios Kalintiris
c5b5eea1fd [mips] Fix small typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 14:25:13 +00:00
Rui Ueyama
a3568c118e Implement pdb::hashBufferV8 hash function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 13:48:16 +00:00
Igor Laevsky
5695246406 [JumpThreading] Prevent dangling pointer problems in BranchProbabilityInfo
We should update results of the BranchProbabilityInfo after removing block in JumpThreading. Otherwise 
we will get dangling pointer inside BranchProbabilityInfo cache.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 13:28:25 +00:00
Rui Ueyama
7d0c878650 Remove redundant namespace specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 13:17:59 +00:00
Rui Ueyama
1d884ca9ef [codeview] Use CVTypeVisitor instead of a hand-written switch-cases.
Differential Revision: http://reviews.llvm.org/D21418

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272888 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 13:14:42 +00:00
Patrik Hagglund
d116e8943c PR27938: Don't remove valid DebugLoc in Scalarizer
Added checks to make sure the Scalarizer::transferMetadata() don't
remove valid debug locations from instructions. This is important as
the verifier pass require that e.g. inlinable callsites have a valid
debug location.

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

Patch by Karl-Johan Karlsson

Reviewers: dblaikie

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 10:48:54 +00:00
Daniel Sanders
efa6f4843e [mips][mips16] Fix machine verifier errors about incorrect register classes on load/stores.
Summary:
[ls][bh] and [ls][bh]u cannot use sp-relative addresses and must therefore
lower frameindex nodes such that there is a copy to a CPU16Regs register. This
is now done consistently using a separate addressing mode that does not
permit frameindex nodes.

As part of this I've had to remove an optimization that reduced the number of
instructions needed to work around the lack of sp-relative addresses on [ls][bh]
and [ls][bh]u. This optimization used one of the eight CPU16Regs registers as
a copy of the stack pointer and it's implementation was the root cause of many
of the register vs register class mismatches.

lw/sw can use sp-relative addresses but we ought to ensure that we use the
correct version of lw/sw internally for things like IAS. This is not currently
the case and this change does not fix this. However, this change does clean it
up sufficiently well to fix the machine verifier failures.

Also removed irrelevant functions from stchar.ll.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 10:20:59 +00:00
Daniel Sanders
0b8fc77698 [llvm-objdump] Support detection of feature bits from the object and implement this for Mips.
Summary:
The Mips implementation only covers the feature bits described by the ELF
e_flags so far. Mips stores additional feature bits such as MSA in the
.MIPS.abiflags section.

Also fixed a small bug this revealed where microMIPS wouldn't add the
EF_MIPS_MICROMIPS flag when using -filetype=obj.

Reviewers: echristo, rafael

Subscribers: rafael, mehdi_amini, dsanders, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 09:17:03 +00:00
Adam Nemet
2e5ed34ad6 [LAA] Rename Strides to SymblicStrides in analyzeLoop. NFC
This is to facilitate to move of SymblicStrides from LV to LAA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 08:27:03 +00:00
Adam Nemet
08e6f75e04 [LAA] Default getInfo to not speculate symbolic strides. NFC
Soon we won't be passing Strides to getInfo and then we'll have fewer
call sites to update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 08:26:56 +00:00
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