OSDN Git Service

android-x86/external-llvm.git
6 years ago[ARM] GlobalISel: More tests. NFC.
Diana Picus [Fri, 1 Sep 2017 10:18:37 +0000 (10:18 +0000)]
[ARM] GlobalISel: More tests. NFC.

Test constants as well in the PIC tests. These are also represented as
G_GLOBAL_VALUE, and although they are treated just like other globals
for PIC, they won't be for ROPI, so it's good to have this coverage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312319 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDebug info for variables whose type is shrinked to bool
Strahinja Petrovic [Fri, 1 Sep 2017 10:05:27 +0000 (10:05 +0000)]
Debug info for variables whose type is shrinked to bool

This patch provides such debug information for integer
variables whose type is shrinked to bool by providing
dwarf expression which returns either constant initial
value or other value.

Patch by Nikola Prica.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312318 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[MergeICmps] MergeICmps is a new optimization pass that turns chains of integer"
Clement Courbet [Fri, 1 Sep 2017 09:43:08 +0000 (09:43 +0000)]
Revert "[MergeICmps] MergeICmps is a new optimization pass that turns chains of integer"

Break build

This reverts commit d07ab866f7f88f81e49046d691a80dcd32d7198b.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312317 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MergeICmps] MergeICmps is a new optimization pass that turns chains of integer
Clement Courbet [Fri, 1 Sep 2017 09:07:05 +0000 (09:07 +0000)]
[MergeICmps] MergeICmps is a new optimization pass that turns chains of integer
comparisons into memcmp.

Thanks to recent improvements in the LLVM codegen, the memcmp is typically
inlined as a chain of efficient hardware comparisons.
This typically benefits C++ member or nonmember operator==().

For now this is disabled by default until:
 - https://bugs.llvm.org/show_bug.cgi?id=33329 is complete
 - Benchmarks show that this is always useful.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312315 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AVX512] Suppress duplicate register only FMA patterns.
Craig Topper [Fri, 1 Sep 2017 07:58:16 +0000 (07:58 +0000)]
[AVX512] Suppress duplicate register only FMA patterns.

Previously we generated a register only pattern for each of the 3 instruction forms, but they are all identical as far as isel is concerned. So drop the others and just keep the 213 version.

This removes 2968 bytes from the isel table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312313 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove unused multiclass.
Craig Topper [Fri, 1 Sep 2017 07:58:15 +0000 (07:58 +0000)]
[X86] Remove unused multiclass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312312 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Simplify some multiclasses by inheriting from similar ones. NFC
Craig Topper [Fri, 1 Sep 2017 07:58:14 +0000 (07:58 +0000)]
[X86] Simplify some multiclasses by inheriting from similar ones. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312311 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add a couple TODOs to the PMADD52 instrucions about missing commuting opportuni...
Craig Topper [Fri, 1 Sep 2017 07:58:13 +0000 (07:58 +0000)]
[X86] Add a couple TODOs to the PMADD52 instrucions about missing commuting opportunities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312310 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add isel patterns for memory forms of FMA3 intrinsic instructions
Craig Topper [Fri, 1 Sep 2017 07:58:13 +0000 (07:58 +0000)]
[X86] Add isel patterns for memory forms of FMA3 intrinsic instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312309 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove unnecessary COPY_TO_REGCLASS(VR128) from the output patterns for FMA...
Craig Topper [Fri, 1 Sep 2017 07:58:11 +0000 (07:58 +0000)]
[X86] Remove unnecessary COPY_TO_REGCLASS(VR128) from the output patterns for FMA instrinsics.

The instructions are already defined as writing a VR128 register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312308 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix check-llvm on kernel 4.9+ with asan or msan
Vitaly Buka [Fri, 1 Sep 2017 01:47:34 +0000 (01:47 +0000)]
Fix check-llvm on kernel 4.9+ with asan or msan

Summary:
Before https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.9.46&id=84638335900f1995495838fe1bd4870c43ec1f67
test worked because memory allocated with mmap was not counted against RLIMIT_DATA.

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312303 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CMake] Add more runtime configurations.
Leo Li [Fri, 1 Sep 2017 01:05:59 +0000 (01:05 +0000)]
[CMake] Add more runtime configurations.

Summary:
- `project` is required when `runtime/CMakeList.txt` is the top-level `CMakeList.txt` file. This will establish version and policy settings.

- `-D_FILE_OFFSET_BITS=64` should never be set for Android runtimes.

Reviewers: srhines, pirama, beanz

Subscribers: llvm-commits, srhines, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312302 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Fold clamp modifier for packed instructions
Matt Arsenault [Thu, 31 Aug 2017 23:53:50 +0000 (23:53 +0000)]
AMDGPU: Fold clamp modifier for packed instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312297 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Fix getSymbolValue() for data symbols
Sam Clegg [Thu, 31 Aug 2017 23:22:44 +0000 (23:22 +0000)]
[WebAssembly] Fix getSymbolValue() for data symbols

This is mostly a fix for the output of `llvm-nm`

See Bug 34392: https://bugs.llvm.org//show_bug.cgi?id=34392

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312294 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IR] Missing changes for r312289 (NFC).
Eugene Zelenko [Thu, 31 Aug 2017 22:06:09 +0000 (22:06 +0000)]
[IR] Missing changes for r312289 (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312290 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Thu, 31 Aug 2017 21:56:16 +0000 (21:56 +0000)]
[Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes. Also affected in files (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312289 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[lit] Fix some issues with short paths in test discovery introduced in r312254
Reid Kleckner [Thu, 31 Aug 2017 21:56:14 +0000 (21:56 +0000)]
[lit] Fix some issues with short paths in test discovery introduced in r312254

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312288 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Refactor load ISel tablegen patterns into classes
Derek Schuff [Thu, 31 Aug 2017 21:51:48 +0000 (21:51 +0000)]
[WebAssembly] Refactor load ISel tablegen patterns into classes

Not all of these will be able to be used by atomics because tablegen, but it
still seems like a good change by itself.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312287 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Validate exports when parsing object files
Sam Clegg [Thu, 31 Aug 2017 21:43:45 +0000 (21:43 +0000)]
[WebAssembly] Validate exports when parsing object files

Subscribers: jfb, dschuff, jgravelle-google, aheejin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312286 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Don't pull carry through X86ISD::ADD carryin, -1 if we can't guranteed we're...
Craig Topper [Thu, 31 Aug 2017 21:39:23 +0000 (21:39 +0000)]
[X86] Don't pull carry through X86ISD::ADD carryin, -1 if we can't guranteed we're really using the carry flag from the add.

Prior to this patch we had a DAG combine that tried to bypass an X86ISD::ADD with -1 being added to the carry flag of some previous operation. We would then pass the carry flag directly to user.

But this is only safe if the user is looking for the carry flag and not the zero flag.

So we need to only do this combine in a context where we know what flag the consumer is using.

Fixes PR34381.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312285 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-nm] Fix output formatting of -f sysv for 64bit targets
Sam Clegg [Thu, 31 Aug 2017 21:23:44 +0000 (21:23 +0000)]
[llvm-nm] Fix output formatting of -f sysv for 64bit targets

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312284 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Turn int pack pattern into build_vector
Matt Arsenault [Thu, 31 Aug 2017 21:17:22 +0000 (21:17 +0000)]
AMDGPU: Turn int pack pattern into build_vector

build_vector is a more useful canonical form when
pattern matching packed operations, so turn shift
into high element into a build_vector.

Should show no change for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312282 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MachineOutliner] Recommit r312194, missed optimization remarks
Jessica Paquette [Thu, 31 Aug 2017 21:02:45 +0000 (21:02 +0000)]
[MachineOutliner] Recommit r312194, missed optimization remarks

Before, this commit caused a buildbot failure:

http://bb.pgr.jp/builders/test-llvm-i686-linux-RA/builds/6026/steps/test_llvm/logs/LLVM%20%3A%3A%20CodeGen__AArch64__machine-outliner-remarks.ll

This was caused by the Key value in DiagnosticInfoOptimizationBase being
deallocated before emitting the remarks defined in MachineOutliner.cpp. As of
r312277 this should no longer be an issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312280 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] add more tests for horizontal ops; NFC
Sanjay Patel [Thu, 31 Aug 2017 20:59:25 +0000 (20:59 +0000)]
[x86] add more tests for horizontal ops; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312279 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix some size_t / uint32_t mismatched comparisons.
Zachary Turner [Thu, 31 Aug 2017 20:50:25 +0000 (20:50 +0000)]
Fix some size_t / uint32_t mismatched comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312278 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Change Key in Argument to a std::string
Jessica Paquette [Thu, 31 Aug 2017 20:47:37 +0000 (20:47 +0000)]
[NFC] Change Key in Argument to a std::string

Before, Key was a StringRef to avoid unnecessary copies. This commit changes
that to a std::string.

This was okay previously because when people called emit for remarks before,
they would create the remark *within* the call to emit. However, if you build
the remark up and call emit *afterward*, it's possible to end up freeing the
memory assigned to the StringRef before the call to emit.

This caused a test failure with https://reviews.llvm.org/D37085 on Linux.
Since building remarks before a call to emit is a valid use-case, it makes
sense to replace this with a std::string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312277 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-pdbutil] Print detailed S_UDT stats.
Zachary Turner [Thu, 31 Aug 2017 20:43:22 +0000 (20:43 +0000)]
[llvm-pdbutil] Print detailed S_UDT stats.

This adds a new command line option, -udt-stats, which breaks
down the stats of S_UDT records.  These are one of the biggest
contributors to the size of /DEBUG:FASTLINK PDBs, so they need
some additional tools to be able to analyze their usage.  This
option will dig into each S_UDT record and determine what kind
of record it points to, and then break down the statistics by
the target type.  The goal here is to identify how our object
files differ from MSVC object files in S_UDT records, so that
we can output fewer of them and reach size parity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312276 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[dsymutil] Don't mark forward declarations as canonical.
Jonas Devlieghere [Thu, 31 Aug 2017 20:22:31 +0000 (20:22 +0000)]
[dsymutil] Don't mark forward declarations as canonical.

This patch completes the work done by Frederic Riss to addresses
dsymutil incorrectly considering forward declaration as canonical during
uniquing. This resulted in references to the forward declaration even
after the definition was encountered.

In addition to the test provided by Alexander Shaposhnikov in D29609, I
added another test to cover several scenarios that were mentioned in his
conversation with Fred. We now also check that uniquing still occurs
after the definition was encountered.

For more context please refer to D29609

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312274 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[dsymutil] Don't mark forward declarations as canonical."
Jonas Devlieghere [Thu, 31 Aug 2017 19:36:26 +0000 (19:36 +0000)]
Revert "[dsymutil] Don't mark forward declarations as canonical."

This reverts commit r312264.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312271 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ObjCARC] Pass the correct BasicBlock to fix assertion failure.
Akira Hatanaka [Thu, 31 Aug 2017 18:27:47 +0000 (18:27 +0000)]
[ObjCARC] Pass the correct BasicBlock to fix assertion failure.

The BasicBlock passed to FindPredecessorRetainWithSafePath should be the
parent block of Autorelease. This fixes a crash that occurs in
FindDependencies when StartInst is not in StartBB.

rdar://problem/33866381

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312266 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[dsymutil] Don't mark forward declarations as canonical.
Jonas Devlieghere [Thu, 31 Aug 2017 18:06:44 +0000 (18:06 +0000)]
[dsymutil] Don't mark forward declarations as canonical.

This patch completes the work done by Frederic Riss to addresses
dsymutil incorrectly considering forward declaration as canonical during
uniquing. This resulted in references to the forward declaration even
after the definition was encountered.

In addition to the test provided by Alexander Shaposhnikov in D29609, I
added another test to cover several scenarios that were mentioned in his
conversation with Fred. We now also check that uniquing still occurs
after the definition was encountered.

For more context please refer to D29609

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312264 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[lit] Make symlinks in test paths work a different way
Reid Kleckner [Thu, 31 Aug 2017 17:07:35 +0000 (17:07 +0000)]
[lit] Make symlinks in test paths work a different way

Use os.path.normpath instead of realpath to collapse '..' and '.' path
components. Use realpath when caching search results about a path for
good measure.

I considered rigging up a test involving symlinks for this, but I doubt
I can check a symlink into SVN. The test would have to conditionally
create a symlink at runtime if the host OS supports it. This sounds too
fragile and complicated to me to be worth it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312254 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombiner] Do a better job of ensuring we don't split elements when combining...
Craig Topper [Thu, 31 Aug 2017 17:02:22 +0000 (17:02 +0000)]
[DAGCombiner] Do a better job of ensuring we don't split elements when combining an extract_subvector of a bitcasted build_vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312253 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-dwarfdump] Brief mode only dumps debug_info by default
Jonas Devlieghere [Thu, 31 Aug 2017 16:44:47 +0000 (16:44 +0000)]
[llvm-dwarfdump] Brief mode only dumps debug_info by default

This patch changes the default behavior in brief mode to only show the
debug_info section. This is undoubtedly the most popular and likely the
one you'd want in brief mode.

Non-brief mode behavior is not affected and still defaults to all.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312252 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[lit] Don't call realpath on the path used for test suite search"
Reid Kleckner [Thu, 31 Aug 2017 16:42:30 +0000 (16:42 +0000)]
Revert "[lit] Don't call realpath on the path used for test suite search"

This reverts r312250, it breaks the lit test suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312251 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[lit] Don't call realpath on the path used for test suite search
Reid Kleckner [Thu, 31 Aug 2017 16:35:08 +0000 (16:35 +0000)]
[lit] Don't call realpath on the path used for test suite search

This preserves symlinks in paths, so that someone can symlink more tests
into a larger test suite. For example, debuginfo-tests is currently
designed to be checked out into clang/test. With this change, it can be
symlinked into place instead, which works better with the monorepo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312250 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] improve demanded vector elements analysis of insertelement
Sanjay Patel [Thu, 31 Aug 2017 15:57:17 +0000 (15:57 +0000)]
[InstCombine] improve demanded vector elements analysis of insertelement

Recurse instead of returning on the first found optimization. Also, return early in the caller
instead of continuing because that allows another round of simplification before we might
potentially lose undef information from a shuffle mask by eliminating the shuffle.

As noted in the review, we could probably do better and be more efficient by moving all of
demanded elements into a separate pass, but this is yet another quick fix to instcombine.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312248 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[codeview] Generalize DIExpression parsing to handle load chains
Reid Kleckner [Thu, 31 Aug 2017 15:56:49 +0000 (15:56 +0000)]
[codeview] Generalize DIExpression parsing to handle load chains

Summary:
Hopefully this also clarifies exactly when and why we're rewriting
certiain S_LOCALs using reference types: We're using the reference type
to stand in for a zero-offset load.

Reviewers: inglorion

Subscribers: llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312247 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r312240
Alex Lorenz [Thu, 31 Aug 2017 15:51:23 +0000 (15:51 +0000)]
Revert r312240

The buildbots have shown that -Wstrict-prototypes behaves differently in GCC
and Clang so we should keep it disabled until Clang follows GCC's behaviour

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312246 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate test:
Konstantin Zhuravlyov [Thu, 31 Aug 2017 15:35:33 +0000 (15:35 +0000)]
Update test:

  - REQUIRES: x86_64-linux -> REQUIRES: shell

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312245 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r311525: "[XRay][CodeGen] Use PIC-friendly code in XRay sleds; remove syntheti...
Daniel Jasper [Thu, 31 Aug 2017 15:17:17 +0000 (15:17 +0000)]
Revert r311525: "[XRay][CodeGen] Use PIC-friendly code in XRay sleds; remove synthetic references in .text"

Breaks builds internally. Will forward repo instructions to author.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312243 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SLPVectorizer] Move out Entry->NeedToGather check and assert of inner loop as invari...
Dinar Temirbulatov [Thu, 31 Aug 2017 14:10:07 +0000 (14:10 +0000)]
[SLPVectorizer] Move out Entry->NeedToGather check and assert of inner loop as invariant, NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312242 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Added run line to intrinsics upgrade test. NFC.
Yael Tsafrir [Thu, 31 Aug 2017 13:56:22 +0000 (13:56 +0000)]
[X86] Added run line to intrinsics upgrade test. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312241 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoBuild LLVM with -Wstrict-prototypes enabled
Alex Lorenz [Thu, 31 Aug 2017 13:23:24 +0000 (13:23 +0000)]
Build LLVM with -Wstrict-prototypes enabled

Clang 5 supports -Wstrict-prototypes. We should use it to catch any C
declarations that declare a non-prototype function.

rdar://33705313

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312240 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[BinaryFormat] Fix out of bounds read.
Benjamin Kramer [Thu, 31 Aug 2017 12:50:42 +0000 (12:50 +0000)]
[BinaryFormat] Fix out of bounds read.

Found by OSS-FUZZ!
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3220

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312238 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMD family 17h (znver1) scheduler model update.
Ashutosh Nema [Thu, 31 Aug 2017 12:38:35 +0000 (12:38 +0000)]
AMD family 17h (znver1) scheduler model update.

Summary:
This patch enables the following:
1) Regex based Instruction itineraries for integer instructions.
2) The instructions are grouped as per the nature of the instructions
   (move, arithmetic, logic, Misc, Control Transfer).
3) FP instructions and their itineraries are added which includes values
   for SSE4A, BMI, BMI2 and SHA instructions.

Patch by Ganesh Gopalasubramanian

Reviewers: RKSimon, craig.topper

Subscribers: vprasad, shivaram, ddibyend, andreadb, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312237 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Docs] Update CodingStandards to recommend range-based for loops
Alex Bradbury [Thu, 31 Aug 2017 12:34:20 +0000 (12:34 +0000)]
[Docs] Update CodingStandards to recommend range-based for loops

The CodingStandards section on avoiding the re-evaluation of end() hasn't been
updated since range-based for loops were adopted in the LLVM codebase. This
patch adds a very brief section that documents how range-based for loops
should be used wherever possible. It also moves example code in
CodingStandards to use range-based for loops and auto when appropriate.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312236 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Object] Verify object sizes before handing out StringRefs pointing out
Benjamin Kramer [Thu, 31 Aug 2017 12:27:10 +0000 (12:27 +0000)]
[Object] Verify object sizes before handing out StringRefs pointing out
of bounds.

This can only happen on corrupt input. Found by OSS-FUZZ!
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3228

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312235 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GlobalISel][X86] Refactor X86LegalizerInfo. NFC.
Igor Breger [Thu, 31 Aug 2017 11:40:03 +0000 (11:40 +0000)]
[GlobalISel][X86] Refactor X86LegalizerInfo. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312234 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] v8.3-a complex number support
Sam Parker [Thu, 31 Aug 2017 09:27:04 +0000 (09:27 +0000)]
[AArch64] v8.3-a complex number support

New instructions are added to AArch32 and AArch64 to aid
floating-point multiplication and addition of complex numbers,
where the complex numbers are packed in a vector register as a
pair of elements. The Imaginary part of the number is placed in the
more significant element, and the Real part of the number is placed
in the less significant element.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312228 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-cov] Read in function names for filtering from a text file.
Sean Eveson [Thu, 31 Aug 2017 09:11:31 +0000 (09:11 +0000)]
[llvm-cov] Read in function names for filtering from a text file.

Summary: Add a -name-whitelist option, which behaves in the same way as -name, but it reads in multiple function names from the given input file(s).

Reviewers: vsk

Reviewed By: vsk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312227 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Reverse PostRASched subtarget feature logic
Sam Parker [Thu, 31 Aug 2017 08:57:51 +0000 (08:57 +0000)]
[ARM] Reverse PostRASched subtarget feature logic

Replace the UsePostRAScheduler SubtargetFeature with
DisablePostRAScheduler, which is then used by Swift and Cyclone.
This patch maintains enabling PostRA scheduling for other Thumb2
capable cores and/or for functions which are being compiled in Arm
mode.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312226 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] IDSAR6 register assembler support
Sam Parker [Thu, 31 Aug 2017 08:36:45 +0000 (08:36 +0000)]
[AArch64] IDSAR6 register assembler support

The IDSAR6 system register has been introduced to identify the
v8.3-a Javascript data type conversion and v8.2-a dot product
support.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312225 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Support COFF linker directives
Martin Storsjo [Thu, 31 Aug 2017 08:28:48 +0000 (08:28 +0000)]
[AArch64] Support COFF linker directives

This is similar to what was done for ARM in SVN r269574; the code
and the test are straight copypaste to the corresponding AArch64
code and test directory.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312223 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IRCE] Identify loops with latch comparison against current IV value
Max Kazantsev [Thu, 31 Aug 2017 07:04:20 +0000 (07:04 +0000)]
[IRCE] Identify loops with latch comparison against current IV value

Current implementation of parseLoopStructure interprets the latch comparison as a
comarison against `iv.next`. If the actual comparison is made against the `iv` current value
then the loop may be rejected, because this misinterpretation leads to incorrect evaluation
of the latch start value.

This patch teaches the IRCE to distinguish this kind of loops and perform the optimization
for them. Now we use `IndVarBase` variable which can be either next or current value of the
induction variable (previously we used `IndVarNext` which was always the value on next iteration).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312221 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r312194: "[MachineOutliner] Add missed optimization remarks for the outliner."
Daniel Jasper [Thu, 31 Aug 2017 06:22:35 +0000 (06:22 +0000)]
Revert r312194: "[MachineOutliner] Add missed optimization remarks for the outliner."

Breaks on buildbot:
http://bb.pgr.jp/builders/test-llvm-i686-linux-RA/builds/6026/steps/test_llvm/logs/LLVM%20%3A%3A%20CodeGen__AArch64__machine-outliner-remarks.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312219 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IRCE][NFC] Rename IndVarNext to IndVarBase
Max Kazantsev [Thu, 31 Aug 2017 05:58:15 +0000 (05:58 +0000)]
[IRCE][NFC] Rename IndVarNext to IndVarBase

Renaming as a preparation step to generalizing IRCE for comparison not only against
the next value of an indvar, but also against the current.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312215 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTemporarily revert "Update branch coalescing to be a PowerPC specific pass"
Eric Christopher [Thu, 31 Aug 2017 05:56:16 +0000 (05:56 +0000)]
Temporarily revert "Update branch coalescing to be a PowerPC specific pass"
From comments and code review it wasn't intended to be enabled by default yet.

This reverts commit r311588.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312214 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Don't assert in TTI with fp32 denorms enabled
Matt Arsenault [Thu, 31 Aug 2017 05:47:00 +0000 (05:47 +0000)]
AMDGPU: Don't assert in TTI with fp32 denorms enabled

Also refine for f16 and rcp cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312213 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "llvm-mt: Fix release of OutputDoc"
Vitaly Buka [Thu, 31 Aug 2017 05:32:36 +0000 (05:32 +0000)]
Revert "llvm-mt: Fix release of OutputDoc"

Multiple bots are broken.

This reverts commit r312207.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312212 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agollvm-mt: Fix release of OutputDoc
Vitaly Buka [Thu, 31 Aug 2017 02:38:58 +0000 (02:38 +0000)]
llvm-mt: Fix release of OutputDoc

Summary:
xmlDoc needs to be released with xmlFreeDoc.
Reset root element before release to avoid release of CombinedRoot owned
by CombinedDoc,

Reviewers: ecbeckmann, rnk, zturner, ruiu

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312207 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Use set for tracked registers
Matt Arsenault [Thu, 31 Aug 2017 01:53:09 +0000 (01:53 +0000)]
AMDGPU: Use set for tracked registers

The majority of the time spent in the pass checking
for the register reads. Rather than searching all of
the defined registers for uses in each instruction,
use a set of defined registers and check the operands
of the instruction.

This process still is algorithmically not great,
but with the additional trick of skipping the analysis
for addresses with one use, this brings one slow
testcase into a reasonable range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312206 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Orc] Add a comment about member variable dependencies to OrcMCJITReplacement.
Lang Hames [Thu, 31 Aug 2017 01:09:56 +0000 (01:09 +0000)]
[Orc] Add a comment about member variable dependencies to OrcMCJITReplacement.

The comment explains the reason behind the change in member variable order in
r312086.

Thanks to Philip Reames for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312205 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[XRay][tools] Fix an accounting bug in llvm-xray account
Dean Michael Berris [Thu, 31 Aug 2017 01:07:24 +0000 (01:07 +0000)]
[XRay][tools] Fix an accounting bug in llvm-xray account

Summary:
Before this patch, llvm-xray account will assume that thread stacks will
not be empty. Unfortunately there are cases where an instrumented
function will see a call to `fork()` which will cause the child process
to not see the start of the function, but only see the end of the
function. The tooling cannot assume that threads will always have
perfect stacks, and so we change it to support this reality.

Reviewers: dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312204 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agocmake: Invent add_llvm_fuzzer to set up fuzzer targets
Justin Bogner [Thu, 31 Aug 2017 00:36:33 +0000 (00:36 +0000)]
cmake: Invent add_llvm_fuzzer to set up fuzzer targets

This moves the cmake configuration for fuzzers in LLVM to a new macro,
add_llvm_fuzzer. This will make it easier to keep things consistent
while implementing llvm.org/pr34314.

I've also made a couple of minor functional changes here:

- the fuzzers now use add_llvm_executable rather than add_llvm_tool.
  This means they won't create install targets and stuff like that,
  because those made little sense for these fuzzers.
- I've grouped these under "Fuzzers" rather than in with "Tools" for
  people who build with IDEs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312200 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "Revert r312139 "Verifier: Verify the correctness of fragment expressions...
Adrian Prantl [Thu, 31 Aug 2017 00:07:33 +0000 (00:07 +0000)]
Revert "Revert r312139 "Verifier: Verify the correctness of fragment expressions attached to globals.""

This reverts commit r312182 after fixing PR34390.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312197 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDon't add a fragment expression when GlobalSRA splits up a single-member struct
Adrian Prantl [Thu, 31 Aug 2017 00:06:18 +0000 (00:06 +0000)]
Don't add a fragment expression when GlobalSRA splits up a single-member struct

Fixes PR34390.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312196 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agollvm-isel-fuzzer: Stop including FuzzerInterface.h
Justin Bogner [Thu, 31 Aug 2017 00:01:28 +0000 (00:01 +0000)]
llvm-isel-fuzzer: Stop including FuzzerInterface.h

All this does is forward declare the interface functions (and make
sure that they're `extern "C"`), but since we're using libFuzzer from
the toolchain it doesn't make sense to include the local copy of the
interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312195 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MachineOutliner] Add missed optimization remarks for the outliner.
Jessica Paquette [Wed, 30 Aug 2017 23:31:49 +0000 (23:31 +0000)]
[MachineOutliner] Add missed optimization remarks for the outliner.

This adds missed optimization remarks which report viable candidates that
were not outlined because they would increase code size.

Other remarks will come in separate commits.

This will help to diagnose code size regressions and changes in outliner
behaviour in projects using the outliner.

https://reviews.llvm.org/D37085

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312194 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[yaml2obj][ELF] Make symbols optional for relocations
Petr Hosek [Wed, 30 Aug 2017 23:13:31 +0000 (23:13 +0000)]
[yaml2obj][ELF] Make symbols optional for relocations

Some kinds of relocations do not have symbols, like R_X86_64_RELATIVE
for instance. I would like to test this case in D36554 but currently
can't because symbols are required by yaml2obj. The other option is
using the empty symbol but that doesn't seem quite right to me.

This change makes the Symbol field of Relocation optional and in the
case where the user does not specify a symbol name the Symbol index is 0.

Patch by Jake Ehrlich

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312192 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove some code from fast isel that is no longer needed with i1 being an illeg...
Craig Topper [Wed, 30 Aug 2017 23:05:54 +0000 (23:05 +0000)]
[X86] Remove some code from fast isel that is no longer needed with i1 being an illegal type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312190 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
Matt Morehouse [Wed, 30 Aug 2017 22:49:31 +0000 (22:49 +0000)]
[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer

Summary:
- Don't sanitize __sancov_lowest_stack.
- Don't instrument leaf functions.
- Add CoverageStackDepth to Fuzzer and FuzzerNoLink.
- Only enable on Linux.

Reviewers: vitalybuka, kcc, george.karpenkov

Reviewed By: kcc

Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312185 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r312139 "Verifier: Verify the correctness of fragment expressions attached...
Hans Wennborg [Wed, 30 Aug 2017 22:41:27 +0000 (22:41 +0000)]
Revert r312139 "Verifier: Verify the correctness of fragment expressions attached to globals."

This caused PR34390.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312182 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Replace fixed-size SmallSet with a bitset.
Benjamin Kramer [Wed, 30 Aug 2017 22:28:30 +0000 (22:28 +0000)]
[ARM] Replace fixed-size SmallSet with a bitset.

It's smaller. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312180 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Correct operand types for v_mad_mix*
Matt Arsenault [Wed, 30 Aug 2017 22:18:40 +0000 (22:18 +0000)]
AMDGPU: Correct operand types for v_mad_mix*

These aren't really packed instructions, so the default
op_sel_hi should be 0 since this indicates a conversion.
The operand types are scalar values that behave similar
to an f16 scalar that may be converted to f32.

Doesn't change the default printing for op_sel_hi, just
the parsing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312179 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r312154 "Re-enable "[MachineCopyPropagation] Extend pass to do COPY source...
Hans Wennborg [Wed, 30 Aug 2017 22:11:37 +0000 (22:11 +0000)]
Revert r312154 "Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding""

It caused PR34387: Assertion failed: (RegNo < NumRegs && "Attempting to access record for invalid register number!")

> Issues identified by buildbots addressed since original review:
> - Fixed ARMLoadStoreOptimizer bug exposed by this change in r311907.
> - The pass no longer forwards COPYs to physical register uses, since
>   doing so can break code that implicitly relies on the physical
>   register number of the use.
> - The pass no longer forwards COPYs to undef uses, since doing so
>   can break the machine verifier by creating LiveRanges that don't
>   end on a use (since the undef operand is not considered a use).
>
>   [MachineCopyPropagation] Extend pass to do COPY source forwarding
>
>   This change extends MachineCopyPropagation to do COPY source forwarding.
>
>   This change also extends the MachineCopyPropagation pass to be able to
>   be run during register allocation, after physical registers have been
>   assigned, but before the virtual registers have been re-written, which
>   allows it to remove virtual register COPY LiveIntervals that become dead
>   through the forwarding of all of their uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312178 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSimplify writeArchive return type.
Rui Ueyama [Wed, 30 Aug 2017 22:11:03 +0000 (22:11 +0000)]
Simplify writeArchive return type.

writeArchive returned a pair, but the first element of the pair is always
its first argument on failure, so it doesn't make sense to return it from
the function. This patch change the return type so that it does't return it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312177 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix test after rL312144
Konstantin Zhuravlyov [Wed, 30 Aug 2017 21:59:14 +0000 (21:59 +0000)]
Fix test after rL312144

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312176 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add more vector demand examples; NFC
Sanjay Patel [Wed, 30 Aug 2017 21:11:46 +0000 (21:11 +0000)]
[InstCombine] add more vector demand examples; NFC

See D37236 for discussion. It seems unlikely that we actually want/need
to do this kind of folding in InstCombine in the long run, but moving
everything will be a bigger follow-up step.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312172 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSelectionDAG: Emit correct debug info for multi-register function arguments.
Adrian Prantl [Wed, 30 Aug 2017 20:51:20 +0000 (20:51 +0000)]
SelectionDAG: Emit correct debug info for multi-register function arguments.

Previously we would just describe the first register and then call it
quits. This patch emits fragment expressions for each register.

<rdar://problem/34075307>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312169 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IR] Don't print "!DIExpression() = !DIExpression()" when dumping
Reid Kleckner [Wed, 30 Aug 2017 20:40:36 +0000 (20:40 +0000)]
[IR] Don't print "!DIExpression() = !DIExpression()" when dumping

Now that we print DIExpressions inline everywhere, we don't need to
print them once as an operand and again as a value. This is only really
visible when calling dump() or print() directly on a DIExpression during
debugging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312168 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRefactor DIBuilder::createFragmentExpression into a static DIExpression member
Adrian Prantl [Wed, 30 Aug 2017 20:04:17 +0000 (20:04 +0000)]
Refactor DIBuilder::createFragmentExpression into a static DIExpression member

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312165 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Use Swift error registers on non-Darwin targets
Brian Gesiak [Wed, 30 Aug 2017 20:03:54 +0000 (20:03 +0000)]
[ARM] Use Swift error registers on non-Darwin targets

Summary:
Remove a check for `ARMSubtarget::isTargetDarwin` when determining
whether to use Swift error registers, so that Swift errors work
properly on non-Darwin ARM32 targets (specifically Android).

Before this patch, generated code would save and restores ARM register r8 at
the entry and returns of a function that throws. As r8 is used as a virtual
return value for the object being thrown, this gets overwritten by the restore,
and calling code is unable to catch the error. In turn this caused Swift code
that used `do`/`try`/`catch` to work improperly on Android ARM32 targets.

Addresses Swift bug report https://bugs.swift.org/browse/SR-5438.

Patch by John Holdsworth.

Reviewers: manmanren, rjmccall, aschwaighofer

Reviewed By: aschwaighofer

Subscribers: srhines, aschwaighofer, aemerson, javed.absar, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312164 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Update debug info test after r312144
Derek Schuff [Wed, 30 Aug 2017 19:54:08 +0000 (19:54 +0000)]
[WebAssembly] Update debug info test after r312144

Add the expr field to the DIGlobalVariableExpression

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312163 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoNewGVN: Make sure we add the correct user if we swapped the comparison operands
Daniel Berlin [Wed, 30 Aug 2017 19:53:23 +0000 (19:53 +0000)]
NewGVN: Make sure we add the correct user if we swapped the comparison operands

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312162 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoNewGVN: Allow simplification into variables
Daniel Berlin [Wed, 30 Aug 2017 19:52:39 +0000 (19:52 +0000)]
NewGVN: Allow simplification into variables

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312161 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GISel]: Add a clean up combiner during legalization.
Aditya Nandakumar [Wed, 30 Aug 2017 19:32:59 +0000 (19:32 +0000)]
[GISel]: Add a clean up combiner during legalization.

Added a combiner which can clean up truncs/extends that are created in
order to make the types work during legalization.

Also moved the combineMerges to the LegalizeCombiner.

https://reviews.llvm.org/D36880

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312158 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GVNSink] Remove dependency on SmallPtrSet iteration order.
Benjamin Kramer [Wed, 30 Aug 2017 18:46:37 +0000 (18:46 +0000)]
[GVNSink] Remove dependency on SmallPtrSet iteration order.

Found by LLVM_ENABLE_REVERSE_ITERATION.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312156 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
Geoff Berry [Wed, 30 Aug 2017 18:41:07 +0000 (18:41 +0000)]
Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"

Issues identified by buildbots addressed since original review:
- Fixed ARMLoadStoreOptimizer bug exposed by this change in r311907.
- The pass no longer forwards COPYs to physical register uses, since
  doing so can break code that implicitly relies on the physical
  register number of the use.
- The pass no longer forwards COPYs to undef uses, since doing so
  can break the machine verifier by creating LiveRanges that don't
  end on a use (since the undef operand is not considered a use).

  [MachineCopyPropagation] Extend pass to do COPY source forwarding

  This change extends MachineCopyPropagation to do COPY source forwarding.

  This change also extends the MachineCopyPropagation pass to be able to
  be run during register allocation, after physical registers have been
  assigned, but before the virtual registers have been re-written, which
  allows it to remove virtual register COPY LiveIntervals that become dead
  through the forwarding of all of their uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312154 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove unneed AVX512 check from fast isel.
Craig Topper [Wed, 30 Aug 2017 18:08:58 +0000 (18:08 +0000)]
[X86] Remove unneed AVX512 check from fast isel.

This is no longer necessary now that i1 is illegal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312146 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Add target feature for atomics
Derek Schuff [Wed, 30 Aug 2017 18:07:45 +0000 (18:07 +0000)]
[WebAssembly] Add target feature for atomics

Summary:
This tracks the WebAssembly threads feature proposal at
https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312145 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCanonicalize the representation of empty an expression in DIGlobalVariableExpression
Adrian Prantl [Wed, 30 Aug 2017 18:06:51 +0000 (18:06 +0000)]
Canonicalize the representation of empty an expression in DIGlobalVariableExpression

This change simplifies code that has to deal with
DIGlobalVariableExpression and mirrors how we treat DIExpressions in
debug info intrinsics. Before this change there were two ways of
representing empty expressions on globals, a nullptr and an empty
!DIExpression().

If someone needs to upgrade out-of-tree testcases:
  perl -pi -e 's/(!DIGlobalVariableExpression\(var: ![0-9]*)\)/\1, expr: !DIExpression())/g' <MYTEST.ll>
will catch 95%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312144 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[codeview] make DbgVariableLocation::extractFromMachineInstruction use Optional
Bob Haarman [Wed, 30 Aug 2017 17:50:21 +0000 (17:50 +0000)]
[codeview] make DbgVariableLocation::extractFromMachineInstruction use Optional

Summary:
DbgVariableLocation::extractFromMachineInstruction originally
returned a boolean indicating success. This change makes it return
an Optional<DbgVariableLocation> so we cannot try to access the fields
of the struct if they aren't valid.

Reviewers: aprantl, rnk, zturner

Subscribers: llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312143 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agodocs: remove dead doxygen tarball link
Hans Wennborg [Wed, 30 Aug 2017 17:40:28 +0000 (17:40 +0000)]
docs: remove dead doxygen tarball link

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312142 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoVerifier: Verify the correctness of fragment expressions attached to globals.
Adrian Prantl [Wed, 30 Aug 2017 16:49:21 +0000 (16:49 +0000)]
Verifier: Verify the correctness of fragment expressions attached to globals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312139 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AVX512] Don't use 32-bit elements version of AND/OR/XOR/ANDN during isel unless...
Craig Topper [Wed, 30 Aug 2017 16:38:33 +0000 (16:38 +0000)]
[AVX512] Don't use 32-bit elements version of AND/OR/XOR/ANDN during isel unless we're matching a masked op or broadcast

Selecting 32-bit element logical ops without a select or broadcast requires matching a bitconvert on the inputs to the and. But that's a weird thing to rely on. It's entirely possible that one of the inputs doesn't have a bitcast and one does.

Since there's no functional difference, just remove the extra patterns and save some isel table size.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312138 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove GCCBuiltin for some intrinsics that aren't used by clang. Add TODO to...
Craig Topper [Wed, 30 Aug 2017 16:28:09 +0000 (16:28 +0000)]
[X86] Remove GCCBuiltin for some intrinsics that aren't used by clang. Add TODO to remove them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312136 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GlobalISel][X86] Support variadic function call.
Igor Breger [Wed, 30 Aug 2017 15:10:15 +0000 (15:10 +0000)]
[GlobalISel][X86] Support variadic function call.

Summary: Support variadic function call. Port the implementation from X86FastISel.

Reviewers: zvi, guyblank, oren_ben_simhon

Reviewed By: guyblank

Subscribers: rovka, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312130 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-land MachineInstr: Reason locally about some memory objects before going to AA.
Balaram Makam [Wed, 30 Aug 2017 14:57:12 +0000 (14:57 +0000)]
Re-land MachineInstr: Reason locally about some memory objects before going to AA.

Summary:
Reverts r311008 to reinstate r310825 with a fix.

Refine alias checking for pseudo vs value to be conservative.
This fixes the original failure in builtbot unittest SingleSource/UnitTests/2003-07-09-SignedArgs.

Reviewers: hfinkel, nemanjai, efriedma

Reviewed By: efriedma

Subscribers: bjope, mcrosier, nhaehnle, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312126 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] remove unnecessary vector select fold; NFCI
Sanjay Patel [Wed, 30 Aug 2017 14:04:57 +0000 (14:04 +0000)]
[InstCombine] remove unnecessary vector select fold; NFCI

This code is double-dead:
1. We simplify all selects with constant true/false condition in InstSimplify.
   I've minimized/moved the tests to show that works as expected.
2. All remaining vector selects with a constant condition are canonicalized to
   shufflevector, so we really can't see this pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312123 91177308-0d34-0410-b5e6-96231b3b80d8