Commit Graph

140664 Commits

Author SHA1 Message Date
Simon Pilgrim
cc24df9a7e [X86][SSE] Reuse zeroable element mask in lowerVectorShuffleAsBlend. NFCI
Don't regenerate a zeroable element mask with computeZeroableShuffleElements when its already available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286045 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 18:31:57 +00:00
Simon Pilgrim
30c59a5c8b [X86][SSE] Reuse zeroable element mask in lowerVectorShuffleAsZeroOrAnyExtend. NFCI
Don't regenerate a zeroable element mask with computeZeroableShuffleElements when its already available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286044 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 18:22:13 +00:00
Simon Pilgrim
6048d74bb0 [X86][SSE] Reuse zeroable element mask in SSE4A EXTRQ/INSERTQ vector shuffle lowering. NFCI
Don't regenerate a zeroable element mask with computeZeroableShuffleElements when its already available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 18:05:13 +00:00
Simon Pilgrim
85b073e71d [X86][SSE] Reuse zeroable element mask in PSHUFB vector shuffle lowering. NFCI
Don't regenerate a zeroable element mask with computeZeroableShuffleElements when its already available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 17:53:27 +00:00
Simon Pilgrim
4f6ce44253 [X86][SSE] Reuse zeroable element mask in lowerVectorShuffleAsInsertPS. NFCI
Don't regenerate a zeroable element mask with computeZeroableShuffleElements when its already available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286040 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 17:27:48 +00:00
Simon Pilgrim
a5d2239908 [X86][SSE] Reuse zeroable element mask in lowerVectorShuffleAsBitMask. NFCI
Don't regenerate a zeroable element mask with computeZeroableShuffleElements when its already available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286039 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 17:12:19 +00:00
Justin Lebar
de1867fd43 [LoopStrengthReduce] Don't use a DenseSet<int64_t> when we might add any valid int64_t to the set.
Summary:
SmallSetVector uses DenseSet, but that means we need to reserve some
values for the empty and tombstone keys.

It seems to me we should have a general way to let us store full-range
ints inside of DenseSets, and furthermore that we probably shouldn't
silently let you add ints into DenseSets without explicitly promising
that they're in range.  But that's a battle for another day; for now,
just fix this code, since we currently do something Very Bad when
compiling ffmpeg.

Fixes PR30914.

Reviewers: jeremyhu

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286038 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 16:47:25 +00:00
Simon Pilgrim
dc9cfd57e5 [X86][SSE] Reuse zeroable element mask instead of regenerating it. NFCI
We are repeatedly calling computeZeroableShuffleElements in many shuffle lowering calls for the same shuffle mask/inputs.

This is a first step towards reusing the zeroable result, initially just for lowerVectorShuffleAsShift calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 16:40:20 +00:00
Krzysztof Parzyszek
60b1e123ed [Hexagon] Split all selection patterns into a separate file
This is just the basic separation, without any cleanup. Further changes
will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 15:01:38 +00:00
Simon Pilgrim
d636a01807 Strip trailing whitespace. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 14:43:04 +00:00
Craig Topper
de7c14666a [AVX-512] Use an equality compare instead of StringRef::startswith in a few places in auto upgrade that were looking for the complete intrinsic name anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 05:35:23 +00:00
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
NAKAMURA Takumi
1ac38d3d10 Append a (uint32_t)pad into arm_thread_state64_t. Implicit pad isn't appended on i686.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286027 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 23:22:19 +00:00
Lang Hames
f27a2d85ce [ExecutionEngine] Document the insane ownership contract for
ExecutionEngine::removeModule.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 22:29:34 +00:00
Justin Bogner
3293f40456 cmake: When using LLVM_DISTRIBUTION_COMPONENTS, adjust LLVMExports accordingly
This Makes sure we only export targets that we're distributing, since
cmake will fail to import the file otherwise due to missing targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 21:55:23 +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
NAKAMURA Takumi
933679bb33 llvm/test/Transforms/DCE/calls-errno.ll: Suppress checking @pow(+0,-1).
It depends on host's pow(3), and mingw's pow doesn't raise any errors, just returns +INF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 18:50:45 +00:00
Ahmed Bougacha
bbf0c3a5ae [docs] Add initial Global ISel documentation.
This reflects the current state of Global ISel.  As progress is
made, we'll document our design decisions in it.
Comments very welcome!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 17:57:34 +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
Zvi Rackover
85309916d9 Add bugpoint-reduced reproducer for pr30693
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285997 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 14:53:22 +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
f85fa80630 Add a missing return to the move assignment operator for
SequenceNumberManager.

Sadly, we don't have any unittests for this class because it is
a private class. Since it seems to have a nice isolated and testable
interface, it'd be great to extract it to a detail namespace and write
unit tests for it as then we could catch issues. I'll probably pester
Lang about that or some alternative refactoring.

This was noticed by PVS-Studio.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 07:16:33 +00:00
Chandler Carruth
202a8de09e Remove dead code trying to handle when the amount of data read is
insufficient to populate the expected struct. Prior to this we already
bailed out of the routine when this situation comes up, so none of this
code had any effect.

If someone wants to bring it back to handle these cases, fixing the
earlier conditions and adding the necessary test cases that actually
exercises it, they can always revert this and go from there.

Both of these were noticed by PVS-Studio due to the identical (dead)
condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 07:10:24 +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
Brian Gesiak
ba7c327ede [lit] Remove TODO
Summary:
Instead of keeping track of TODOs for lit in a file checked into source
control, use LLVM's bug tracker. The TODOs have been migrated to the
following bugs:

* https://llvm.org/bugs/show_bug.cgi?id=30666
* https://llvm.org/bugs/show_bug.cgi?id=30667
* https://llvm.org/bugs/show_bug.cgi?id=30668
* https://llvm.org/bugs/show_bug.cgi?id=30669
* https://llvm.org/bugs/show_bug.cgi?id=30670
* https://llvm.org/bugs/show_bug.cgi?id=30671

Reviewers: ddunbar, beanz, echristo, delcypher

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 23:41:49 +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
Lang Hames
4373dd0316 [Support] Fix a segfault in llvm::Expected.
This fixes a mismatch between the declared error_type and the type used with
the placement new that initializes the field.

Patch by Yichao Yu.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 22:01:47 +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
Rafael Espindola
6a445561f9 Don't error in the ELFFile constructor.
All error checking now happens when the information is needed. The
only thing left is the minimum size of the buffer and that can be just
a precondition. I will add an ErrorOr create method in a followup
commit.

Also don't store a pointer to the Header, since it is just a trivial
cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 20:16:53 +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
Michael LeMay
cbbb2b1243 [ADT] IntervalMap: fix setStart and setStop
Summary:
These functions currently require that the new closed interval has a length of
at least 2.  They also currently permit empty half-open intervals.  This patch
defines nonEmpty in each traits structure and uses it to correct the
implementations of setStart and setStop.

Reviewers: stoklund, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 19:14:46 +00:00
Rafael Espindola
a625bffced Remove the last use of report_fatal_error from ELF.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 19:07:15 +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
Rafael Espindola
c771cb1243 Add error handling to getEntry.
Issue found by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 18:05:33 +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
Rafael Espindola
d77057e7c0 Replace another report_fatal_error with an ErrorOr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285944 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 17:37:28 +00:00
Rafael Espindola
7446318ad9 Replace a report_fatal_error with an ErrorOr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 17:28:33 +00:00
Rafael Espindola
074ecc25c3 Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 17:18:31 +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
9a2d9babdc Delete some dead code and add a missing "0x" prefix to a hex string in
llvm-readobj.

Another bug caught by PVS-Studio.

It'd be nice to actually have a test for this, but I found it by
inspection from PVS-Studio.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 17:11:11 +00:00