150108 Commits

Author SHA1 Message Date
NAKAMURA Takumi
51444fd7fe Update libdeps to add BinaryFormat, introduced in r304864.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 04:48:49 +00:00
NAKAMURA Takumi
cd0e332e88 Reorder and reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 04:48:45 +00:00
Zachary Turner
b070b915de Add dependency from LibDriver to BinaryFormat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 04:39:50 +00:00
Zachary Turner
ce49018b11 Add dependency from AsmParser to BinaryFormat.
This breaks the MinGW build, but not other builds for some reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304866 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 04:24:33 +00:00
Zachary Turner
25d9ac1002 Add #include <system_error>
Hopefully this unbreaks the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 03:55:31 +00:00
Zachary Turner
19ca2b0f9d Move Object format code to lib/BinaryFormat.
This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 03:48:56 +00:00
Craig Topper
d05a5f282d [LazyValueInfo] Remove redundant calls to ConstantRange::contains. The same exact call was made in the if above and we already know it returned true. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:58:09 +00:00
Craig Topper
a26780d808 [Constants] Use isUIntN/isIntN from MathExtras instead of reimplementing the same code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:58:05 +00:00
Craig Topper
c68553cb7f [Constants] Use APInt::isNullValue/isOneValue/uge to simplify some code and take advantage of APInt optimizations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:58:02 +00:00
Craig Topper
9082d12000 [APInt] Add a isOneValue method that can determine if a number is 1 by only using getActiveBits/countLeadingZeros
Previously you would have to use operator==(uint64_t) which does the getActiveBits call and a uint64_t comparison. But we can get all we need to know from the getActiveBits call.

This method will be used in another commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:57:57 +00:00
Tony Tye
04631fc848 Try to work around possible bugs in version of Shpinx on buildserver.
Builds sucessfully with Sphinx v1.5.5

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:46:08 +00:00
NAKAMURA Takumi
4e7fb91232 Introduce the new feature "abi-breaking-checks" to satisfy -reverse-iterate in llvm/test/Transforms/Util/PredicateInfo/
A few tests in llvm/test/Transforms/Util/PredicateInfo/ are using -reverse-iterate.
The option -reverse-iterate is enabled with +Asserts in usual cases, but it can be turned on/off regardless of LLVM_ENABLE_ASSERTIONS.

I wonder if this were incompatible to https://reviews.llvm.org/D33908 (r304757).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:22:52 +00:00
Quentin Colombet
e8e2b8ae7b [InlineSpiller] Only account for real spills in the hoisting logic
Spills of undef values shouldn't impact the placement of the relevant
spills. Drive by review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304850 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:22:07 +00:00
Sanjay Patel
756819c52a [CGP / PowerPC] use direct compares if there's only one load per block in memcmp() expansion
I'd like to enable CGP memcmp expansion for x86, but the output from CGP would regress the 
special cases (memcmp(x,y,N) != 0 for N=1,2,4,8,16,32 bytes) that we already handle.

I'm not sure if we'll actually be able to produce the optimal code given the block-at-a-time 
limitation in the DAG. We might have to just avoid those special-cases here in CGP. But 
regardless of that, I think this is a win for the more general cases.

http://rise4fun.com/Alive/cbQ

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:17:08 +00:00
Tony Tye
61c7e03d0a Add documentation for various aspects of the AMDGPU backend.
Remove extra tabs.
Builds sucessfully with Sphinx v1.5.5

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:08:35 +00:00
Zachary Turner
2f4ae78089 Fix uninitialized read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304846 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 23:54:23 +00:00
Davide Italiano
3dfb196736 [SCCIterator] Garbage collect dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 23:41:12 +00:00
Adrian Prantl
dab0766783 Introduce -brief command line option to llvm-dwarfdump
This patch introduces a new command line option, called brief, to
llvm-dwarfdump.  When -brief is used, the attribute forms for the
.debug_info section will not be emitted to output.

Patch by Spyridoula Gravani!

rdar://problem/21474365
Differential Revision: https://reviews.llvm.org/D33867

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 23:28:45 +00:00
Chandler Carruth
b428c9ffd2 Fix the includes in lib/Fuzzer on Windows that have ordering
dependencies and add comments to tell future maintainers about those
requirements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 23:28:01 +00:00
Davide Italiano
d1638eb7be [CFLAA] Remove unused include. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 23:16:19 +00:00
Eugene Zelenko
e74c436b70 [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 22:22:41 +00:00
Sanjay Patel
e11fbd18cc [PowerPC] auto-generate full checks and increase test coverage
3 of the tests were testing exactly the same thing: memcmp(x, y, 16) != 0.
I changed that to test 4, 7, and 16 bytes, so we can see how those differ.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 22:06:07 +00:00
Dimitry Andric
4a03a9f089 Allow VersionPrinter to print to arbitrary raw_ostreams
Summary:
I would like to add printing of registered targets to clang's version
information.  For this to work correctly, the VersionPrinter logic in
CommandLine.cpp should support printing to arbitrary raw_ostreams,
instead of always defaulting to outs().

Add a raw_ostream& parameter to the function pointer type used for
VersionPrinter, and while doing so, introduce a typedef for convenience.

Note that VersionPrinter::print() will still default to using outs(),
the clang part will necessarily go into a separate review.

Reviewers: beanz, chandlerc, dberris, mehdi_amini, zturner

Reviewed By: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304835 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 21:54:04 +00:00
Evgeny Stupachenko
fdb83c86c8 Added tests for X86InterleavedStore.
Reviewers: RKSimon, DavidKreitzer

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

Patch by: Aleen Farhana <Farhana.aleen@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 21:08:00 +00:00
David Blaikie
3aa7f80863 GlobalsModRef+OptNone: Don't prove readnone/other properties from an optnone function
Seems like at least one reasonable interpretation of optnone is that the
optimizer never "looks inside" a function. This fix is consistent with
that interpretation.

Specifically this came up in the situation:

f3 calls f2 calls f1
f2 is always_inline
f1 is optnone

The application of readnone to f1 (& thus to f2) caused the inliner to
kill the call to f2 as being trivially dead (without even checking the
cost function, as it happens - not sure if that's also a bug).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:51:15 +00:00
Tony Tye
698655354d Add documentation for various aspects of the AMDGPU backend.
Differential Revision: https://reviews.llvm.org/D33736


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:31:59 +00:00
Sanjay Patel
675f794383 [CGP] fix formatting/typos in MemCmpExpansion; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:30:47 +00:00
Alexey Bataev
32249656e2 [SLP] Change extension of the test, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:27:45 +00:00
Alexey Bataev
d330cb350f [SLP] Add a test for fix of PR32164, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:11:35 +00:00
Matthias Braun
f632627ec7 llc: Add ability to parse mir from stdin
- Add -x <language> option to switch between IR and MIR inputs.
- Change MIR parser to read from stdin when filename is '-'.
- Add a simple mir roundtrip test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304825 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:06:57 +00:00
Evgeny Stupachenko
cfed19098f Fix PR23384 (part 3 of 3)
Summary:
The patch makes instruction count the highest priority for
 LSR solution for X86 (previously registers had highest priority).

Reviewers: qcolombet

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:04:16 +00:00
Sanjay Patel
946c51ffec [DAG] remove duplicated code for isOnlyUsedInZeroEqualityComparison(); NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 19:40:09 +00:00
Anna Thomas
46747f1821 [LVI Printer] Rely on the LVI analysis functions rather than the LVI cache
Summary:
LVIPrinter pass was previously relying on the LVICache. We now directly call the
the LVI functions which solves the value if the LVI information is not already
available in the cache. This has 2 benefits over the printing of LVI cache:
1. higher coverage (i.e. catches errors) in LVI code when cache value is
invalidated.
2. relies on the core functions, and not dependent on the LVI cache (which may
be scrapped at some point).
It would still catch any cache invalidation errors, since we first go through
the cache.

Reviewers: reames, dberlin, sanjoy

Reviewed by: reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 19:25:31 +00:00
Sam Clegg
53a472fd29 [WebAssembly] MC: Refactor relocation handling
The change cleans up and unifies the handling of relocation
entries in WasmObjectWriter.  Type index relocation no longer
need to be handled separately.

The only externally visible change should be that type
index relocations are no longer grouped at the end.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 19:15:05 +00:00
Matthias Braun
ae5480dda7 MIRPrinter: Avoid assert() when printing empty INLINEASM strings.
CodeGen uses MO_ExternalSymbol to represent the inline assembly strings.
Empty strings for symbol names appear to be invalid. For now just
special case the output code to avoid hitting an `assert()` in
`printLLVMNameWithoutPrefix()`.

This fixes https://llvm.org/PR33317

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 19:00:58 +00:00
Matthias Braun
5c0660f016 UnitTests: Do not use assert() for error checking
Use `if (!X) report_fatal_error()` instead of `assert()` for the ad-hoc
error handling in two unittests. This reduces unnecessary differences
between release and debug builds (motivated by unused variable warnings
triggered in release builds).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304814 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 19:00:54 +00:00
Konstantin Zhuravlyov
2c18fa1f9c AMDGPU/NFC: Move amdgpu code object metadata to support
Differential Revision: https://reviews.llvm.org/D31437


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 18:35:50 +00:00
Anna Thomas
0a378270ee [LoopIdiom] Move X86 specific atomic memcpy test to the X86 directory
Patch https://reviews.llvm.org/rL304806 was causing failures in Aarch64
and multiple other targets since the test should be run on X86 only.

Specifying the target triple is not enough. Moving the testcase to the
X86 target directory in LoopIdiom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 17:46:41 +00:00
Daniel Berlin
2d73c379ee NewGVN: Fix PR/33187. This is a bug caused by two things:
1. When there is no perfect iteration order, we can't let phi nodes
put themselves in terms of things that come later in the iteration
order, or we will endlessly cycle (the normal RPO algorithm clears the
hashtable to avoid this issue).
2. We are sometimes erasing the wrong expression (causing pessimism)
because our equality says loads and stores are the same.
We introduce an exact equality function and use it when erasing to
make sure we erase only identical expressions, not equivalent ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304807 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 17:15:28 +00:00
Anna Thomas
bacc83353b [Atomics][LoopIdiom] Recognize unordered atomic memcpy
Summary:
Expanding the loop idiom test for memcpy to also recognize
unordered atomic memcpy. The only difference for recognizing
an unordered atomic memcpy and instead of a normal memcpy is
that the loads and/or stores involved are unordered atomic operations.

Background:  http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html

Patch by Daniel Neilson!

Reviewers: reames, anna, skatkov

Reviewed By: reames, anna

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304806 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 16:45:25 +00:00
Stanislav Mekhanoshin
8b43bddd6d [AMDGPU] Return correct value from SDWA pass
Differential Revision: https://reviews.llvm.org/D33927

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304805 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 16:42:30 +00:00
Sam Clegg
d6def3abef [WebAssembly] Remove unused methods from MCWasmObjectTargetWriter
These methods looks like they were originally came from
MCELFObjectTargetWriter but they are never called by the
WasmObjectWriter.

Remove these methods meant the declaration of WasmRelocationEntry
could also move into the cpp file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304804 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 16:38:59 +00:00
Petar Jovanovic
55caeda9d7 [mips] Add madd4 subtarget feature
Addition of a feature and a predicate used to control generation of madd.fmt
and similar instructions.

Patch by Stefan Maksimovic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304801 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 15:33:01 +00:00
Anna Thomas
958169b1f8 [IRCE] Canonicalize pre/post loops after the blocks are added into parent loop
Summary:
We were canonizalizing the pre loop (into loop-simplify form) before
the post loop blocks were added into parent loop. This is incorrect when IRCE is
done on a subloop. The post-loop blocks are created, but not yet added to the
parent loop. So, loop-simplification on the pre-loop incorrectly updates
LoopInfo.

This patch corrects the ordering so that pre and post loop blocks are added to
parent loop (if any), and then the loops are canonicalized to LCSSA and
LoopSimplifyForm.

Reviewers: reames, sanjoy, apilipenko

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304800 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 14:54:01 +00:00
Simon Pilgrim
2c222247e9 Fix spelling mistake in getRThroughput static function names. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 14:25:34 +00:00
Simon Pilgrim
19ff9cf62b [X86][AVX1] Split 256-bit vector non-temporal FastISel loads to keep it non-temporal (PR32744)
Extension to D33728

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 14:18:39 +00:00
Tom Stellard
5d24d88bc7 AMDGPU/GlobalISel: Mark 32-bit G_ICMP as legal
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 14:16:50 +00:00
Chandler Carruth
6721342b90 Fix another ordering constraint with windows.h and comment about
a revers constraint that we got right (by chance).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304792 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 12:43:20 +00:00
Chandler Carruth
dca225eaa7 Fix several more missing headers, all of these were hidden by "lucky"
include ordering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304790 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 12:31:55 +00:00
Chandler Carruth
4d354ac7b0 Add a missing #include to a header.
This was masked by lucky #include ordering in the .cpp files and
uncovered when we moved to the canonical ordering because the primary
header was included first (yay!). Unfortunately, I can't build this
locally so took a build-bot iteration to find it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 12:21:27 +00:00