OSDN Git Service

android-x86/external-llvm.git
5 years ago[ARM] Fix for PR39060
Sam Parker [Wed, 26 Sep 2018 10:56:00 +0000 (10:56 +0000)]
[ARM] Fix for PR39060

When calculating whether a value can safely overflow for use by an
icmp, we weren't checking that the value couldn't wrap around. To do
this we need the icmp to be using a constant, as well as the incoming
add or sub.

bugzilla report: https://bugs.llvm.org/show_bug.cgi?id=39060

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

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

5 years ago[CodeGen] Enable tail calls for functions with NonNull attributes.
David Green [Wed, 26 Sep 2018 10:46:18 +0000 (10:46 +0000)]
[CodeGen] Enable tail calls for functions with NonNull attributes.

Adding NonNull as attributes to returned pointers has the unfortunate side
effect of disabling tail calls. This patch ignores the NonNull attribute when
we decide whether to tail merge, in the same way that we ignore the NoAlias
attribute, as it has no affect on the call sequence.

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

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

5 years agoFixes removal of dead elements from PressureDiff (PR37252).
Yury Gribov [Wed, 26 Sep 2018 10:42:41 +0000 (10:42 +0000)]
Fixes removal of dead elements from PressureDiff (PR37252).

Reviewed By: MatzeB

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

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

5 years ago[AArch64] - Return address signing dwarf support
Luke Cheeseman [Wed, 26 Sep 2018 10:14:15 +0000 (10:14 +0000)]
[AArch64] - Return address signing dwarf support

Functions that have signed return addresses need additional dwarf support:
- After signing the LR, and before authenticating it, the LR register is in a
  state the is unusable by a debugger or unwinder
- To account for this a new directive, .cfi_negate_ra_state, is added
- This directive says the signed state of the LR register has now changed,
  i.e. unsigned -> signed or signed -> unsigned
- This directive has the same CFA code as the SPARC directive GNU_window_save
  (0x2d), adding a macro to account for multiply defined codes
- This patch matches the gcc implementation of this support:
  https://patchwork.ozlabs.org/patch/800271/

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

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

5 years ago[CMake] Avoid REVERSE on unset variable
Sven van Haastregt [Wed, 26 Sep 2018 10:14:10 +0000 (10:14 +0000)]
[CMake] Avoid REVERSE on unset variable

If required_libs happens to remain unset, CMake would fail with:

  list sub-command REVERSE requires list to be present.

Fix by ensuring we do not attempt to reverse an unset variable.

Reported by Tu Vuong.

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

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

5 years agoRun VerifyDAGDiverence in debug only
Mikael Nilsson [Wed, 26 Sep 2018 09:25:45 +0000 (09:25 +0000)]
Run VerifyDAGDiverence in debug only

VerifyDAGDiverence costs compilation time, avoid running it in non-debug
builds.

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

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

5 years agoRevert r342870 "[ARM] bottom-top mul support ARMParallelDSP"
Hans Wennborg [Wed, 26 Sep 2018 08:41:50 +0000 (08:41 +0000)]
Revert r342870 "[ARM] bottom-top mul support ARMParallelDSP"

This broke Chromium's Android build (https://crbug.com/889390) and the
polly-aosp buildbot
(http://lab.llvm.org:8011/builders/aosp-O3-polly-before-vectorizer-unprofitable).

> Originally committed in rL342210 but was reverted in rL342260 because
> it was causing issues in vectorized code, because I had forgotten to
> ensure that we're operating on scalar values.
>
> Original commit message:
>
> On failing to find sequences that can be converted into dual macs,
> try to find sequential 16-bit loads that are used by muls which we
> can then use smultb, smulbt, smultt with a wide load.
>
> Differential Revision: https://reviews.llvm.org/D51983

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

5 years ago[llvm-exegesis] Output the unscaled value as well as the scaled one.
Clement Courbet [Wed, 26 Sep 2018 08:37:21 +0000 (08:37 +0000)]
[llvm-exegesis] Output the unscaled value as well as the scaled one.

Summary: See PR38936 for context.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

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

5 years agoSilence compiler warning about unused variable introduced in r343018
Mikael Holmen [Wed, 26 Sep 2018 06:19:08 +0000 (06:19 +0000)]
Silence compiler warning about unused variable introduced in r343018

Since the body of the "else if" contains
 // TODO
I suppose someone will need the variable again at some point, but with
-Werror the warning made it not compile at all.

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

5 years ago[ORC] Remove a superfluous semicolon, fixing warnings. NFC.
Martin Storsjo [Wed, 26 Sep 2018 06:13:03 +0000 (06:13 +0000)]
[ORC] Remove a superfluous semicolon, fixing warnings. NFC.

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

5 years ago[ORC] Update CompileOnDemandLayer2 to use the new lazyReexports mechanism
Lang Hames [Wed, 26 Sep 2018 05:08:29 +0000 (05:08 +0000)]
[ORC] Update CompileOnDemandLayer2 to use the new lazyReexports mechanism
for lazy compilation, rather than a callback manager.

The new mechanism does not block compile threads, and does not require
function bodies to be renamed.

Future modifications should allow laziness on a per-module basis to work
without any modification of the input module.

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

5 years ago[DebugInfo] Do not generate address info for removed debug labels.
Hsiangkai Wang [Wed, 26 Sep 2018 04:19:23 +0000 (04:19 +0000)]
[DebugInfo] Do not generate address info for removed debug labels.

In some senario, LLVM will remove llvm.dbg.labels in IR. For example,
when the labels are in unreachable blocks, these labels will not
be generated in LLVM IR. In the case, these debug labels will have
address zero as their address. It is not legal address for debugger to
set breakpoints or query sources. So, the patch inhibits the address info
(DW_AT_low_pc) of removed labels.

Fix build failed in BuildBot, clang-stage1-cmake-RA-incremental, on macOS.

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

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

5 years ago[ORC] Add a "lazy call-through" utility based on the same underlying trampoline
Lang Hames [Wed, 26 Sep 2018 04:18:30 +0000 (04:18 +0000)]
[ORC] Add a "lazy call-through" utility based on the same underlying trampoline
implementation as lazy compile callbacks, and a "lazy re-exports" utility that
builds lazy call-throughs.

Lazy call-throughs are similar to lazy compile callbacks (and are based on the
same underlying state saving/restoring trampolines) but resolve their targets
by performing a standard ORC lookup rather than invoking a user supplied
compiler callback. This allows them to inherit the thread-safety of ORC lookups
while blocking only the calling thread (whereas compile callbacks also block one
compile thread).

Lazy re-exports provide a simple way of building lazy call-throughs. Unlike a
regular re-export, a lazy re-export generates a new address (a stub entry point)
that will act like the re-exported symbol when called. The first call via a
lazy re-export will trigger compilation of the re-exported symbol before calling
through to it.

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

5 years ago[ORC] Fix BuildingAJIT tutorial examples that were broken by r343059.
Lang Hames [Wed, 26 Sep 2018 04:00:58 +0000 (04:00 +0000)]
[ORC] Fix BuildingAJIT tutorial examples that were broken by r343059.

createLocalCompileCallbackManager now returns an Expected value. This commit
wraps the call with cantFail to unwrap it.

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

5 years ago[ORC] Refactor trampoline pool management out of JITCompileCallbackManager.
Lang Hames [Wed, 26 Sep 2018 03:32:12 +0000 (03:32 +0000)]
[ORC] Refactor trampoline pool management out of JITCompileCallbackManager.

This will allow trampoline pools to be re-used for a new lazy-reexport utility
that generates looks up function bodies using the standard symbol lookup process
(rather than using a user provided compile function). This new utility provides
the same capabilities (since MaterializationUnits already allow user supplied
compile functions to be run) as JITCompileCallbackManager, but can use the new
asynchronous lookup functions to avoid blocking a compile thread.

This patch also updates createLocalCompileCallbackManager to return an error if
a callback manager can not be created, and updates clients of that API to
account for the change. Finally, the OrcCBindingsStack is updates so that if
a callback manager is not available for the target platform a valid stack
(without support for lazy compilation) can still be constructed.

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

5 years ago[ORC] Add support for multithreaded compiles to LLJIT and LLLazyJIT.
Lang Hames [Wed, 26 Sep 2018 02:39:42 +0000 (02:39 +0000)]
[ORC] Add support for multithreaded compiles to LLJIT and LLLazyJIT.

LLJIT and LLLazyJIT can now be constructed with an optional NumCompileThreads
arguments. If this is non-zero then a thread-pool will be created with the
given number of threads, and compile tasks will be dispatched to the thread
pool.

To enable testing of this feature, two new flags are added to lli:

(1) -compile-threads=N (N = 0 by default) controls the number of compile threads
to use.

(2) -thread-entry can be used to execute code on additional threads. For each
-thread-entry argument supplied (multiple are allowed) a new thread will be
created and the given symbol called. These additional thread entry points are
called after static constructors are run, but before main.

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

5 years ago[ORC] Include-what-you-use fixes.
Lang Hames [Wed, 26 Sep 2018 02:01:39 +0000 (02:01 +0000)]
[ORC] Include-what-you-use fixes.

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

5 years ago[ORC] Fix a missing include in r343055.
Lang Hames [Wed, 26 Sep 2018 01:54:13 +0000 (01:54 +0000)]
[ORC] Fix a missing include in r343055.

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

5 years ago[ORC] Add ThreadSafeModule and ThreadSafeContext wrappers to support concurrent
Lang Hames [Wed, 26 Sep 2018 01:24:12 +0000 (01:24 +0000)]
[ORC] Add ThreadSafeModule and ThreadSafeContext wrappers to support concurrent
compilation of IR in the JIT.

ThreadSafeContext is a pair of an LLVMContext and a mutex that can be used to
lock that context when it needs to be accessed from multiple threads.

ThreadSafeModule is a pair of a unique_ptr<Module> and a
shared_ptr<ThreadSafeContext>. This allows the lifetime of a ThreadSafeContext
to be managed automatically in terms of the ThreadSafeModules that refer to it:
Once all modules using a ThreadSafeContext are destructed, and providing the
client has not held on to a copy of shared context pointer, the context will be
automatically destructed.

This scheme is necessary due to the following constraits: (1) We need multiple
contexts for multithreaded compilation (at least one per compile thread plus
one to store any IR not currently being compiled, though one context per module
is simpler). (2) We need to free contexts that are no longer being used so that
the JIT does not leak memory over time. (3) Module lifetimes are not
predictable (modules are compiled as needed depending on the flow of JIT'd
code) so there is no single point where contexts could be reclaimed.

JIT clients not using concurrency can safely use one ThreadSafeContext for all
ThreadSafeModules.

JIT clients who want to be able to compile concurrently should use a different
ThreadSafeContext for each module, or call setCloneToNewContextOnEmit on their
top-level IRLayer. The former reduces compile latency (since no clone step is
needed) at the cost of additional memory overhead for uncompiled modules (as
every uncompiled module will duplicate the LLVM types, constants and metadata
that have been shared).

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

5 years agoRemove LoopID metadata from the branch instruction
Vyacheslav Zakharin [Wed, 26 Sep 2018 01:03:21 +0000 (01:03 +0000)]
Remove LoopID metadata from the branch instruction
that follows the peeled iterations.

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

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

5 years agoRevert "Revert "[ConstHoist] Do not rebase single (or few) dependent constant""
Zhaoshi Zheng [Wed, 26 Sep 2018 00:59:09 +0000 (00:59 +0000)]
Revert "Revert "[ConstHoist] Do not rebase single (or few) dependent constant""

This reverts commit bd7b44f35ee9fbe365eb25ce55437ea793b39346.

Reland r342994: disabled the optimization and explicitly enable it in test.

-mllvm -consthoist-min-num-to-rebase<unsigned>=0

[ConstHoist] Do not rebase single (or few) dependent constant

If an instance (InsertionPoint or IP) of Base constant A has only one or few
rebased constants depending on it, do NOT rebase. One extra ADD instruction is
required to materialize each rebased constant, assuming A and the rebased have
the same materialization cost.

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

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

5 years ago[WebAssembly] SIMD conversions
Thomas Lively [Wed, 26 Sep 2018 00:34:36 +0000 (00:34 +0000)]
[WebAssembly] SIMD conversions

Summary:
Lowers (s|u)itofp and fpto(s|u)i instructions for vectors. The fp to
int conversions produce poison values if their arguments are out of
the convertible range, so a future CL will have to add an LLVM
intrinsic to make the saturating behavior of this conversion usable.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

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

5 years ago[DAGCombiner] Remove unnecessary check for visitSDIVLike/visitUDIVLike returning...
Craig Topper [Tue, 25 Sep 2018 23:52:07 +0000 (23:52 +0000)]
[DAGCombiner] Remove unnecessary check for visitSDIVLike/visitUDIVLike returning a UDIVREM or SDIVREM node.

This shouldn't be possible and is a leftover from when we used to recursively call combine here.

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

5 years ago[AMDGPU] Fix ds combine with subregs
Stanislav Mekhanoshin [Tue, 25 Sep 2018 23:33:18 +0000 (23:33 +0000)]
[AMDGPU] Fix ds combine with subregs

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

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

5 years ago[X86] Allow movmskpd/ps ISD nodes to be created and selected with integer input types.
Craig Topper [Tue, 25 Sep 2018 23:28:27 +0000 (23:28 +0000)]
[X86] Allow movmskpd/ps ISD nodes to be created and selected with integer input types.

This removes an int->fp bitcast between the surrounding code and the movmsk. I had already added a hack to combineMOVMSK to try to look through this bitcast to improve the SimplifyDemandedBits there.

But I found an additional issue where the bitcast was preventing combineMOVMSK from being called again after earlier nodes in the DAG are optimized. The bitcast gets revisted, but not the user of the bitcast. By using integer types throughout, the bitcast doesn't get in the way.

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

5 years ago[X86] Add some more movmsk test cases. NFC
Craig Topper [Tue, 25 Sep 2018 23:28:24 +0000 (23:28 +0000)]
[X86] Add some more movmsk test cases. NFC

These IR patterns represent the exact behavior of a movmsk instruction using (zext (bitcast (icmp slt X, 0))).

For the v4i32/v8i32/v2i64/v4i64 we currently emit a PCMPGT for the icmp slt which is unnecessary since we only care about the sign bit of the result. This is because of the int->fp bitcast we put on the input to the movmsk nodes for these cases. I'll be fixing this in a future patch.

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

5 years ago[ORC] Add an asynchronous jit-link function, jitLinkForORC, to RuntimeDyld and
Lang Hames [Tue, 25 Sep 2018 22:57:44 +0000 (22:57 +0000)]
[ORC] Add an asynchronous jit-link function, jitLinkForORC, to RuntimeDyld and
switch RTDyldObjectLinkingLayer2 to use it.

RuntimeDyld::loadObject is currently a blocking operation. This means that any
JIT'd code whose call-graph contains an embedded complete K graph will require
at least K threads to link, which precludes the use of a fixed sized thread
pool for concurrent JITing of arbitrary code (whatever K the thread-pool is set
at, any code with a K+1 complete subgraph will deadlock at JIT-link time).

To address this issue, this commmit introduces a function called jitLinkForORC
that uses continuation-passing style to pass the fix-up and finalization steps
to the asynchronous symbol resolver interface so that linking can be performed
without blocking.

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

5 years ago[InstCombine] add fneg variation of shuffle-binop fold; NFC
Sanjay Patel [Tue, 25 Sep 2018 22:48:58 +0000 (22:48 +0000)]
[InstCombine] add fneg variation of shuffle-binop fold; NFC

If the fsub in this pattern was replaced by an actual fneg
instruction, we would need to add a fold to recognize that
because fneg would not be a binop.

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

5 years agoAMDGPU: Add Selection patterns to support add of one bit.
Changpeng Fang [Tue, 25 Sep 2018 21:21:18 +0000 (21:21 +0000)]
AMDGPU: Add Selection patterns to support add of one bit.

Summary:
  We generate s_xor to lower add of i1s in general cases, and s_not to
lower add with a one-bit imm of -1 (true).

Reviewers:
  rampitec

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

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

5 years ago[LV][LAA] Vectorize loop invariant values stored into loop invariant address
Anna Thomas [Tue, 25 Sep 2018 20:57:20 +0000 (20:57 +0000)]
[LV][LAA] Vectorize loop invariant values stored into loop invariant address

Summary:
We are overly conservative in loop vectorizer with respect to stores to loop
invariant addresses.
More details in https://bugs.llvm.org/show_bug.cgi?id=38546
This is the first part of the fix where we start with vectorizing loop invariant
values to loop invariant addresses.

This also includes changes to ORE for stores to invariant address.

Reviewers: anemet, Ayal, mkuper, mssimpso

Subscribers: llvm-commits

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

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

5 years ago[MCAsmParser] Move AltMacroMode tracking out of MCAsmLexer
Craig Topper [Tue, 25 Sep 2018 20:55:55 +0000 (20:55 +0000)]
[MCAsmParser] Move AltMacroMode tracking out of MCAsmLexer

The Lexer doesn't use this state itself. It is only set and used by AsmParser so it seems like it should just be part of AsmParser.

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

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

5 years ago[X86] combineUIntToFP - Fix UINT_TO_FP(vXi1) comment (PR39078)
Simon Pilgrim [Tue, 25 Sep 2018 20:52:08 +0000 (20:52 +0000)]
[X86] combineUIntToFP - Fix UINT_TO_FP(vXi1) comment (PR39078)

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

5 years agoRemove 'orc' namespace from MSVCErrorWorkarounds.h, fix some typos that were
Lang Hames [Tue, 25 Sep 2018 20:48:57 +0000 (20:48 +0000)]
Remove 'orc' namespace from MSVCErrorWorkarounds.h, fix some typos that were
breaking windows builds.

The 'orc' namespace was accidentally left in when the workarounds were moved
out of orc in r343011.

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

5 years agoFix a missing includes and a use of the MSVC promise/future workaround that
Lang Hames [Tue, 25 Sep 2018 20:16:06 +0000 (20:16 +0000)]
Fix a missing includes and a use of the MSVC promise/future workaround that
were left out of r343011/r343012.

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

5 years ago[ThinLTO] Efficiency fix for writing type id records in per-module indexes
Teresa Johnson [Tue, 25 Sep 2018 20:14:40 +0000 (20:14 +0000)]
[ThinLTO] Efficiency fix for writing type id records in per-module indexes

Summary:
In D49565/r337503, the type id record writing was fixed so that only
referenced type ids were emitted into each per-module index for ThinLTO
distributed builds. However, this still left an efficiency issue: each
per-module index checked all type ids for membership in the referenced
set, yielding O(M*N) performance (M indexes and N type ids).

Change the TypeIdMap in the summary to be indexed by GUID, to facilitate
correlating with type identifier GUIDs referenced in the function
summary TypeIdInfo structures. This allowed simplifying other
places where a map from type id GUID to type id map entry was previously
being used to aid this correlation.

Also fix AsmWriter code to handle the rare case of type id GUID
collision.

For a large internal application, this reduced the thin link time by
almost 15%.

Reviewers: pcc, vitalybuka

Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, llvm-commits

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

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

5 years ago[MC] Return a std::string instead of taking it as an out parameter. Make two parser...
Craig Topper [Tue, 25 Sep 2018 20:13:55 +0000 (20:13 +0000)]
[MC] Return a std::string instead of taking it as an out parameter. Make two parser methods into static functions at file scope. NFC

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

5 years agoUnify landing pad information adding routines (NFC)
Heejin Ahn [Tue, 25 Sep 2018 19:56:44 +0000 (19:56 +0000)]
Unify landing pad information adding routines (NFC)

Summary:
We have `llvm::addLandingPadInfo` and `MachineFunction::addLandingPad`,
both of which add landing pad information to populate `LandingPadInfo`
but are called from different locations, which was confusing. This patch
unifies them with one `MachineFunction::addLandingPad` function, which
now has functionlities of both functions.

Reviewers: rnk

Subscribers: llvm-commits

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

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

5 years ago[ORC] Reapply r342939 with a fix for MSVC's promise/future restrictions.
Lang Hames [Tue, 25 Sep 2018 19:48:46 +0000 (19:48 +0000)]
[ORC] Reapply r342939 with a fix for MSVC's promise/future restrictions.

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

5 years agoMove MSVC workarounds for future<Error>/future<Expected<T>> out of ORC and into
Lang Hames [Tue, 25 Sep 2018 19:48:44 +0000 (19:48 +0000)]
Move MSVC workarounds for future<Error>/future<Expected<T>> out of ORC and into
a header in support.

MSVC's std::future implementation requires types to be default constructible,
but Error and Expected are not. This issue came up once before in ORC's
RPCUtils.h header and was worked around there but came up again in r342939, so
I am moving the workaround to Support to make it available to other clients.

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

5 years ago[MC] Fix bad indentation and 80 column violations. Use StringRef::front instead of...
Craig Topper [Tue, 25 Sep 2018 19:37:35 +0000 (19:37 +0000)]
[MC] Fix bad indentation and 80 column violations. Use StringRef::front instead of dereferencing StringRef::begin. NFC

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

5 years ago[x86] avoid 256-bit andnp that requires insert/extract with AVX1 (PR37449)
Sanjay Patel [Tue, 25 Sep 2018 19:09:34 +0000 (19:09 +0000)]
[x86] avoid 256-bit andnp that requires insert/extract with AVX1 (PR37449)

This is the final (I hope!) problem pattern mentioned in PR37749:
https://bugs.llvm.org/show_bug.cgi?id=37749

We are trying to avoid an AVX1 sinkhole caused by having 256-bit bitwise logic ops but no other 256-bit integer ops.
We've already solved the simple logic ops, but 'andn' is an x86 special. I looked at alternative solutions like
extending the generic DAG combine or trying to wait until the ANDNP node is created, but those are bigger patches
that can over-reach. Ie, splitting to 128-bit does not look like a win in most cases with >1 256-bit op.

The pattern matching is cluttered with bitcasts because of our i64 element canonicalization. For the affected test,
we have this vector-type-legalized sequence:

        t29: v8i32 = concat_vectors t27, t28
      t30: v4i64 = bitcast t29
        t18: v8i32 = BUILD_VECTOR Constant:i32<-1>, Constant:i32<-1>, ...
      t31: v4i64 = bitcast t18
    t32: v4i64 = xor t30, t31
      t9: v8i32 = BUILD_VECTOR Constant:i32<255>, Constant:i32<255>, ...
    t34: v4i64 = bitcast t9
  t35: v4i64 = and t32, t34
t36: v8i32 = bitcast t35
      t37: v4i32 = extract_subvector t36, Constant:i64<0>
      t38: v4i32 = extract_subvector t36, Constant:i64<4>

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

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

5 years ago[WebAssembly] Move/clone DBG_VALUE during WebAssemblyRegStackify pass
Yury Delendik [Tue, 25 Sep 2018 18:59:34 +0000 (18:59 +0000)]
[WebAssembly] Move/clone DBG_VALUE during WebAssemblyRegStackify pass

Summary:
The MoveForSingleUse or MoveAndTeeForMultiUse functions move wasm instructions,
however DBG_VALUE stay unchanged -- moving or cloning these.

Reviewers: dschuff

Reviewed By: dschuff

Subscribers: mattd, MatzeB, dschuff, sbc100, jgravelle-google, aheejin, sunfish, llvm-commits, aardappel

Tags: #debug-info

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

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

5 years agoRevert "[ConstHoist] Do not rebase single (or few) dependent constant"
Jessica Paquette [Tue, 25 Sep 2018 18:41:40 +0000 (18:41 +0000)]
Revert "[ConstHoist] Do not rebase single (or few) dependent constant"

This caused a couple test failures on a bot:

CodeGen/X86/constant-hoisting-bfi.ll
Transforms/ConstantHoisting/X86/ehpad.ll

Example:

http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/53575/

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

5 years ago[RegAllocGreedy] avoid using physreg candidates that cannot be correctly spilled
Daniil Fukalov [Tue, 25 Sep 2018 18:37:38 +0000 (18:37 +0000)]
[RegAllocGreedy] avoid using physreg candidates that cannot be correctly spilled

For the AMDGPU target if a MBB contains exec mask restore preamble, SplitEditor may get state when it cannot insert a spill instruction.

E.g. for a MIR

bb.100:
    %1 = S_OR_SAVEEXEC_B64 %2, implicit-def $exec, implicit-def $scc, implicit $exec
and if the regalloc will try to allocate a virtreg to the physreg already assigned to virtreg %1, it should insert spill instruction before the S_OR_SAVEEXEC_B64 instruction.
But it is not possible since can generate incorrect code in terms of exec mask.

The change makes regalloc to ignore such physreg candidates.

Reviewed By: rampitec

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

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

5 years ago[MC] Replace NULL constant in code with nullptr.
Craig Topper [Tue, 25 Sep 2018 18:33:00 +0000 (18:33 +0000)]
[MC] Replace NULL constant in code with nullptr.

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

5 years ago[globalisel][tblgen] Table optimization should consider the C++ code in C++ predicates
Daniel Sanders [Tue, 25 Sep 2018 17:59:02 +0000 (17:59 +0000)]
[globalisel][tblgen] Table optimization should consider the C++ code in C++ predicates

This fixes PR39045

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

5 years ago[ConstHoist] Do not rebase single (or few) dependent constant
Zhaoshi Zheng [Tue, 25 Sep 2018 17:45:37 +0000 (17:45 +0000)]
[ConstHoist] Do not rebase single (or few) dependent constant

If an instance (InsertionPoint or IP) of Base constant A has only one or few
rebased constants depending on it, do NOT rebase. One extra ADD instruction is
required to materialize each rebased constant, assuming A and the rebased have
the same materialization cost.

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

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

5 years agoRevert "[DebugInfo] Do not generate address info for removed debug labels."
Justin Bogner [Tue, 25 Sep 2018 17:29:30 +0000 (17:29 +0000)]
Revert "[DebugInfo] Do not generate address info for removed debug labels."

The added test is failing on macOS:

  http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/53550/

This reverts r342943.

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

5 years ago[X86] Add AVX512 support to combineVectorSizedSetCCEquality.
Craig Topper [Tue, 25 Sep 2018 16:27:12 +0000 (16:27 +0000)]
[X86] Add AVX512 support to combineVectorSizedSetCCEquality.

Reviewers: spatel, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

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

5 years ago[InstCombine] narrow binops on concatenated vectors (PR33026)
Sanjay Patel [Tue, 25 Sep 2018 15:57:37 +0000 (15:57 +0000)]
[InstCombine] narrow binops on concatenated vectors (PR33026)

The motivating case from:
https://bugs.llvm.org/show_bug.cgi?id=33026
...has no shuffles now. This kind of pattern may occur during
vectorization when targets have lumpy ISAs like SSE/AVX.

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

5 years ago[ARM] Share predecessor bookkeeping in CombineBaseUpdate. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:30:47 +0000 (15:30 +0000)]
[ARM] Share predecessor bookkeeping in CombineBaseUpdate. NFCI.

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

5 years ago[AArch64] Share search bookkeeping in combines. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:30:22 +0000 (15:30 +0000)]
[AArch64] Share search bookkeeping in combines. NFCI.

Share predecessor search bookkeeping in both perform PostLD1Combine
and performNEONPostLDSTCombine. This should be approximately a 4x and
2x performance improvement.

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

5 years ago[LegalizeDAG] Prune Predecessor check in ExpandExtractFromVectorThroughStack. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:29:57 +0000 (15:29 +0000)]
[LegalizeDAG] Prune Predecessor check in ExpandExtractFromVectorThroughStack. NFCI.

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

5 years ago[DAGCombine] Improve Predecessor check in SimplifySelectOps. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:29:30 +0000 (15:29 +0000)]
[DAGCombine] Improve Predecessor check in SimplifySelectOps. NFCI.

Reuse search space bookkeeping across multiple predecessor checks
qdone to avoid redundancy. This should cut search cost by ~4x.

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

5 years ago[DAGCombine] Share predecessor bookkeeping in CombineToPostIndexedLoadStore. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:29:04 +0000 (15:29 +0000)]
[DAGCombine] Share predecessor bookkeeping in CombineToPostIndexedLoadStore. NFCI.

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

5 years ago[llvm-exegesis] Serializes registers initial values.
Guillaume Chatelet [Tue, 25 Sep 2018 15:15:54 +0000 (15:15 +0000)]
[llvm-exegesis] Serializes registers initial values.

Summary: Adds the registers initial values to the YAML output of llvm-exegesis.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

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

5 years ago[llvm-exegesis] Fix missing document separator in YAML output.
Guillaume Chatelet [Tue, 25 Sep 2018 14:48:24 +0000 (14:48 +0000)]
[llvm-exegesis] Fix missing document separator in YAML output.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

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

5 years ago[DAGCombine] Don't fold dependent loads across SELECT_CC.
Nirav Dave [Tue, 25 Sep 2018 14:43:05 +0000 (14:43 +0000)]
[DAGCombine] Don't fold dependent loads across SELECT_CC.

DAGCombine will try to fold two loads that feed a SELECT or SELECT_CC
after the select, resulting in a select of an address and a single
load after.

If either of the loads depend on the other, this is not legal as it
could introduce cycles. However, it only checked this if the opcode
was a SELECT, and not for a SELECT_CC.

Unfortunately, the only reproducer I have for this is for our
downstream target. I've tried getting it to trigger on an upstream one
but haven't been successful.

Patch thanks to Bevin Hansson.

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

5 years ago[llvm-exegesis] Add lit tests (v2).
Clement Courbet [Tue, 25 Sep 2018 13:59:35 +0000 (13:59 +0000)]
[llvm-exegesis] Add lit tests (v2).

Summary: This revisits rL342953 by adding detection of host support.

Reviewers: gchatelet, lebedev.ri, alexshap

Subscribers: mgorny, tschuett, llvm-commits

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

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

5 years ago[llvm-exegesis] Fix broken test.
Guillaume Chatelet [Tue, 25 Sep 2018 13:18:10 +0000 (13:18 +0000)]
[llvm-exegesis] Fix broken test.

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

5 years agoRevert rL342916: [X86] Remove shift/rotate by CL memory (RMW) overrides
Simon Pilgrim [Tue, 25 Sep 2018 13:01:26 +0000 (13:01 +0000)]
Revert rL342916: [X86] Remove shift/rotate by CL memory (RMW) overrides

As suggested by Craig Topper - I'm going to look at cleaning up the RMW sequences instead.

The uops are slightly different to the register variant, so requires a +1uop tweak

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

5 years ago[llvm-exegesis][NFC] Rewrite of the YAML serialization.
Guillaume Chatelet [Tue, 25 Sep 2018 12:18:08 +0000 (12:18 +0000)]
[llvm-exegesis][NFC] Rewrite of the YAML serialization.

Summary: This is a NFC in preparation of exporting the initial registers as part of the YAML dump

Reviewers: courbet

Reviewed By: courbet

Subscribers: mgorny, tschuett, llvm-commits

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

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

5 years agoRevert r342637 "[ADT] Try again to use the same version of llvm::Optional on all...
Hans Wennborg [Tue, 25 Sep 2018 12:08:56 +0000 (12:08 +0000)]
Revert r342637 "[ADT] Try again to use the same version of llvm::Optional on all compilers"

and also revert follow-ups r342643 and r342723.

This caused Clang to be miscompiled by GCC 4.8.4 (Unbuntu 14.04's
default compiler) and break the Chromium build (see
https://crbug.com/888061).

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

5 years ago[LoopUnroll] Add check to Latch's terminator in UnrollRuntimeLoopRemainder
David Green [Tue, 25 Sep 2018 10:08:47 +0000 (10:08 +0000)]
[LoopUnroll] Add check to Latch's terminator in UnrollRuntimeLoopRemainder

In this patch, I'm adding an extra check to the Latch's terminator in llvm::UnrollRuntimeLoopRemainder,
similar to how it is already done in the llvm::UnrollLoop.

The compiler would crash if this function is called with a malformed loop.

Patch by Rodrigo Caetano Rocha!

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

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

5 years ago[AMDGPU] restore r342722 which was reverted with r342743
Sameer Sahasrabuddhe [Tue, 25 Sep 2018 09:39:21 +0000 (09:39 +0000)]
[AMDGPU] restore r342722 which was reverted with r342743

[AMDGPU] lower-switch in preISel as a workaround for legacy DA

Summary:
The default target of the switch instruction may sometimes be an
"unreachable" block, when it is guaranteed that one of the cases is
always taken. The dominator tree concludes that such a switch
instruction does not have an immediate post dominator. This confuses
divergence analysis, which is unable to propagate sync dependence to
the targets of the switch instruction.

As a workaround, the AMDGPU target now invokes lower-switch as a
preISel pass. LowerSwitch is designed to handle the unreachable
default target correctly, allowing the divergence analysis to locate
the correct immediate dominator of the now-lowered switch.

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

5 years agoRevert rL342953 "[llvm-exegesis] Add lit tests."
Clement Courbet [Tue, 25 Sep 2018 09:36:44 +0000 (09:36 +0000)]
Revert rL342953 "[llvm-exegesis] Add lit tests."

We also need to make sure that we're on the right subtarget.

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

5 years ago[llvm-exegesis] Add lit tests.
Clement Courbet [Tue, 25 Sep 2018 09:27:43 +0000 (09:27 +0000)]
[llvm-exegesis] Add lit tests.

Summary:
Right now we only have unit tests. This will allow testing the whole
tool. Even though We can't really check actual values, this will avoid
regressions such as PR39055.

Reviewers: gchatelet, alexshap

Subscribers: mgorny, tschuett, llvm-commits

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

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

5 years ago[llvm-exegesis] Add MCParser to LLVM_LINK_COMPONENTS
Heejin Ahn [Tue, 25 Sep 2018 08:25:29 +0000 (08:25 +0000)]
[llvm-exegesis] Add MCParser to LLVM_LINK_COMPONENTS

We need this to make builds with `-DBUILD_SHARED_LIBS=ON` work.

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

5 years agoAdd macro LLVM_ATTRIBUTE_REINITIALIZES
Fangrui Song [Tue, 25 Sep 2018 08:06:32 +0000 (08:06 +0000)]
Add macro LLVM_ATTRIBUTE_REINITIALIZES

Summary:
This marks legitimate use-after-move (e.g. `Found.clear()` in rC342925)
which would otherwise be caught by bugprone-use-after-move.

bugprone-use-after-move recognizes this attribute after rCTE339571.

Reviewers: aaron.ballman, rsmith, mboehme, hokein

Reviewed By: mboehme

Subscribers: kristina, llvm-commits

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

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

5 years ago[llvm-exegesis] Fix doc in r342947.
Clement Courbet [Tue, 25 Sep 2018 07:48:38 +0000 (07:48 +0000)]
[llvm-exegesis] Fix doc in r342947.

llvm-exegesis.rst was using invalid indentation for bullet points.

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

5 years ago[llvm-exegesis] Allow benchmarking arbitrary code snippets.
Clement Courbet [Tue, 25 Sep 2018 07:31:44 +0000 (07:31 +0000)]
[llvm-exegesis] Allow benchmarking arbitrary code snippets.

Summary:

This is a step towards fixing PR38048.

Note that right now the measurements are given per instruction. We'll
need to give measurements a per code snippet and update the analysis (PR38731).

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

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

5 years ago[mips] Correct MUL pattern for mips64
Stefan Maksimovic [Tue, 25 Sep 2018 06:27:49 +0000 (06:27 +0000)]
[mips] Correct MUL pattern for mips64

Guard existing pattern with a predicate, introduce a new one for revision 6.

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

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

5 years agoUse unique_ptr to hold AsmInfo,MRI,MII,STI
Fangrui Song [Tue, 25 Sep 2018 06:19:31 +0000 (06:19 +0000)]
Use unique_ptr to hold AsmInfo,MRI,MII,STI

Reviewers: pcc, dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

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

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

5 years agoUse TRI->regsOverlap() in MachineBasicBlock::computeRegisterLiveness
Mikael Holmen [Tue, 25 Sep 2018 06:10:04 +0000 (06:10 +0000)]
Use TRI->regsOverlap() in MachineBasicBlock::computeRegisterLiveness

Summary:
For the loop that used MCRegAliasIterator this should be NFC.

For the loop that previously used MCSubRegIterator we should
now detect more cases where the register is actually live out that
we previously missed.

Reviewers: MatzeB, arsenm

Reviewed By: MatzeB

Subscribers: wdng, llvm-commits

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

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

5 years ago[DebugInfo] Do not generate address info for removed debug labels.
Hsiangkai Wang [Tue, 25 Sep 2018 06:09:50 +0000 (06:09 +0000)]
[DebugInfo] Do not generate address info for removed debug labels.

In some senario, LLVM will remove llvm.dbg.labels in IR. For example,
when the labels are in unreachable blocks, these labels will not
be generated in LLVM IR. In the case, these debug labels will have
address zero as their address. It is not legal address for debugger to
set breakpoints or query sources. So, the patch inhibits the address info
(DW_AT_low_pc) of removed labels.

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

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

5 years ago[MachineCopyPropagation] Reimplement CopyTracker in terms of register units
Justin Bogner [Tue, 25 Sep 2018 05:16:44 +0000 (05:16 +0000)]
[MachineCopyPropagation] Reimplement CopyTracker in terms of register units

Change the copy tracker to keep a single map of register units instead
of 3 maps of registers. This gives a very significant compile time
performance improvement to the pass. I measured a 30-40% decrease in
time spent in MCP on x86 and AArch64 and much more significant
improvements on out of tree targets with more registers.

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

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

5 years agoRevert "[ORC] Switch to asynchronous resolution in JITSymbolResolver."
Lang Hames [Tue, 25 Sep 2018 04:54:03 +0000 (04:54 +0000)]
Revert "[ORC] Switch to asynchronous resolution in JITSymbolResolver."

This reverts commit r342939.

MSVC's promise/future implementation does not like types that are not default
constructible. Reverting while I figure out a solution.

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

5 years ago[MachineCopyPropagation] Rework how we manage RegMask clobbers
Justin Bogner [Tue, 25 Sep 2018 04:45:25 +0000 (04:45 +0000)]
[MachineCopyPropagation] Rework how we manage RegMask clobbers

Instead of updating the CopyTracker's maps each time we come across a
RegMask, defer checking for this kind of interference until we're
actually trying to propagate a copy. This avoids the need to
repeatedly iterate over maps in the cases where we don't end up doing
any work.

This is a slight compile time improvement for MachineCopyPropagation
as is, but it also enables a much bigger improvement that I'll follow
up with soon.

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

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

5 years ago[ORC] Switch to asynchronous resolution in JITSymbolResolver.
Lang Hames [Tue, 25 Sep 2018 04:43:38 +0000 (04:43 +0000)]
[ORC] Switch to asynchronous resolution in JITSymbolResolver.

Asynchronous resolution (where the caller receives a callback once the requested
set of symbols are resolved) is a core part of the new concurrent ORC APIs. This
change extends the asynchronous resolution model down to RuntimeDyld, which is
necessary to prevent deadlocks when compiling/linking on a fixed number of
threads: If RuntimeDyld's linking process were a blocking operation, then any
complete K-graph in a program will require at least K threads to link in the
worst case, as each thread would block waiting for all the others to complete.
Using callbacks instead allows the work to be passed between dependent threads
until it is complete.

For backwards compatibility, all existing RuntimeDyld functions will continue
to operate in blocking mode as before. This change will enable the introduction
of a new async finalization process in a subsequent patch to enable asynchronous
JIT linking.

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

5 years ago[WebAssembly] SIMD sqrt
Thomas Lively [Tue, 25 Sep 2018 03:39:28 +0000 (03:39 +0000)]
[WebAssembly] SIMD sqrt

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

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

5 years ago[AMDGPU] Remove useless check from test. NFC.
Stanislav Mekhanoshin [Tue, 25 Sep 2018 01:24:54 +0000 (01:24 +0000)]
[AMDGPU] Remove useless check from test. NFC.

The check for assignment of zero is practically useless
while the assignment moves around with different scheduling.

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

5 years ago[X86] Don't create FILD ISD nodes when X87 is disabled.
Craig Topper [Tue, 25 Sep 2018 00:16:57 +0000 (00:16 +0000)]
[X86] Don't create FILD ISD nodes when X87 is disabled.

The included test case previously asserted because the type legalizer tried to soften the FILD ISD node.

Fixes PR38819.

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

5 years ago[X86] Remove superfluous curly braces. NFC
Craig Topper [Tue, 25 Sep 2018 00:16:54 +0000 (00:16 +0000)]
[X86] Remove superfluous curly braces. NFC

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

5 years ago[X86] Update comment. Use 'glued' instead of 'flagged' NFC
Craig Topper [Tue, 25 Sep 2018 00:16:52 +0000 (00:16 +0000)]
[X86] Update comment. Use 'glued' instead of 'flagged' NFC

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

5 years ago[WebAssembly][NFC] Fix hardcoded stack indices in tests
Thomas Lively [Mon, 24 Sep 2018 23:42:07 +0000 (23:42 +0000)]
[WebAssembly][NFC] Fix hardcoded stack indices in tests

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

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

5 years ago[CUDA] Added basic support for compiling with CUDA-10.0
Artem Belevich [Mon, 24 Sep 2018 23:10:44 +0000 (23:10 +0000)]
[CUDA] Added basic support for compiling with CUDA-10.0

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

5 years ago[hwasan] Record and display stack history in stack-based reports.
Evgeniy Stepanov [Mon, 24 Sep 2018 23:03:34 +0000 (23:03 +0000)]
[hwasan] Record and display stack history in stack-based reports.

Summary:
Display a list of recent stack frames (not a stack trace!) when
tag-mismatch is detected on a stack address.

The implementation uses alignment tricks to get both the address of
the history buffer, and the base address of the shadow with a single
8-byte load. See the comment in hwasan_thread_list.h for more
details.

Developed in collaboration with Kostya Serebryany.

Reviewers: kcc

Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits

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

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

5 years agoRevert "[hwasan] Record and display stack history in stack-based reports."
Evgeniy Stepanov [Mon, 24 Sep 2018 22:50:32 +0000 (22:50 +0000)]
Revert "[hwasan] Record and display stack history in stack-based reports."

This reverts commit r342921: test failures on clang-cmake-arm* bots.

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

5 years ago[hwasan] Record and display stack history in stack-based reports.
Evgeniy Stepanov [Mon, 24 Sep 2018 21:38:42 +0000 (21:38 +0000)]
[hwasan] Record and display stack history in stack-based reports.

Summary:
Display a list of recent stack frames (not a stack trace!) when
tag-mismatch is detected on a stack address.

The implementation uses alignment tricks to get both the address of
the history buffer, and the base address of the shadow with a single
8-byte load. See the comment in hwasan_thread_list.h for more
details.

Developed in collaboration with Kostya Serebryany.

Reviewers: kcc

Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits

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

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

5 years agoRe-submitting changes in D51550 because it failed to patch.
Christy Lee [Mon, 24 Sep 2018 20:47:12 +0000 (20:47 +0000)]
Re-submitting changes in D51550 because it failed to patch.

Reviewers: javed.absar, trentxintong, courbet

Reviewed By: trentxintong

Subscribers: llvm-commits

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

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

5 years ago[InstCombine] add bitcast+extelt helper function; NFC
Sanjay Patel [Mon, 24 Sep 2018 20:41:22 +0000 (20:41 +0000)]
[InstCombine] add bitcast+extelt helper function; NFC

We can handle patterns where the elements have different
sizes, so refactoring ahead of trying to add another blob
within these clauses.

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

5 years ago[X86] Remove shift/rotate by CL memory (RMW) overrides
Simon Pilgrim [Mon, 24 Sep 2018 20:11:50 +0000 (20:11 +0000)]
[X86] Remove shift/rotate by CL memory (RMW) overrides

The uops are slightly different to the register variant, so requires a +1uop tweak

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

5 years ago[X86] Infer 64bit feature support from the CPUID results in getHostCPUFeatures.
Craig Topper [Mon, 24 Sep 2018 18:55:41 +0000 (18:55 +0000)]
[X86] Infer 64bit feature support from the CPUID results in getHostCPUFeatures.

After r341022, we more strictly check the 64bit feature in X86Subtargets constructor when a 64-bit triple is used. If we don't infer this feature for autodetected CPUs we might incorrectly report an error if the CPU name wasn't autodetected to a CPU that supports 64-bit.

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

5 years ago[Power9] [LLVM] Add __float128 exponent GET and SET builtins
Stefan Pintilie [Mon, 24 Sep 2018 18:14:13 +0000 (18:14 +0000)]
[Power9] [LLVM] Add __float128 exponent GET and SET builtins

Added

__builtin_vsx_scalar_extract_expq
__builtin_vsx_scalar_insert_exp_qp

Builtins should behave the same way as in GCC.

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

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

5 years ago[X86][AVX] Add truncation as shuffle test for PR31451
Simon Pilgrim [Mon, 24 Sep 2018 17:26:31 +0000 (17:26 +0000)]
[X86][AVX] Add truncation as shuffle test for PR31451

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

5 years agoReland r342494 after fixing LIT checks.
Christy Lee [Mon, 24 Sep 2018 17:26:30 +0000 (17:26 +0000)]
Reland r342494 after fixing LIT checks.

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

5 years ago[Analysis] add comment to generalize finding a scalar op from vector; NFC
Sanjay Patel [Mon, 24 Sep 2018 17:18:32 +0000 (17:18 +0000)]
[Analysis] add comment to generalize finding a scalar op from vector; NFC

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

5 years ago[InstCombine] add/move tests for extractelement; NFC
Sanjay Patel [Mon, 24 Sep 2018 17:17:16 +0000 (17:17 +0000)]
[InstCombine] add/move tests for extractelement; NFC

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

5 years ago[X86] Remove WriteDiv/WriteIDiv schedule overrides - use classes directly. NFCI.
Simon Pilgrim [Mon, 24 Sep 2018 16:58:26 +0000 (16:58 +0000)]
[X86] Remove WriteDiv/WriteIDiv schedule overrides - use classes directly. NFCI.

We're missing quite a bit of data for these instruction, removing the overrides makes this obvious - inconsistent reg/mem variants is a concern as well.

Also, we have Divider resources (HWDivider etc.) but they aren't actually used consistently.

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

5 years ago[InstCombine] improve variable name and use 'match'; NFC
Sanjay Patel [Mon, 24 Sep 2018 16:39:03 +0000 (16:39 +0000)]
[InstCombine] improve variable name and use 'match'; NFC

'width' of a vector usually refers to the bit-width.

https://bugs.llvm.org/show_bug.cgi?id=39016
shows a case where we could extend this fold to handle
a case where the number of elements in the bitcasted
vector is not equal to the resulting value.

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