Commit Graph

96489 Commits

Author SHA1 Message Date
Alina Sbirlea
1aa9c9ac56 Correct mprotect page boundries to round up end page. Fixes PR30905.
Summary:
Update the boundries for mprotect.
Patch by Andrew Adams. Fixes PR30905.

Reviewers: loladiro, andrew.w.kaylor, chandlerc

Subscribers: abadams, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286032 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 04:22:15 +00:00
Craig Topper
cf48862cf8 [X86] Remove broken support for autoupgrading llvm.x86.fma4.* intrinsics to llvm.x86.fma.*.
It currently fires an assert if you even try. Looking back, I don't think it ever worked because it only changed the name of the function object, but not the intrinsic ID stored in it. Given that, I think it can be removed since no one has noticed or complained in the past 4 years.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 04:00:31 +00:00
Krzysztof Parzyszek
eefaf3bd00 [Hexagon] Account for <def,read-undef> when validating moves for predication
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 20:41:03 +00:00
Weiming Zhao
7e3119cb1a Fix 24560: assembler does not share constant pool for same constants
Summary: This patch returns the same label if the CP entry with the same value has been created.

Reviewers: eli.friedman, rengolin, jmolloy

Subscribers: majnemer, jmolloy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 19:17:32 +00:00
Zvi Rackover
9933d268bb [X86] Broadcast from memory intructions aren't unfoldable
Broadcast from memory instructions should be treated as moves. They can't be unfolded.

Fixes pr30693.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285998 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 15:15:19 +00:00
Tom Stellard
ae152bde49 Revert "AMDGPU: Add VI i16 support"
This reverts commit r285939 and r285948.  These broke some conformance tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285995 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 13:06:34 +00:00
Jonas Paulsson
1228c39508 Comment rewording in MachineScheduler.cpp.
Author: A Trick

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285991 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 08:31:14 +00:00
Chandler Carruth
6c10c8c944 Only log the visit of a return instruction if we in fact found a return
instruction.

This avoids dereferencing null in the debug logging if the instruction
was not in fact a return instruction. This potential bug was found by
PVS-Studio.

This actually fixes the last of the "dereferenced a pointer before
checking it for null" reports in the recent PVS-Studio run. However,
there are quite a few reports of this nature that I did not do anything
to fix because they are pretty glaring false positives. They usually
took the form of quite clear correlated checks or a check made in
a separate function. I've even added asserts anywhere this correlation
wasn't pretty obvious and fundamental to the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 06:59:50 +00:00
Chandler Carruth
0e7e3d2f38 Hoist check for TLI above all of the attempts to use it (including one
of which that is hidden inside a separate function call) and helpfully
before building expensive transaction infrastructure. This will avoid
crashing when running CGP in a generic mode if we ever managed to hit
this case.

Note that I spent some time looking at alternatives. CGP is actually
used without a TM or TLI in order to do some target-independent testing.
Further, all of the neighboring optimization techniques actually have
some paths that are effective even in the absence of TLI so this seemed
the correct scope at which to check and bypass logic. It still isn't
clear that long-term support for missing TM/TLI is the right
cost/benefit tradeoff for CGP -- we seem to get relatively little for it
and the code is just littered with checks (and assumptions which
I suspect are still missing some checks).

This at least fixes the potential bug in this code spotted by
PVS-Studio, so we've got that going for us. ;]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 06:54:00 +00:00
Xinliang David Li
af0210fd51 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 03:00:52 +00:00
Justin Bogner
0425b29d7b X86: Move a non-null assert to before the pointer is dereferenced
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 23:55:36 +00:00
Chandler Carruth
c6a42bafd6 Sink all of the code relying on the MachO MachineModuleInfo to live
behind the test that the MachineModuleInfo analysis was
actually available and can be used.

While the MachO bits may well be reasonable to assume in the darwin
assembly printer, the analysis isn't constructively guaranteed anywhere
I could find so it seems safest to avoid crashing here.

This issue was found with PVS-Studio. Pretty sure the Clang Static
Anaylzer flags similar issues but we've probably never pointed it at
this code effectively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 23:33:46 +00:00
Weiming Zhao
298455f377 [Cortex-M0] Atomic lowering
Summary: ARMv6m supports dmb etc fench instructions but not ldrex/strex etc. So for some atomic load/store, LLVM should inline instructions instead of lowering to __sync_ calls.

Reviewers: rengolin, efriedma, t.p.northover, jmolloy

Subscribers: efriedma, aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285969 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 21:49:08 +00:00
Kevin Enderby
00b62fb861 Add support for the ARM_THREAD_STATE64 and
in llvm-objdump for Mach-O files add the printing of the
ARM_THREAD_STATE64 in the same format as
otool-classic(1) on darwin.

To do this the 64-bit ARM general tread state
needed to be defined in include/llvm/Support/MachO.h .

rdar://28985800


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 20:51:28 +00:00
Tony Jiang
e8078b26c1 NFC - Test commit.
Delete an empty line at the end of README.txt file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 20:32:21 +00:00
Adrian Prantl
60a7c431c0 Add DWARF debug info support for C++11 inline namespaces.
This implements the DWARF 5 DW_AT_export_symbols feature:
http://dwarfstd.org/ShowIssue.php?issue=141212.1

<rdar://problem/18616046>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 19:42:02 +00:00
Kostya Serebryany
2d1f4f5e9e [libFuzzer] fix -error_exitcode=N, now with a test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 19:31:18 +00:00
Justin Bogner
1787ec76dd PDB: Fix some APIs to avoid use-after-frees
The buffer is already owned by the PDBFile for all of these APIs, so
don't pass it in separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 18:28:04 +00:00
Tom Stellard
f83a9ec554 AMDGPU/SI: Re add VIInstructions.td to unbreak bots
This file is unused as of r285939, but we need to keep it around
for bots that don't do full rebuilds.   We should be able to delete this
again in a few days.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 17:56:46 +00:00
Chandler Carruth
604dd12e78 Remove a redundant condition found by PVS-Studio.
Filed http://llvm.org/PR30897 to teach Clang to warn on this kind of
stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 17:42:02 +00:00
Tom Stellard
7c173dd5fa AMDGPU: Add VI i16 support
Patch By: Wei Ding

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 17:13:50 +00:00
Chandler Carruth
cad7687580 Delete a dead store found by PVS-Studio.
Quite sad we still aren't really using aggressive dead code warnings
from Clang that we could potentially use to catch this and so many other
things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 17:01:38 +00:00
Chandler Carruth
b2400000cc Fix a bug found by inspection by PVS-Studio.
This condition is trivially always true prior to the change. The comment
at the call site makes it clear that we expect *all* of these to be '=',
'S', or 'I' so fix the code.

We have a bug I will update to track the fact that Clang doesn't warn on
this: http://llvm.org/PR13101

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 16:39:25 +00:00
Alexander Timofeev
d767830f39 [AMDGPU][CodeGen] To improve CGEMM performance: combine LDS reads.
hange explores the fact that LDS reads may be reordered even if access
the same location.

Prior the change, algorithm immediately stops as soon as any memory
access encountered between loads that are expected to be merged
together. Although, Read-After-Read conflict cannot affect execution
correctness.

Improves hcBLAS CGEMM manually loop-unrolled kernels performance by 44%.
Also improvement expected on any massive sequences of reads from LDS.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 14:37:13 +00:00
Zvi Rackover
d55aa1c80c Refactor creation of X86ISD::SETCC nodes to a helper function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 14:25:24 +00:00
Nicolai Haehnle
de5ede6734 DAGCombiner: fix use-after-free when merging consecutive stores
Summary:
Have MergeConsecutiveStores explicitly return information about the stores
that were merged, so that we can safely determine whether the starting
node has been freed.

Reviewers: chandlerc, bogner, niravd

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 14:25:04 +00:00
James Molloy
6300980dd1 Revert "[Thumb] Teach ISel how to lower compares of AND bitmasks efficiently"
This reverts commit r285893. It caused (probably) http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15-full-sh/builds/83 .

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 14:08:01 +00:00
James Molloy
e03e2fa99d [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently
This recommits r281323, which was backed out for two reasons. One, a selfhost failure, and two, it apparently caused Chromium failures. Actually, the latter was a red herring. The log has expired from the former, but I suspect that was a red herring too (actually caused by another problematic patch of mine). Therefore reapplying, and will watch the bots like a hawk.

For the common pattern (CMPZ (AND x, #bitmask), #0), we can do some more efficient instruction selection if the bitmask is one consecutive sequence of set bits (32 - clz(bm) - ctz(bm) == popcount(bm)).

1) If the bitmask touches the LSB, then we can remove all the upper bits and set the flags by doing one LSLS.
2) If the bitmask touches the MSB, then we can remove all the lower bits and set the flags with one LSRS.
3) If the bitmask has popcount == 1 (only one set bit), we can shift that bit into the sign bit with one LSLS and change the condition query from NE/EQ to MI/PL (we could also implement this by shifting into the carry bit and branching on BCC/BCS).
4) Otherwise, we can emit a sequence of LSLS+LSRS to remove the upper and lower zero bits of the mask.

1-3 require only one 16-bit instruction and can elide the CMP. 4 requires two 16-bit instructions but can elide the CMP and doesn't require materializing a complex immediate, so is also a win.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 10:18:20 +00:00
George Rimar
47d5d41c6b [Object/ELF] - Make getSymbol() return Error.
That is consistent with other methods around
and helps to handle error on a caller side.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 08:40:55 +00:00
Craig Topper
ba1655de51 [AVX-512] Use 'vnot' instead of 'not' in patterns involving vXi1 vectors.
This fixes selection of KANDN instructions and allows us to remove an extra set of patterns for KNOT and KXNOR.

Reviewers: delena, igorb

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 06:04:28 +00:00
Elena Demikhovsky
872445f31f Expandload and Compressstore intrinsics
2 new intrinsics covering AVX-512 compress/expand functionality.
This implementation includes syntax, DAG builder, operation lowering and tests.
Does not include: handling of illegal data types, codegen prepare pass and the cost model.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 03:23:55 +00:00
Teresa Johnson
6e15e36dae [ThinLTO] Handle distributed backend case when doing renaming
Summary:
The recent change I made to consult the summary when deciding whether to
rename (to handle inline asm) in r285513 broke the distributed build
case. In a distributed backend we will only have a portion of the
combined index, specifically for imported modules we only have the
summaries for any imported definitions. When renaming on import we were
asserting because no summary entry was found for a local reference being
linked in (def wasn't imported).

We only need to consult the summary for a renaming decision for the
exporting module. For imports, we would have prevented importing any
references to NoRename values already.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 01:07:16 +00:00
Greg Bedwell
2ad749ea5e Revert "[InstCombine] allow splat vector folds in adjustMinMax()"
This reverts commit r285732.

This change introduced a new assertion failure in the following
testcase at -O2:

typedef short __v8hi __attribute__((__vector_size__(16)));
__v8hi foo(__v8hi &V1, __v8hi &V2, unsigned mask) {
  __v8hi Result = V1;
  if (mask & 0x80)
    Result[0] = V2[0];
  return Result;
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 23:17:05 +00:00
Adrian McCarthy
39374062b1 Emit S_COMPILE3 record once per TU rather than once per function
This has some ripple effects in several tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 21:30:35 +00:00
Kevin Enderby
4b3270e0a7 Add the rest of the additional error checks for invalid Mach-O files when
the offsets and sizes of an element of the Mach-O file overlaps with
another element in the Mach-O file.

Some other tests for malformed Mach-O files now run into these
checks so their tests were also adjusted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 21:08:39 +00:00
Eli Friedman
a7bfb15b26 DCE math library calls with a constant operand.
On platforms which use -fmath-errno, math libcalls without any uses
require some extra checks to figure out if they are actually dead.

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

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 20:48:11 +00:00
Krzysztof Parzyszek
b051050ad1 [Hexagon] Remove registers coalesced in expand-condsets from live intervals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 17:59:54 +00:00
Davide Italiano
74a715d8bc [lli/COFF] Set the correct alignment for common symbols
Otherwise we set it always to zero, which is not correct,
and we assert inside alignTo (Assertion failed:
Align != 0u && "Align can't be 0.").

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 17:32:19 +00:00
Zachary Turner
d7730478c0 Add CodeViewRecordIO for reading and writing.
Using a pattern similar to that of YamlIO, this allows
us to have a single codepath for translating codeview
records to and from serialized byte streams.  The
current patch only hooks this up to the reading of
CodeView type records.  A subsequent patch will hook
it up for writing of CodeView type records, and then a
third patch will hook up the reading and writing of
CodeView symbols.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 17:05:19 +00:00
Nicolai Haehnle
08f7b24149 AMDGPU: Allow additional implicit operands on MOVRELS instructions
Summary:
The post-RA scheduler occasionally uses additional implicit operands when
the vector implicit operand as a whole is killed, but some subregisters
are still live because they are directly referenced later. Unfortunately,
this seems incredibly subtle to reproduce.

Fixes piglit spec/glsl-110/execution/variable-indexing/vs-temp-array-mat2-index-wr.shader_test
and others.

Reviewers: arsenm, tstellarAMD

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 17:03:11 +00:00
Malcolm Parsons
4c12732226 Fix Clang-tidy readability-redundant-string-cstr warnings
Reviewers: beanz, lattner, jlebar

Subscribers: jholewinski, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 16:43:50 +00:00
Nirav Dave
965be184c4 [ARM][MC] Cleanup ARM Target Assembly Parser
Summary:
Correctly parse end-of-statement tokens and handle preprocessor
end-of-line comments in ARM assembly processor.

Reviewers: rnk, majnemer

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 16:22:51 +00:00
Adrian Prantl
2ebe5ebbb9 Improve and cleanup comments in DwarfExpression.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 16:20:37 +00:00
Matt Arsenault
0a892bb4c2 BranchRelaxation: Fix computing indirect branch block size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 16:18:29 +00:00
Adrian Prantl
5561f87ef2 Simplify control flow in the the DWARF expression compiler
by refactoring common code into a DwarfExpressionCursor wrapper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 16:12:20 +00:00
Adrian Prantl
c49511f32a Emit DW_OP_piece also if the previous value was a constant.
This fixes a bug in the DWARF backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 16:12:16 +00:00
Simon Pilgrim
6960085571 Use !operator to test if APInt is zero/non-zero. NFCI.
Avoids APInt construction and slower comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 15:41:15 +00:00
Vasileios Kalintiris
6973999090 [mips] Always run the MipsOptimizePICCall pass.
Summary:
Remove this pass from addMachineSSAOptimization() and register it unconditionally in through addPreRegAlloc(). This pass is required for generating correct PIC calls.

Reviewers: sdardis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285814 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 15:11:27 +00:00
Joerg Sonnenberger
ab5ea555b2 Create the virtual register for the global base in the intersection of
GPRC and GPRC_NOR0 (or the 64bit equivalent) and not just the latter.
GPRC_NOR0 contains ZERO as alternative meaning of r0 and is therefore
not a true subclass of GPRC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 15:00:31 +00:00
Aaron Ballman
41b84edffa Removing a switch statement that contains a default label, but no case labels. Silences an MSVC warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 13:58:57 +00:00