OSDN Git Service

android-x86/external-llvm.git
6 years ago[AArch64] optimise v4f16 fcmps to utilise vector instructions
Carey Williams [Mon, 22 Jan 2018 14:16:11 +0000 (14:16 +0000)]
[AArch64] optimise v4f16 fcmps to utilise vector instructions

Improves the code generation for v4f16 FCMP instructions when FullFP16 is not supported.
Generating FCTVL(s) rather than a longer series of FCVTs.

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

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

6 years ago[ThinLTO] Re-commit of dot dumper after test fix
Eugene Leviant [Mon, 22 Jan 2018 13:35:40 +0000 (13:35 +0000)]
[ThinLTO] Re-commit of dot dumper after test fix

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

6 years agoFixing warnings caused by commit 323095
Marina Yatsina [Mon, 22 Jan 2018 13:24:10 +0000 (13:24 +0000)]
Fixing warnings caused by commit 323095

Change-Id: I4e1f81db2f5382a820f4016c23b243e4d5aebf51

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

6 years agoRename DwarfAcceleratorTable to AppleAcceleratorTable. NFC
Pavel Labath [Mon, 22 Jan 2018 13:17:23 +0000 (13:17 +0000)]
Rename DwarfAcceleratorTable to AppleAcceleratorTable. NFC

This frees up the first name to be used as an base class for the
apple table and the dwarf5 .debug_names accel table. The rename  was
split off from D42297 (adding of debug_names support), which is still
under review.

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

6 years ago[X86][AVX] Add test case for PR34370
Simon Pilgrim [Mon, 22 Jan 2018 12:27:22 +0000 (12:27 +0000)]
[X86][AVX] Add test case for PR34370

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

6 years ago[X86][SSE] Add ISD::VECTOR_SHUFFLE to faux shuffle decoding (Reapplied)
Simon Pilgrim [Mon, 22 Jan 2018 12:05:17 +0000 (12:05 +0000)]
[X86][SSE] Add ISD::VECTOR_SHUFFLE to faux shuffle decoding (Reapplied)

Primarily, this allows us to use the aggressive extraction mechanisms in combineExtractWithShuffle earlier and make use of UNDEF elements that may be lost during lowering.

Reapplied after rL322279 was reverted at rL322335 due to PR35918, underlying issue was fixed at rL322644.

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

6 years ago[AArch64][SVE] Asm: Predicate patterns
Sander de Smalen [Mon, 22 Jan 2018 10:46:00 +0000 (10:46 +0000)]
[AArch64][SVE] Asm: Predicate patterns

Summary:
This patch adds support for parsing/printing of named or unnamed
patterns that are used in SVE's PTRUE instruction, amongst others.

The pattern can be specified as a named pattern to initialize the predicate
vector or it can be specified as an immediate in the range 0-31.

Reviewers: fhahn, rengolin, evandro, mcrosier, t.p.northover

Reviewed By: fhahn

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

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

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

6 years ago[YAML] Plain scalars can not begin with most indicators.
Haojian Wu [Mon, 22 Jan 2018 10:20:48 +0000 (10:20 +0000)]
[YAML] Plain scalars can not begin with most indicators.

Summary:
Discovered when clangd loads YAML symbols, some symbol documentations
start with indicators (e.g. "-"), but YAML prints them as plain scalars
(no quotes), which make the YAML parser fail to parse.

For these kind of strings, we need quotes.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, ioeric, llvm-commits, cfe-commits

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

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

6 years agoBreak false dependencies for POPCNT, LZCNT, TZCNT
Marina Yatsina [Mon, 22 Jan 2018 10:07:01 +0000 (10:07 +0000)]
Break false dependencies for POPCNT, LZCNT, TZCNT

Add POPCNT, LZCNT, TZCNT to the list of instructions that have false dependency.
Add a test to make sure BreakFalseDeps breaks the dependencies for these instructions.
Update affected tests.

This fixes bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869

This is the final of multiple patches that fix this bugzilla.
Most of the patches are intended at refactoring the existent code.

Reviews of the refactoring done to enable this change:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40331
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333

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

Change-Id: If95cbf1a3f5c7dccff8f1b22ecb397542147303d

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

6 years agoSeparate LoopTraversal, ReachingDefAnalysis and BreakFalseDeps into their own files.
Marina Yatsina [Mon, 22 Jan 2018 10:06:50 +0000 (10:06 +0000)]
Separate LoopTraversal, ReachingDefAnalysis and BreakFalseDeps into their own files.

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40331
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40334

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

Change-Id: Ie5f8eb34d98cfdfae23a3072eb69b5794f0e2d56

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

6 years agoRename ExecutionDepsFix files to ExecutionDomainFix
Marina Yatsina [Mon, 22 Jan 2018 10:06:33 +0000 (10:06 +0000)]
Rename ExecutionDepsFix files to ExecutionDomainFix

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40331
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I6a048cca7fdafbfc42fb1bac94343e483befded8

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

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:06:18 +0000 (10:06 +0000)]
ExecutionDepsFix refactoring:
- clang-format

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I131b126af13bc743bc5d69d83699e52b9b720979

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

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:06:10 +0000 (10:06 +0000)]
ExecutionDepsFix refactoring:
- Moving comments to class definition in header file
- Changing comments to doxygen style
- Rephrase loop traversal explaining comment

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I9a12618db5b66128611fa71b54a233414f6012ac

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

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:06:01 +0000 (10:06 +0000)]
ExecutionDepsFix refactoring:
- Removing LiveRegs

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I8ab56d99951a6d6981542f68d94c1f624f3c9fbf

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

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:05:53 +0000 (10:05 +0000)]
ExecutionDepsFix refactoring:
- Changing LiveRegs to be a vector

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I9cdd364bd7bf2a0bf61ea41a48d4bd310ec3bce4

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

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:05:45 +0000 (10:05 +0000)]
ExecutionDepsFix refactoring:
- Changing DenseMap<MBB*, LiveReg*> to SmallVector<LiveReg*>
- Now the MBB number will be the index of LiveReg in the vector.
- Adding asserts

This patch is NFC.

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: If4a3f141693d0361ddb292432337dbb63a1e69ee

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

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:05:37 +0000 (10:05 +0000)]
ExecutionDepsFix refactoring:
- Remove unneeded includes and unneeded members
- Use range iterators
- Variable renaming, typedefs, extracting constants
- Removing {} from one line ifs

This patch is NFC.

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: Ib59060ab3fa5bee3bf2ca2045c24e572635ee7f6

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

6 years agoSeparate ExecutionDepsFix into 4 parts:
Marina Yatsina [Mon, 22 Jan 2018 10:05:23 +0000 (10:05 +0000)]
Separate ExecutionDepsFix into 4 parts:
1. ReachingDefsAnalysis - Allows to identify for each instruction what is the “closest” reaching def of a certain register. Used by BreakFalseDeps (for clearance calculation) and ExecutionDomainFix (for arbitrating conflicting domains).
2. ExecutionDomainFix - Changes the variant of the instructions in order to minimize domain crossings.
3. BreakFalseDeps - Breaks false dependencies.
4. LoopTraversal - Creatws a traversal order of the basic blocks that is optimal for loops (introduced in revision L293571). Both ExecutionDomainFix and ReachingDefsAnalysis use this to determine the order they will traverse the basic blocks.

This also included the following changes to ExcecutionDepsFix original logic:
1. BreakFalseDeps and ReachingDefsAnalysis logic no longer restricted by a register class.
2. ReachingDefsAnalysis tracks liveness of reg units instead of reg indices into a given reg class.

Additional changes in affected files:
1. X86 and ARM targets now inherit from ExecutionDomainFix instead of ExecutionDepsFix. BreakFalseDeps also was added to the passes they activate.
2. Comments and references to ExecutionDepsFix replaced with ExecutionDomainFix and BreakFalseDeps, as appropriate.

Additional refactoring changes will follow.

This commit is (almost) NFC.
The only functional change is that now BreakFalseDeps will break dependency for all register classes.
Since no additional instructions were added to the list of instructions that have false dependencies, there is no actual change yet.
In a future commit several instructions (and tests) will be added.

This is the first of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40331
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: Icaeb75e014eff96a8f721377783f9a3e6c679275

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

6 years ago[BinaryFormat] Add .debug_names support
Pavel Labath [Mon, 22 Jan 2018 09:41:36 +0000 (09:41 +0000)]
[BinaryFormat] Add .debug_names support

Summary:
This adds a definition of the .debug_names section and the new constants
(DW_IDX_???) which are used in it.

Reviewers: JDevlieghere, aprantl

Subscribers: llvm-commits

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

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

6 years agoRevert [SCEV] Fix isLoopEntryGuardedByCond usage
Serguei Katkov [Mon, 22 Jan 2018 07:47:02 +0000 (07:47 +0000)]
Revert [SCEV] Fix isLoopEntryGuardedByCond usage

It causes buildbot failures. New added assert is fired.
It seems not all usages of isLoopEntryGuardedByCond are fixed.

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

6 years ago[SCEV] Fix isLoopEntryGuardedByCond usage
Serguei Katkov [Mon, 22 Jan 2018 07:31:41 +0000 (07:31 +0000)]
[SCEV] Fix isLoopEntryGuardedByCond usage

ScalarEvolution::isKnownPredicate invokes isLoopEntryGuardedByCond without check
that SCEV is available at entry point of the loop. It is incorrect and fixed by patch.

Reviewers: sanjoy, mkazantsev, anna, dorit
Reviewed By: mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42165

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

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Mon, 22 Jan 2018 05:54:46 +0000 (05:54 +0000)]
[NFC] fix trivial typos in comments

"the the" -> "the"

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

6 years ago[ORC] Add orc::SymbolResolver, a Orc/Legacy API interop header, and an
Lang Hames [Mon, 22 Jan 2018 03:00:31 +0000 (03:00 +0000)]
[ORC] Add orc::SymbolResolver, a Orc/Legacy API interop header, and an
orc::SymbolResolver to JITSymbolResolver adapter.

The new orc::SymbolResolver interface uses asynchronous queries for better
performance. (Asynchronous queries with bulk lookup minimize RPC/IPC overhead,
support parallel incoming queries, and expose more available work for
distribution). Existing ORC layers will soon be updated to use the
orc::SymbolResolver API rather than the legacy llvm::JITSymbolResolver API.

Because RuntimeDyld still uses JITSymbolResolver, this patch also includes an
adapter that wraps an orc::SymbolResolver with a JITSymbolResolver API.

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

6 years ago[InstCombine] (X << Y) / X -> 1 << Y
Sanjay Patel [Sun, 21 Jan 2018 16:14:51 +0000 (16:14 +0000)]
[InstCombine] (X << Y) / X -> 1 << Y

...when the shift is known to not overflow with the matching
signed-ness of the division.

This closes an optimization gap caused by canonicalizing mul
by power-of-2 to shl as shown in PR35709:
https://bugs.llvm.org/show_bug.cgi?id=35709

Patch by Anton Bikineev!

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

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

6 years ago[InstSimplify] add baseline tests for (X << Y) % X -> 0; NFC
Sanjay Patel [Sun, 21 Jan 2018 15:36:15 +0000 (15:36 +0000)]
[InstSimplify] add baseline tests for (X << Y) % X -> 0; NFC

This is the 'rem' counterpart to D42032 and would be folded by
D42341.

Patch by Anton Bikineev.

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

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

6 years agoTemporarily revert r323062 to investigate buildbot failures
Eugene Leviant [Sun, 21 Jan 2018 10:22:19 +0000 (10:22 +0000)]
Temporarily revert r323062 to investigate buildbot failures

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

6 years agoAn attempt to fix buildbot after rL323062
Eugene Leviant [Sun, 21 Jan 2018 08:49:07 +0000 (08:49 +0000)]
An attempt to fix buildbot after rL323062

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

6 years ago[ThinLTO] Implement summary visualizer
Eugene Leviant [Sun, 21 Jan 2018 07:27:32 +0000 (07:27 +0000)]
[ThinLTO] Implement summary visualizer

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

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

6 years ago[ORC] Add a lookupFlags method to VSO.
Lang Hames [Sun, 21 Jan 2018 03:20:39 +0000 (03:20 +0000)]
[ORC] Add a lookupFlags method to VSO.

lookupFlags returns a SymbolFlagsMap for the requested symbols, along with a
set containing the SymbolStringPtr for any symbol not found in the VSO.

The JITSymbolFlags for each symbol will have been stripped of its transient
JIT-state flags (i.e. NotMaterialized, Materializing).

Calling lookupFlags does not trigger symbol materialization.

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

6 years ago[ORC] More cleanup. NFC.
Lang Hames [Sun, 21 Jan 2018 03:20:36 +0000 (03:20 +0000)]
[ORC] More cleanup. NFC.

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

6 years ago[Dominators] Remove misleading double-deletion test
Jakub Kuderski [Sun, 21 Jan 2018 03:07:16 +0000 (03:07 +0000)]
[Dominators] Remove misleading double-deletion test

Summary:
It's generally not safe to perform multiple DomTree updates without using the incremental API.

Although it is supposed to work in this particular case, the testcase is misleading/confusing, and it's better to remove it.

Reviewers: dberlin, brzycki, davide, grosser

Reviewed By: davide

Subscribers: llvm-commits

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

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

6 years ago[ORC] Cleanup. NFC.
Lang Hames [Sun, 21 Jan 2018 02:24:45 +0000 (02:24 +0000)]
[ORC] Cleanup. NFC.

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

6 years ago[DSE] Factor out common code [NFC]
Philip Reames [Sun, 21 Jan 2018 02:10:54 +0000 (02:10 +0000)]
[DSE] Factor out common code [NFC]

We already had the pointer being stored to in the MemLoc, reuse that code.  In merging cases, it turned out the interface of the getLocForWrite had become inconsitent with other related utilities.  Fix that by making sure the input passes hasAnalyzableWrite as well.

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

6 years ago[DSE] Minor rename for clarity sake [NFC]
Philip Reames [Sun, 21 Jan 2018 01:44:33 +0000 (01:44 +0000)]
[DSE] Minor rename for clarity sake [NFC]

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

6 years ago[cmake] Don't build Native llvm-config when cross compiling if passed by user.
Don Hinton [Sun, 21 Jan 2018 00:29:00 +0000 (00:29 +0000)]
[cmake] Don't build Native llvm-config when cross compiling if passed by user.

Summary:
Rename LLVM_CONFIG_EXE to LLVM_CONFIG_PATH, and avoid building it if
passed in by user.  This is the same way CLANG_TABLEGEN and
LLVM_TABLEGEN are handled, e.g., when -DLLVM_OPTIMIZED_TABLEGEN=ON is
passed.

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

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

6 years ago[ValueLattice] Use union to shave off ptr size bytes from elements.
Florian Hahn [Sat, 20 Jan 2018 19:52:16 +0000 (19:52 +0000)]
[ValueLattice] Use union to shave off ptr size bytes from elements.

By using a union for Constant* and ConstantRange we can shave off ptr
size bytes off lattice elements. On 64 bit systems, it brings down the
size to 40 bytes from 48 bytes.

Initialization of Range happens on-demand using placement new, if the
state changes to constantrange from non-constantrange. Similarly, the
Range object is destroyed if the state changes from constantrange to
non-constantrange.

Reviewers: reames, anna, davide

Reviewed By: reames, davide

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

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

6 years ago[X86] Add an override of targetShrinkDemandedConstant to limit the damage that shrink...
Craig Topper [Sat, 20 Jan 2018 18:50:09 +0000 (18:50 +0000)]
[X86] Add an override of targetShrinkDemandedConstant to limit the damage that shrinkdemandedbits can do to zext_in_reg operations

Summary:
This patch adds an implementation of targetShrinkDemandedConstant that tries to keep shrinkdemandedbits from removing bits that would otherwise have been recognized as a movzx.

We still need a follow patch to stop moving ands across srl if the and could be represented as a movzx before the shift but not after. I think this should help with some of the cases that D42088 ended up removing during isel.

Reviewers: spatel, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

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

6 years ago[X86][SSE] Check for out of bounds PEXTR/PINSR indices during faux shuffle combining.
Simon Pilgrim [Sat, 20 Jan 2018 17:16:01 +0000 (17:16 +0000)]
[X86][SSE] Check for out of bounds PEXTR/PINSR indices during faux shuffle combining.

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

6 years agoMove new test from Generic to SystemZ.
Jonas Paulsson [Sat, 20 Jan 2018 16:57:06 +0000 (16:57 +0000)]
Move new test from Generic to SystemZ.

A few build bots failed with r323042 because they are not configured to
build the SystemZ target.

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

6 years ago[InstCombine] add baseline tests for (X << Y) / X -> 1 << Y; NFC
Sanjay Patel [Sat, 20 Jan 2018 16:13:40 +0000 (16:13 +0000)]
[InstCombine] add baseline tests for (X << Y) / X -> 1 << Y; NFC

This fold is proposed in D42032.

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

6 years ago[SelectionDAG] Fix codegen of vector stores with non byte-sized elements.
Jonas Paulsson [Sat, 20 Jan 2018 16:05:10 +0000 (16:05 +0000)]
[SelectionDAG] Fix codegen of vector stores with non byte-sized elements.

This was completely broken, but hopefully fixed by this patch.

In cases where it is needed, a vector with non byte-sized elements is stored
by extracting, zero-extending, shift:ing and or:ing the elements into an
integer of the same width as the vector, which is then stored.

Review: Eli Friedman, Ulrich Weigand
https://reviews.llvm.org/D42100#inline-369520
https://bugs.llvm.org/show_bug.cgi?id=35520

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

6 years ago[COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode
Martin Storsjo [Sat, 20 Jan 2018 11:44:32 +0000 (11:44 +0000)]
[COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode

This (together with the corresponding LLD commit, that contains the
testcase updates) fixes PR35733.

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

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

6 years ago[Dominators] Fix some edge cases for PostDomTree updating
David Green [Sat, 20 Jan 2018 10:29:37 +0000 (10:29 +0000)]
[Dominators] Fix some edge cases for PostDomTree updating

These fix some odd cfg cases where batch-updating the post
dom tree fails. Usually around infinite loops and roots
ending up being different.

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

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

6 years ago[X86] Add some more v32i1 shuffle tests with shuffles between mask creation and mask...
Craig Topper [Sat, 20 Jan 2018 08:13:35 +0000 (08:13 +0000)]
[X86] Add some more v32i1 shuffle tests with shuffles between mask creation and mask usage rather than being just shuffling input arguments.

The existing tests just tested shuffles of v32i1 inputs, but arguments are promoted to v32i8. So it wasn't a good demonstration of v32i1 shuffle handling.

The new test cases use compares and selects to get k-register operations around the shuffle.

This is prep work for demonstrating changes from D42031.

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

6 years ago[X86] Add test cases for failures to use movzx due to various issues with demanded...
Craig Topper [Sat, 20 Jan 2018 07:50:57 +0000 (07:50 +0000)]
[X86] Add test cases for failures to use movzx due to various issues with demanded bits.

D42265 and D42313 should help with some of these.

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

6 years agotest: fix ARM tests harder
Saleem Abdulrasool [Sat, 20 Jan 2018 01:26:46 +0000 (01:26 +0000)]
test: fix ARM tests harder

Remove the missed check update for the removal of the x86 specific
vector call on ARM.

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

6 years agotest: move ARM test from x86
Saleem Abdulrasool [Sat, 20 Jan 2018 01:03:11 +0000 (01:03 +0000)]
test: move ARM test from x86

The ARM backend is not guaranteed to be present on x86, move the test to
the ARM tests.

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

6 years agoCodeGen: handle llvm.used properly for COFF
Saleem Abdulrasool [Sat, 20 Jan 2018 00:28:02 +0000 (00:28 +0000)]
CodeGen: handle llvm.used properly for COFF

`llvm.used` contains a list of pointers to named values which the
compiler, assembler, and linker are required to treat as if there is a
reference that they cannot see.  Ensure that the symbols are preserved
by adding an explicit `-include` reference to the linker command.

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

6 years ago[X86] Teach X86 codegen to use vector width preference to avoid promoting to 512...
Craig Topper [Sat, 20 Jan 2018 00:26:12 +0000 (00:26 +0000)]
[X86] Teach X86 codegen to use vector width preference to avoid promoting to 512-bit types when VLX is enabled and the preference is for a smaller size.

This change applies to places where we would turn 128/256-bit code into 512-bit in order to get a wider element type through sext/zext. Any 512-bit types that already existed in the IR/DAG will be left that way.

The width preference has no effect on codegen behavior when the target does not have AVX512 enabled. So AVX/AVX2 codegen cannot be limited via this mechanism yet.

If the preference is lower than 256 we may still use a 256 bit type to do the operation. Constraining to 128 bits makes it much more difficult to support some operations. For many of these cases we need to change element width while keeping element count constant which is easiest done by switching between 256 and 128 bit.

The preference is only obeyed when AVX512 and VLX are available. This means the preference is not obeyed for KNL, but is obeyed for SKX, Cannonlake, and Icelake. For KNL, the only way to do masked operation is on 512-bit registers so we would have to completely disable masking to obey the preference. We would also lose support for gather, scatter, ctlz, vXi64 multiplies, etc. This may change in the future, but this simplifies the initial implementation.

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

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

6 years ago[X86] Add support for passing 'prefer-vector-width' function attribute into X86Subtar...
Craig Topper [Sat, 20 Jan 2018 00:26:08 +0000 (00:26 +0000)]
[X86] Add support for passing 'prefer-vector-width' function attribute into X86Subtarget and exposing via X86's getRegisterWidth TTI interface.

This will cause the vectorizers to do some limiting of the vector widths they create. This is not a strict limit. There are reasons I know of that the loop vectorizer will generate larger vectors for.

I've written this in such a way that the interface will only return a properly supported width(0/128/256/512) even if the attribute says something funny like 384 or 10.

This has been split from D41895 with the remainder in a follow up commit.

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

6 years ago[WebAssembly] Fix MSVC build
Derek Schuff [Sat, 20 Jan 2018 00:01:18 +0000 (00:01 +0000)]
[WebAssembly] Fix MSVC build

nullptr_t can't be used left of boolean &&

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

6 years ago[ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a call
Akira Hatanaka [Fri, 19 Jan 2018 23:51:13 +0000 (23:51 +0000)]
[ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a call
to @objc_autorelease if its operand is a PHI and the PHI has an
equivalent value that is used by a return instruction.

For example, ARC optimizer shouldn't replace the call in the following
example, as doing so breaks the AutoreleaseRV/RetainRV optimization:

  %v1 = bitcast i32* %v0 to i8*
  br label %bb3
bb2:
  %v3 = bitcast i32* %v2 to i8*
  br label %bb3
bb3:
  %p = phi i8* [ %v1, %bb1 ], [ %v3, %bb2 ]
  %retval = phi i32* [ %v0, %bb1 ], [ %v2, %bb2 ] ; equivalent to %p
  %v4 = tail call i8* @objc_autoreleaseReturnValue(i8* %p)
  ret i32* %retval

Also, make sure ObjCARCContract replaces @objc_autoreleaseReturnValue's
operand uses with its value so that the call gets tail-called.

rdar://problem/15894705

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

6 years ago[AArch64] Add ARMv8.2-A FP16 scalar intrinsics
Abderrazek Zaafrani [Fri, 19 Jan 2018 23:10:56 +0000 (23:10 +0000)]
[AArch64] Add ARMv8.2-A FP16 scalar intrinsics

https://reviews.llvm.org/D41792

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

6 years agoFix -Wunused-variable.
Rui Ueyama [Fri, 19 Jan 2018 22:56:04 +0000 (22:56 +0000)]
Fix -Wunused-variable.

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

6 years ago[x86] add tests for sqrt estimate that should respect denorms; NFC (PR34994)
Sanjay Patel [Fri, 19 Jan 2018 22:47:49 +0000 (22:47 +0000)]
[x86] add tests for sqrt estimate that should respect denorms; NFC (PR34994)

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

6 years ago[ORC] Re-apply r322913 with a fix for a read-after-free error.
Lang Hames [Fri, 19 Jan 2018 22:24:13 +0000 (22:24 +0000)]
[ORC] Re-apply r322913 with a fix for a read-after-free error.

ExternalSymbolMap now stores the string key (rather than using a StringRef),
as the object file backing the key may be removed at any time.

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

6 years ago[X86] Autogenerate complete checks on a couple tests. NFC
Craig Topper [Fri, 19 Jan 2018 22:04:20 +0000 (22:04 +0000)]
[X86] Autogenerate complete checks on a couple tests. NFC

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

6 years ago[Dominators] Visit affected node candidates found at different root levels
Jakub Kuderski [Fri, 19 Jan 2018 21:27:24 +0000 (21:27 +0000)]
[Dominators] Visit affected node candidates found at different root levels

Summary:
This patch attempts to fix the DomTree incremental insertion bug found here [[ https://bugs.llvm.org/show_bug.cgi?id=35969 | PR35969 ]] .

When performing an insertion into a piece of unreachable CFG, we may find the same not at different levels. When this happens, the node can turn out to be affected when we find it starting from a node with a lower level in the tree. The level at which we start visitation affects if we consider a node affected or not.

This patch tracks the lowest level at which each node was visited during insertion and allows it to be visited multiple times, if it can cause it to be considered affected.

Reviewers: brzycki, davide, dberlin, grosser

Reviewed By: brzycki

Subscribers: llvm-commits

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

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

6 years agoAdd optional DICompileUnit to DIBuilder + make outliner debug info use it
Jessica Paquette [Fri, 19 Jan 2018 21:21:49 +0000 (21:21 +0000)]
Add optional DICompileUnit to DIBuilder + make outliner debug info use it

Previously, the DIBuilder didn't expose functionality to set its compile unit
in any other way than calling createCompileUnit. This meant that the outliner,
which creates new functions, had to create a new compile unit for its debug
info.

This commit adds an optional parameter in the DIBuilder's constructor which
lets you set its CU at construction.

It also changes the MachineOutliner so that it keeps track of the DISubprograms
for each outlined sequence. If debugging information is requested, then it
uses one of the outlined sequence's DISubprograms to grab a CU. It then uses
that CU to construct the DISubprogram for the new outlined function.

The test has also been updated to reflect this change.

See https://reviews.llvm.org/D42254 for more information. Also see the e-mail
discussion on D42254 in llvm-commits for more context.

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

6 years ago[SystemZ] Prefer LOCHI over generating IPM sequences
Ulrich Weigand [Fri, 19 Jan 2018 20:56:04 +0000 (20:56 +0000)]
[SystemZ] Prefer LOCHI over generating IPM sequences

On current machines we have load-on-condition instructions that can be
used to directly implement the SETCC semantics.  If we have those, it is
always preferable to use them instead of generating the IPM sequence.

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

6 years ago[SystemZ] Directly use CC result of compare-and-swap
Ulrich Weigand [Fri, 19 Jan 2018 20:54:18 +0000 (20:54 +0000)]
[SystemZ] Directly use CC result of compare-and-swap

In order to implement a test whether a compare-and-swap succeeded, the
SystemZ back-end currently emits a rather inefficient sequence of first
converting the CC result into an integer, and then testing that integer
against zero.  This commit changes the back-end to simply directly test
the CC value set by the compare-and-swap instruction.

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

6 years ago[SystemZ] Rework IPM sequence generation
Ulrich Weigand [Fri, 19 Jan 2018 20:52:04 +0000 (20:52 +0000)]
[SystemZ] Rework IPM sequence generation

The SystemZ back-end uses a sequence of IPM followed by arithmetic
operations to implement the SETCC primitive.  This is currently done
early during SelectionDAG.  This patch moves generating those sequences
to much later in SelectionDAG (during PreprocessISelDAG).

This doesn't change much in generated code by itself, but it allows
further enhancements that will be checked-in as follow-on commits.

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

6 years ago[SystemZ] Implement computeKnownBitsForTargetNode
Ulrich Weigand [Fri, 19 Jan 2018 20:49:05 +0000 (20:49 +0000)]
[SystemZ] Implement computeKnownBitsForTargetNode

This provides a computeKnownBits implementation for SystemZ target
nodes.  Currently only SystemZISD::SELECT_CCMASK is supported.

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

6 years ago[SelectionDAG] Teach computeKnownBits about ATOMIC_CMP_SWAP_WITH_SUCCESS boolean...
Ulrich Weigand [Fri, 19 Jan 2018 20:47:14 +0000 (20:47 +0000)]
[SelectionDAG] Teach computeKnownBits about ATOMIC_CMP_SWAP_WITH_SUCCESS boolean return value

The second return value of ATOMIC_CMP_SWAP_WITH_SUCCESS is known to be a
boolean, and should therefore be treated by computeKnownBits just like
the second return values of SMULO / UMULO.

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

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

6 years ago[SystemZ] Run branch-12.ll test only if long tests enabled
Ulrich Weigand [Fri, 19 Jan 2018 19:51:38 +0000 (19:51 +0000)]
[SystemZ] Run branch-12.ll test only if long tests enabled

This avoids excessive test run times e.g. with expensive checks enabled.

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

6 years ago[WebAssembly] MC: Start table at offset 1 rather than 0
Sam Clegg [Fri, 19 Jan 2018 18:57:01 +0000 (18:57 +0000)]
[WebAssembly] MC: Start table at offset 1 rather than 0

Summary:
For consistency with the output of lld.

This is useful in runnable binaries as can them be sure the
null function pointer will never be a valid argument
call_indirect.

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

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

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

6 years ago[X86][SSE] Add SSE2 gather tests
Simon Pilgrim [Fri, 19 Jan 2018 17:50:25 +0000 (17:50 +0000)]
[X86][SSE] Add SSE2 gather tests

Check codegen without PEXTRD

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

6 years ago[cmake] Include LLVM_LIBXML2_ENABLED in LLVMConfig.cmake, PR36006
Michal Gorny [Fri, 19 Jan 2018 17:47:03 +0000 (17:47 +0000)]
[cmake] Include LLVM_LIBXML2_ENABLED in LLVMConfig.cmake, PR36006

Include the LLVM_LIBXML2_ENABLED cache variable in LLVMConfig.cmake
in order to make it available for other LLVM packages to query. This
is necessary to fix stand-alone testing of LLD.

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

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

6 years ago[ARM] Fix perf regression in compare optimization.
Joel Galenson [Fri, 19 Jan 2018 17:46:27 +0000 (17:46 +0000)]
[ARM] Fix perf regression in compare optimization.

Fix a performance regression caused by r322737.

While trying to make it easier to replace compares with existing adds and
subtracts, I accidentally stopped it from doing so in some cases.  This should
fix that.  I'm also fixing another potential bug in that commit.

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

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

6 years ago[WebAssembly] Fix libcall signature lookup
Derek Schuff [Fri, 19 Jan 2018 17:45:54 +0000 (17:45 +0000)]
[WebAssembly] Fix libcall signature lookup

RuntimeLibcallSignatures previously manually initialized all the libcall
names into an array and searched it linearly for the first match to lookup
the corresponding index.
r322802 switched that to initializing a map keyed by the libcall name.
Neither of these approaches works correctly because some libcall numbers use
the same name on different platforms (e.g. the "l" suffixed functions
use f80 or f128 or ppcf128).

This change fixes that by ensuring that each name only goes into the map
once. It also adds tests.

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

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

6 years agoAdditional fixes for docs in addition to r322968.
Daniel Neilson [Fri, 19 Jan 2018 17:32:33 +0000 (17:32 +0000)]
Additional fixes for docs in addition to r322968.

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

6 years agoFix docs build break caused by r322965
Daniel Neilson [Fri, 19 Jan 2018 17:24:21 +0000 (17:24 +0000)]
Fix docs build break caused by r322965

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

6 years ago[WebAssembly] Make sign-extension opcodes a distinct feature.
Dan Gohman [Fri, 19 Jan 2018 17:16:24 +0000 (17:16 +0000)]
[WebAssembly] Make sign-extension opcodes a distinct feature.

Sign-extension opcodes have been split into a separate proposal from
the main threads proposal, so switch them to their own target
feature. See:

https://github.com/WebAssembly/sign-extension-ops

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

6 years agoRemove alignment argument from memcpy/memmove/memset in favour of alignment attribute...
Daniel Neilson [Fri, 19 Jan 2018 17:13:12 +0000 (17:13 +0000)]
Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)

Summary:
 This is a resurrection of work first proposed and discussed in Aug 2015:
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
and initially landed (but then backed out) in Nov 2015:
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

 The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.

 This change is the first in a series that allows source and dest to each
have their own alignments by using the alignment attribute on their arguments.

 In this change we:
1) Remove the alignment argument.
2) Add alignment attributes to the source & dest arguments. We, temporarily,
   require that the alignments for source & dest be equal.

 For example, code which used to read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)

 Downstream users may have to update their lit tests that check for
@llvm.memcpy/memmove/memset call/declaration patterns. The following extended sed script
may help with updating the majority of your tests, but it does not catch all possible
patterns so some manual checking and updating will be required.

s~declare void @llvm\.mem(set|cpy|move)\.p([^(]*)\((.*), i32, i1\)~declare void @llvm.mem\1.p\2(\3, i1)~g
s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* \3, i8 \4, i8 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* \3, i8 \4, i16 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* \3, i8 \4, i32 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* \3, i8 \4, i64 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* \3, i8 \4, i128 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* align \6 \3, i8 \4, i8 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* align \6 \3, i8 \4, i16 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* align \6 \3, i8 \4, i32 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* align \6 \3, i8 \4, i64 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* align \6 \3, i8 \4, i128 \5, i1 \7)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* \4, i8\5* \6, i8 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* \4, i8\5* \6, i16 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* \4, i8\5* \6, i32 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* \4, i8\5* \6, i64 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* \4, i8\5* \6, i128 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* align \8 \4, i8\5* align \8 \6, i8 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* align \8 \4, i8\5* align \8 \6, i16 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* align \8 \4, i8\5* align \8 \6, i32 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* align \8 \4, i8\5* align \8 \6, i64 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* align \8 \4, i8\5* align \8 \6, i128 \7, i1 \9)~g

 The remaining changes in the series will:
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
   source and dest alignments.
Step 3) Update Clang to use the new IRBuilder API.
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
        and those that use use MemIntrinsicInst::[get|set]Alignment() to use
        getDestAlignment() and getSourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
        MemIntrinsicInst::[get|set]Alignment() methods.

Reviewers: pete, hfinkel, lhames, reames, bollu

Reviewed By: reames

Subscribers: niosHD, reames, jholewinski, qcolombet, jfb, sanjoy, arsenm, dschuff, dylanmckay, mehdi_amini, sdardis, nemanjai, david2050, nhaehnle, javed.absar, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, sabuasal, llvm-commits

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

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

6 years agoFallback option for colorized output when terminfo isn't available
Petr Hosek [Fri, 19 Jan 2018 17:10:55 +0000 (17:10 +0000)]
Fallback option for colorized output when terminfo isn't available

Try to detect the terminal color support by checking the value of the
TERM environment variable. This is not great, but it's better than
nothing when terminfo library isn't available, which may still be the
case on some Linux distributions.

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

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

6 years ago[x86] add RUN line and auto-generate checks
Sanjay Patel [Fri, 19 Jan 2018 17:09:28 +0000 (17:09 +0000)]
[x86] add RUN line and auto-generate checks

There were checks for a 32-bit target here, but no RUN line
corresponding to that prefix. I don't know what the intent
of these tests is, but at least now we can see what happens
for both targets.

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

6 years ago[x86] regenerate complete checks; NFC
Sanjay Patel [Fri, 19 Jan 2018 17:05:16 +0000 (17:05 +0000)]
[x86] regenerate complete checks; NFC

D42265 will improve something here, but it's not obvious how without more checks.

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

6 years ago[cmake] Fix typo in LLVM_UTILS_INSTALL_DIR definition.
Don Hinton [Fri, 19 Jan 2018 17:02:12 +0000 (17:02 +0000)]
[cmake] Fix typo in LLVM_UTILS_INSTALL_DIR definition.

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

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

6 years agoTest commit
Carey Williams [Fri, 19 Jan 2018 16:55:23 +0000 (16:55 +0000)]
Test commit

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

6 years ago[x86] shrink 'and' immediate values by setting the high bits (PR35907)
Sanjay Patel [Fri, 19 Jan 2018 16:37:25 +0000 (16:37 +0000)]
[x86] shrink 'and' immediate values by setting the high bits (PR35907)

Try to reverse the constant-shrinking that happens in SimplifyDemandedBits()
for 'and' masks when it results in a smaller sign-extended immediate.

We are also able to detect dead 'and' ops here (the mask is all ones). In
that case, we replace and return without selecting the 'and'.

Other targets might want to share some of this logic by enabling this under a
target hook, but I didn't see diffs for simple cases with PowerPC or AArch64,
so they may already have some specialized logic for this kind of thing or have
different needs.

This should solve PR35907:
https://bugs.llvm.org/show_bug.cgi?id=35907

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

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

6 years ago[InstSimplify] use m_Specific and commutative matcher to reduce code; NFCI
Sanjay Patel [Fri, 19 Jan 2018 16:12:55 +0000 (16:12 +0000)]
[InstSimplify] use m_Specific and commutative matcher to reduce code; NFCI

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

6 years ago[X86] Extend load-op-store fusion merge to ADC/SBB.
Nirav Dave [Fri, 19 Jan 2018 15:37:57 +0000 (15:37 +0000)]
[X86] Extend load-op-store fusion merge to ADC/SBB.

Summary: Add handling of EFLAG input to X86 Load-op-store fusion checking.

Reviewers: craig.topper, RKSimon

Subscribers: llvm-commits, hiraditya

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

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

6 years ago[AArch64][SVE] Asm: Add support for RDVL/ADDVL/ADDPL instructions
Sander de Smalen [Fri, 19 Jan 2018 15:22:00 +0000 (15:22 +0000)]
[AArch64][SVE] Asm: Add support for RDVL/ADDVL/ADDPL instructions

Reviewers: fhahn, rengolin, t.p.northover, echristo, olista01, SjoerdMeijer

Reviewed By: SjoerdMeijer

Subscribers: SjoerdMeijer, aemerson, javed.absar, tschuett, kristof.beyls, llvm-commits

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

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

6 years ago[X86][AVX] Add more variable permute tests for source vectors smaller than destination
Simon Pilgrim [Fri, 19 Jan 2018 14:55:22 +0000 (14:55 +0000)]
[X86][AVX] Add more variable permute tests for source vectors smaller than destination

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

6 years ago[SLP] Fix vectorization for tree with trunc to minimum required bit width.
Alexey Bataev [Fri, 19 Jan 2018 14:40:13 +0000 (14:40 +0000)]
[SLP] Fix vectorization for tree with trunc to minimum required bit width.

Summary:
If the vectorized tree has truncate to minimum required bit width and
the vector type of the cast operation after the truncation is the same
as the vector type of the cast operands, count cost of the vector cast
operation as 0, because this cast will be later removed.
Also, if the vectorization tree root operations are integer cast operations, do not consider them as candidates for truncation. It will just create extra number of the same vector/scalar operations, which will be removed by instcombiner.

Reviewers: RKSimon, spatel, mkuper, hfinkel, mssimpso

Subscribers: llvm-commits

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

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

6 years ago[Support] - Check nullptr after allocation with malloc in MallocAllocator - Different...
Klaus Kretzschmar [Fri, 19 Jan 2018 14:17:53 +0000 (14:17 +0000)]
[Support] - Check nullptr after allocation with malloc in MallocAllocator - Differential Revision: reviews.llvm.org/D34753

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

6 years ago[AMDGPU][MC] Corrected parsing of image modifiers and encoding of image atomics
Dmitry Preobrazhensky [Fri, 19 Jan 2018 13:49:53 +0000 (13:49 +0000)]
[AMDGPU][MC] Corrected parsing of image modifiers and encoding of image atomics

See bugs
    35962: https://bugs.llvm.org/show_bug.cgi?id=35962
    35963: https://bugs.llvm.org/show_bug.cgi?id=35963

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

Reviewers: vpykhtin, artem.tamazov, arsenm

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

6 years agoFix line endings. NFCI.
Simon Pilgrim [Fri, 19 Jan 2018 12:09:17 +0000 (12:09 +0000)]
Fix line endings. NFCI.

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

6 years ago[X86] Add KNL target to slow PMULLD tests
Simon Pilgrim [Fri, 19 Jan 2018 12:07:44 +0000 (12:07 +0000)]
[X86] Add KNL target to slow PMULLD tests

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

6 years ago[X86] Add RDPID schedule test
Simon Pilgrim [Fri, 19 Jan 2018 12:06:49 +0000 (12:06 +0000)]
[X86] Add RDPID schedule test

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

6 years ago[X86] Regenerate RDPMC intrinsic test
Simon Pilgrim [Fri, 19 Jan 2018 12:05:58 +0000 (12:05 +0000)]
[X86] Regenerate RDPMC intrinsic test

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

6 years ago[CodeGen] Unify printing format of debug-location in both MIR and -debug
Francis Visoiu Mistrih [Fri, 19 Jan 2018 11:44:42 +0000 (11:44 +0000)]
[CodeGen] Unify printing format of debug-location in both MIR and -debug

Use "debug-location" instead of "; dbg:" in MI::print.

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

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Fri, 19 Jan 2018 10:55:29 +0000 (10:55 +0000)]
[NFC] fix trivial typos in comments

"the the" -> "the"

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

6 years ago[ValueLattice] Use getters instead of direct accesses (NFC).
Florian Hahn [Fri, 19 Jan 2018 10:32:48 +0000 (10:32 +0000)]
[ValueLattice] Use getters instead of direct accesses (NFC).

Reviewers: reames, davide, anna

Reviewed By: reames, davide

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

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

6 years ago[ModRefInfo] Return NoModRef for Must and NoModRef.
Alina Sbirlea [Fri, 19 Jan 2018 10:26:40 +0000 (10:26 +0000)]
[ModRefInfo] Return NoModRef for Must and NoModRef.

Summary:
In ModRefInfo "Must" was introduced to track presence of MustAlias, but we still want to return NoModRef when there is neither Mod or Ref, even when MustAlias is found. Patch has small fixes to ensure this happens.
Minor cleanup to remove nesting for 2 if statements when calling getModRefInfo for 2 ImmutableCallSites.

Reviewers: sanjoy

Subscribers: jlebar, llvm-commits

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

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

6 years ago[InstCombine] Make foldSelectOpOp able to handle two-operand getelementptr
John Brawn [Fri, 19 Jan 2018 10:05:15 +0000 (10:05 +0000)]
[InstCombine] Make foldSelectOpOp able to handle two-operand getelementptr

Three (or more) operand getelementptrs could plausibly also be handled, but
handling only two-operand fits in easily with the existing BinaryOperator
handling.

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

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

6 years agoSplit MachineLICM into EarlyMachineLICM and MachineLICM; NFC
Matthias Braun [Fri, 19 Jan 2018 06:46:10 +0000 (06:46 +0000)]
Split MachineLICM into EarlyMachineLICM and MachineLICM; NFC

This avoids playing games with pseudo pass IDs and avoids using an
unreliable MRI::isSSA() check to determine whether register allocation
has happened.

Note that this renames:
- MachineLICMID -> EarlyMachineLICM
- PostRAMachineLICMID -> MachineLICMID
to be consistent with the EarlyTailDuplicate/TailDuplicate naming.

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

6 years agoSplit TailDuplicatePass into pre- and post-RA variant; NFC
Matthias Braun [Fri, 19 Jan 2018 06:08:17 +0000 (06:08 +0000)]
Split TailDuplicatePass into pre- and post-RA variant; NFC

Split TailDuplicatePass into EarlyTailDuplicate and TailDuplicate. This
avoids playing games with fake pass IDs and using MRI::isSSA() to
determine pre-/post-RA state.

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

6 years agoMove tests to the correct place
Matthias Braun [Fri, 19 Jan 2018 06:08:15 +0000 (06:08 +0000)]
Move tests to the correct place

test/CodeGen/MIR is for testing the MIR parser/printer. Tests for passes
and targets belong to test/CodeGen/TARGETNAME.

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

6 years ago[X86] Make better use of instregex for cmovcc/setcc/jcc instructions in the Intel...
Craig Topper [Fri, 19 Jan 2018 05:47:32 +0000 (05:47 +0000)]
[X86] Make better use of instregex for cmovcc/setcc/jcc instructions in the Intel scheduler models.

Combine all the separate condition codes into a singular expression when possible.

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