platform/upstream/llvm.git
6 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.

llvm-svn: 343071

6 years ago[COFF] Don't do autoexport of symbols from GNU import libraries
Martin Storsjo [Wed, 26 Sep 2018 06:13:47 +0000 (06:13 +0000)]
[COFF] Don't do autoexport of symbols from GNU import libraries

This involves adding more generic list of symbol suffixes/prefixes
to ignore for autoexport; adding a few other entries to these lists
as well from the corresponding lists in binutils.

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

llvm-svn: 343070

6 years ago[COFF] Allow automatic dllimport from gnu import libraries
Martin Storsjo [Wed, 26 Sep 2018 06:13:39 +0000 (06:13 +0000)]
[COFF] Allow automatic dllimport from gnu import libraries

Don't assume that the IAT chunk will be a DefinedImportData, it can
just as well be a DefinedRegular for gnu import libraries.

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

llvm-svn: 343069

6 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.

llvm-svn: 343068

6 years ago[clangd] Fix crash if pending computations were active on exit
Ilya Biryukov [Wed, 26 Sep 2018 05:48:29 +0000 (05:48 +0000)]
[clangd] Fix crash if pending computations were active on exit

Summary:
Make sure JSONRPCDispatcher outlives the worker threads, they access
its fields to remove the stored cancellations when Context dies.

Reviewers: sammccall, ioeric

Reviewed By: ioeric

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 343067

6 years ago[clangd] Handle template args for disabled function arg snippets
Ilya Biryukov [Wed, 26 Sep 2018 05:45:31 +0000 (05:45 +0000)]
[clangd] Handle template args for disabled function arg snippets

Reviewers: kadircet, ioeric, sammccall

Reviewed By: kadircet

Subscribers: MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 343066

6 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.

llvm-svn: 343065

6 years agoP0859R0: List-initialization is potentially-constant-evaluated and
Richard Smith [Wed, 26 Sep 2018 04:36:55 +0000 (04:36 +0000)]
P0859R0: List-initialization is potentially-constant-evaluated and
triggers instantiation of constexpr functions.

We mostly implemented this since Clang 6, but missed the template
instantiation case.

We do not implement the '&cast-expression' special case. It appears to
be a mistake / oversight. I've mailed CWG to see if we can remove it.

llvm-svn: 343064

6 years ago[OPENMP] Add support for OMP5 requires directive + unified_address clause
Kelvin Li [Wed, 26 Sep 2018 04:28:39 +0000 (04:28 +0000)]
[OPENMP] Add support for OMP5 requires directive + unified_address clause

Add support for OMP5.0 requires directive and unified_address clause.
Patches to follow will include support for additional clauses.

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

llvm-svn: 343063

6 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

llvm-svn: 343062

6 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.

llvm-svn: 343061

6 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.

llvm-svn: 343060

6 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.

llvm-svn: 343059

6 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.

llvm-svn: 343058

6 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.

llvm-svn: 343057

6 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.

llvm-svn: 343056

6 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).

llvm-svn: 343055

6 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

llvm-svn: 343054

6 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

llvm-svn: 343053

6 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

llvm-svn: 343052

6 years ago[analyzer] Fix a crash on casting symbolic pointers to derived classes.
Artem Dergachev [Wed, 26 Sep 2018 00:17:14 +0000 (00:17 +0000)]
[analyzer] Fix a crash on casting symbolic pointers to derived classes.

Commit r340984 causes a crash when a pointer to a completely unrelated type
UnrelatedT (eg., opaque struct pattern) is being casted from base class BaseT to
derived class DerivedT, which results in an ill-formed region
Derived{SymRegion{$<UnrelatedT x>}, DerivedT}.

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

llvm-svn: 343051

6 years agoFix a bot failure from r343042.
Erik Pilkington [Tue, 25 Sep 2018 23:52:29 +0000 (23:52 +0000)]
Fix a bot failure from r343042.

llvm-svn: 343050

6 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.

llvm-svn: 343049

6 years ago[analyzer] Add a testing facility for testing relationships between symbols.
Artem Dergachev [Tue, 25 Sep 2018 23:50:53 +0000 (23:50 +0000)]
[analyzer] Add a testing facility for testing relationships between symbols.

Tests introduced in r329780 was disabled in r342317 because these tests
were accidentally testing dump infrastructure, when all they cared about was
how symbols relate to each other. So when dump infrastructure changed,
tests became annoying to maintain.

Add a new feature to ExprInspection: clang_analyzer_denote() and
clang_analyzer_explain(). The former adds a notation to a symbol, the latter
expresses another symbol in terms of previously denoted symbols.

It's currently a bit wonky - doesn't print parentheses and only supports
denoting atomic symbols. But it's even more readable that way.

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

llvm-svn: 343048

6 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

llvm-svn: 343047

6 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.

llvm-svn: 343046

6 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.

llvm-svn: 343045

6 years ago[clang-check-codegen][cfstring] Accept either @ or % for progbits to make ppc64be...
Kristina Brooks [Tue, 25 Sep 2018 23:17:09 +0000 (23:17 +0000)]
[clang-check-codegen][cfstring] Accept either @ or % for progbits to make ppc64be bots happy.

PPC64BE bots use % instead of @ for directives like progbits. Since CFString tests also
check asm output, they fail on the following:

  cfstring3.c:44:19: error: CHECK-ASM-ELF: expected string not found in input
  // CHECK-ASM-ELF: .section cfstring,"aw",@progbits
  <stdin>:30:2: note: possible intended match here
  .section cfstring,"aw",%progbits

Updating that check with a {{[@%]}}progbits regex to make those bots happy.

llvm-svn: 343044

6 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.

llvm-svn: 343043

6 years ago[Sema] Use a more civilized hash map to implement -Wduplicate-enum.
Erik Pilkington [Tue, 25 Sep 2018 22:53:06 +0000 (22:53 +0000)]
[Sema] Use a more civilized hash map to implement -Wduplicate-enum.

DenseMap<long, SOMETHING> used LONG_MAX as a tombstone, so it asserts
when you try to insert it!

rdar://44774672

llvm-svn: 343042

6 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.

llvm-svn: 343041

6 years agoDon't emit "will be treated as an identifier character" warning for
Richard Smith [Tue, 25 Sep 2018 22:34:45 +0000 (22:34 +0000)]
Don't emit "will be treated as an identifier character" warning for
UTF-8 characters that aren't identifier characters in the current
language mode.

llvm-svn: 343040

6 years ago[clangd] Remove unused using-declaration testing::AllOf
Fangrui Song [Tue, 25 Sep 2018 22:32:11 +0000 (22:32 +0000)]
[clangd] Remove unused using-declaration testing::AllOf

llvm-svn: 343039

6 years agoReland "[Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with `-fconstant-cfstrings`"
Kristina Brooks [Tue, 25 Sep 2018 22:27:40 +0000 (22:27 +0000)]
Reland "[Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with `-fconstant-cfstrings`"

Relanding rL342883 with more fragmented tests to test ELF-specific
section emission separately from broad-scope CFString tests. Now this
tests the following separately

1). CoreFoundation builds and linkage for ELF while building it.
2). CFString ELF section emission outside CF in assembly output.
3). Broad scope `cfstring3.c` tests which cover all object formats at
    bitcode level and assembly level (including ELF).

This fixes non-bridged CoreFoundation builds on ELF targets
that use -fconstant-cfstrings. The original changes from differential
for a similar patch to PE/COFF (https://reviews.llvm.org/D44491) did not
check for an edge case where the global could be a constant which surfaced
as an issue when building for ELF because of different linkage semantics.

This patch addresses several issues with crashes related to CF builds on ELF
as well as improves data layout by ensuring string literals that back
the actual CFConstStrings end up in .rodata in line with Mach-O.

Change itself tested with CoreFoundation on Linux x86_64 but should be valid
for BSD-like systems as well that use ELF as the native object format.

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

llvm-svn: 343038

6 years ago[analyzer] NFC: CallDescription: Improve array management.
Artem Dergachev [Tue, 25 Sep 2018 22:13:31 +0000 (22:13 +0000)]
[analyzer] NFC: CallDescription: Improve array management.

Combine the two constructor overrides into a single ArrayRef constructor
to allow easier brace initializations and simplify how the respective field
is used internally.

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

llvm-svn: 343037

6 years agoP0969R0: allow structured binding of accessible members, not only public members.
Richard Smith [Tue, 25 Sep 2018 22:12:44 +0000 (22:12 +0000)]
P0969R0: allow structured binding of accessible members, not only public members.

llvm-svn: 343036

6 years ago[analyzer] NFC: Legalize state manager factory injection.
Artem Dergachev [Tue, 25 Sep 2018 22:10:12 +0000 (22:10 +0000)]
[analyzer] NFC: Legalize state manager factory injection.

When a checker maintains a program state trait that isn't a simple list/set/map, but is a combination of multiple lists/sets/maps (eg., a multimap - which may be implemented as a map from something to set of something), ProgramStateManager only contains the factory for the trait itself. All auxiliary lists/sets/maps need a factory to be provided by the checker, which is annoying.

So far two checkers wanted a multimap, and both decided to trick the
ProgramStateManager into keeping the auxiliary factory within itself
by pretending that it's some sort of trait they're interested in,
but then never using this trait but only using the factory.

Make this trick legal. Define a convenient macro.

One thing that becomes apparent once all pieces are put together is that
these two checkers are in fact using the same factory, because the type that
identifies it, ImmutableMap<const MemRegion *, ImmutableSet<SymbolRef>>,
is the same. This situation is different from two checkers registering similar
primitive traits.

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

llvm-svn: 343035

6 years ago[WebAssembly] Add --export-default/--no-export-default options
Sam Clegg [Tue, 25 Sep 2018 21:50:15 +0000 (21:50 +0000)]
[WebAssembly] Add --export-default/--no-export-default options

These option control weather or not symbols marked as visibility
default are exported in the output binary.

By default this is true, but emscripten prefers to control the
exported symbol list explicitly at link time and ignore the
symbol attributes.

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

llvm-svn: 343034

6 years ago[lldb-mi] Fix bugs in target-select-so-path.test
Alexander Polyakov [Tue, 25 Sep 2018 21:49:33 +0000 (21:49 +0000)]
[lldb-mi] Fix bugs in target-select-so-path.test

Summary:
* This patch fixes hanging of the test in case of using python3, changes callback
  function that will be called if the timer ends, changes python interpreter to
  `%python` that is set up by llvm-lit.
* Also, the test didn't work properly since it didn't contain a call of
  filecheck_proc.communicate(), that means that filecheck didn't run and its
  return code was equal to 0 in all cases.

Reviewers: teemperor, labath, tatyana-krasnukha, aprantl

Reviewed By: teemperor, labath

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 343033

6 years agoUpdate a --help message and add -execute-only to the man page.
Rui Ueyama [Tue, 25 Sep 2018 21:39:08 +0000 (21:39 +0000)]
Update a --help message and add -execute-only to the man page.

llvm-svn: 343032

6 years agoTry to fix cosmetics to keep lines below 80 chars. NFC.
Martin Storsjo [Tue, 25 Sep 2018 21:27:07 +0000 (21:27 +0000)]
Try to fix cosmetics to keep lines below 80 chars. NFC.

This should fix following buildbot errors:
http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/20371

llvm-svn: 343031

6 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

llvm-svn: 343030

6 years agoChange the unwinder to not use a hard-coded limit on the
Jason Molenda [Tue, 25 Sep 2018 21:01:54 +0000 (21:01 +0000)]
Change the unwinder to not use a hard-coded limit on the
max number of stack frames to backtrace, make it a setting,
target.process.thread.max-backtrace-depth.
Add a test case for the setting.

<rdar://problem/28759559>

llvm-svn: 343029

6 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

llvm-svn: 343028

6 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

llvm-svn: 343027

6 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)

llvm-svn: 343026

6 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.

llvm-svn: 343025

6 years agoDe-template VersionDefinitionSection. NFC.
Rui Ueyama [Tue, 25 Sep 2018 20:37:51 +0000 (20:37 +0000)]
De-template VersionDefinitionSection. NFC.

When we write a struct to a mmap'ed buffer, we usually use
write16/32/64, but we didn't for VersionDefinitionSection, so
we needed to template that class.

llvm-svn: 343024

6 years ago[lldbinline] Set directory attribute on test-specific classes
Vedant Kumar [Tue, 25 Sep 2018 20:20:13 +0000 (20:20 +0000)]
[lldbinline] Set directory attribute on test-specific classes

Set the "mydir" attribute of an inline test on the test-specific class,
instead of on the base InlineTest class.

This makes it possible to run dotest.py on a directory containing inline
tests. This wasn't really possible prior to this patch, because what
would happen is that one test would just run over and over again, even
though the test infrastructure would claim that different tests were
being run.

Example:

The test infrastructure claimed that all of these different tests were passing,
which couldn't be true --

$ ./bin/lldb-dotest /Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ -G dwarf -t 2>&1 | grep PASS
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateTailCallSeq)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestArtificialFrameStepOutMessage)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq1)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguatePathsToCommonSink)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateCallSite)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestUnambiguousTailCalls)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq2)
RESULT: PASSED (7 passes, 0 failures, 0 errors, 24 skipped, 0 expected failures, 0 unexpected successes)

... because it wasn't even looking at some of these tests:

$ ./bin/lldb-dotest /Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ -G dwarf -t 2>&1 | grep "Change dir"
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2

E.g it was only building one of them:

$ ls lldb-test-build.noindex/functionalities/tail_call_frames/                        
ambiguous_tail_call_seq2

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

llvm-svn: 343023

6 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.

llvm-svn: 343022

6 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

llvm-svn: 343021

6 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

llvm-svn: 343020

6 years ago[clangd] Extract mapper logic from clangd-indexer into a library.
Sam McCall [Tue, 25 Sep 2018 20:02:36 +0000 (20:02 +0000)]
[clangd] Extract mapper logic from clangd-indexer into a library.

Summary: Soon we can drop support for MR-via-YAML.
I need to modify some out-of-tree versions to use the library, first.

Reviewers: kadircet

Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 343019

6 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

llvm-svn: 343018

6 years ago[clangd] Fix reversed RIFF/YAML serialization
Sam McCall [Tue, 25 Sep 2018 19:53:33 +0000 (19:53 +0000)]
[clangd] Fix reversed RIFF/YAML serialization

llvm-svn: 343017

6 years agoXFAIL some tests in TestTargetCreateDeps on linux
Pavel Labath [Tue, 25 Sep 2018 19:52:04 +0000 (19:52 +0000)]
XFAIL some tests in TestTargetCreateDeps on linux

On linux, we do not support automatic loading of dependent modules, so
the module list will always contain just one module (until the target is
launched).

llvm-svn: 343016

6 years ago[Sanitizers] [MinGW] Produce undecorated symbols for /export: directives when in...
Martin Storsjo [Tue, 25 Sep 2018 19:50:39 +0000 (19:50 +0000)]
[Sanitizers] [MinGW] Produce undecorated symbols for /export: directives when in MinGW mode

In MinGW mode, the /export: directives in object files are interpreted
differently; the symbols are not assumed to be decorated.

Since the GNU linker doesn't support the /alternatename and /include
directives, there's no such distinction for them in lld. This assumes
that the resulting sanitizer libraries will be linked by lld.

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

llvm-svn: 343015

6 years ago[ASan] [Windows] Avoid including windows.h in asan_malloc_win.cc
Martin Storsjo [Tue, 25 Sep 2018 19:50:36 +0000 (19:50 +0000)]
[ASan] [Windows] Avoid including windows.h in asan_malloc_win.cc

Instead provide manual declarations of the used types, to avoid
pulling in conflicting declarations of some of the functions that
are to be overridden.

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

llvm-svn: 343014

6 years ago[Sanitizers] [MinGW] Check for __i386__ in addition to _M_IX86 for i386 specific...
Martin Storsjo [Tue, 25 Sep 2018 19:50:32 +0000 (19:50 +0000)]
[Sanitizers] [MinGW] Check for __i386__ in addition to _M_IX86 for i386 specific details

The MinGW headers do define _M_IX86 (contrary to clang-cl and
MSVC where it is a compiler predefined macro), but the headers that
define it aren't included here.

Also check these defines for setting the symbol prefix, instead of
inconsistently using _WIN64 for that.

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

llvm-svn: 343013

6 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.

llvm-svn: 343012

6 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.

llvm-svn: 343011

6 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

llvm-svn: 343010

6 years agoReset input section pointers to null on each linker invocation.
Rui Ueyama [Tue, 25 Sep 2018 19:26:58 +0000 (19:26 +0000)]
Reset input section pointers to null on each linker invocation.

Previously, if you invoke lld's `main` more than once in the same process,
the second invocation could fail or produce a wrong result due to a stale
pointer values of the previous run.

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

llvm-svn: 343009

6 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

llvm-svn: 343008

6 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

llvm-svn: 343007

6 years ago[OpenMP][libomptarget] Set the frame pointer then test empty slot condition
Gheorghe-Teodor Bercea [Tue, 25 Sep 2018 18:48:14 +0000 (18:48 +0000)]
[OpenMP][libomptarget] Set the frame pointer then test empty slot condition

Summary: NFC - just fixing a bug: the empty slot test was before the re-setting of the Stack pointer.

Reviewers: ABataev, caomhin, Hahnfeld

Reviewed By: ABataev

Subscribers: guansong, openmp-commits

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

llvm-svn: 343006

6 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/

llvm-svn: 343005

6 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

llvm-svn: 343004

6 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.

llvm-svn: 343003

6 years agoRevert "[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file
Alexey Bataev [Tue, 25 Sep 2018 18:31:56 +0000 (18:31 +0000)]
Revert "[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file
types."

It reverts commit r342991 + several other commits intended to fix the
tests. Still have some failed tests, need to investigate it.

llvm-svn: 343002

6 years ago[clang-tidy] use CHECK-NOTES in tests for bugprone-macro-repeated-side-effects
Jonas Toth [Tue, 25 Sep 2018 18:15:52 +0000 (18:15 +0000)]
[clang-tidy] use CHECK-NOTES in tests for bugprone-macro-repeated-side-effects

Reviewers: alexfh, aaron.ballman, hokein

Reviewed By: alexfh

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 343001

6 years ago[clang-tidy] Add modernize-concat-nested-namespaces check
Jonas Toth [Tue, 25 Sep 2018 18:12:28 +0000 (18:12 +0000)]
[clang-tidy] Add modernize-concat-nested-namespaces check

Summary:
Finds instances of namespaces concatenated using explicit syntax, such as `namespace a { namespace b { [...] }}` and offers fix to glue it to `namespace a::b { [...] }`.

Properly handles `inline` and unnamed namespaces. ~~Also, detects empty blocks in nested namespaces and offers to remove them.~~

Test with common use cases included.
I ran the check against entire llvm repository. Except for expected `nested namespace definitions only available with -std=c++17 or -std=gnu++17` warnings I noticed no issues when the check was performed.

Example:
```
namespace a { namespace b {
void test();
}}

```
can become
```
namespace a::b {
void test();
}
```

Patch by wgml!

Reviewers: alexfh, aaron.ballman, hokein

Reviewed By: aaron.ballman

Subscribers: JonasToth, Eugene.Zelenko, lebedev.ri, mgorny, xazax.hun, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 343000

6 years ago[clangd] Merge binary + YAML serialization behind a (mostly) common interface.
Sam McCall [Tue, 25 Sep 2018 18:06:43 +0000 (18:06 +0000)]
[clangd] Merge binary + YAML serialization behind a (mostly) common interface.

Summary:
Interface is in one file, implementation in two as they have little in common.
A couple of ad-hoc YAML functions left exposed:
 - symbol -> YAML I expect to keep for tools like dexp
 - YAML -> symbol is used for the MR-style indexer, I think we can eliminate
   this (merge-on-the-fly, else use a different serialization)

Reviewers: kbobyrev

Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 342999

6 years agoReplace boolean parameter with enum value according r342633
Tatyana Krasnukha [Tue, 25 Sep 2018 17:59:44 +0000 (17:59 +0000)]
Replace boolean parameter with enum value according r342633

llvm-svn: 342998

6 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

llvm-svn: 342997

6 years ago[OPENMP] Fix the test, NFC.
Alexey Bataev [Tue, 25 Sep 2018 17:58:08 +0000 (17:58 +0000)]
[OPENMP] Fix the test, NFC.

Fixed test to pacify buildbot.

llvm-svn: 342996

6 years ago[OPENMP] Fix failed test, NFC.
Alexey Bataev [Tue, 25 Sep 2018 17:47:53 +0000 (17:47 +0000)]
[OPENMP] Fix failed test, NFC.

llvm-svn: 342995

6 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

llvm-svn: 342994

6 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.

llvm-svn: 342993

6 years agoFix an error message. It must start with a lowercase letter.
Rui Ueyama [Tue, 25 Sep 2018 17:12:50 +0000 (17:12 +0000)]
Fix an error message. It must start with a lowercase letter.

llvm-svn: 342992

6 years ago[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.
Alexey Bataev [Tue, 25 Sep 2018 17:09:17 +0000 (17:09 +0000)]
[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.

clang-offload-bundler should not be invoked with the unbundling action
when the input file type does not match the action type. For example,
.so files should be unbundled during linking phase and should be linked
only with the host code.

llvm-svn: 342991

6 years ago[AArch64] Support adding X[8-15,18] registers as CSRs.
Tri Vo [Tue, 25 Sep 2018 16:48:40 +0000 (16:48 +0000)]
[AArch64] Support adding X[8-15,18] registers as CSRs.

Summary:
Making X[8-15,18] registers call-saved is used to support
CONFIG_ARM64_LSE_ATOMICS in Linux kernel.

Signed-off-by: Tri Vo <trong@android.com>
Reviewers: srhines, nickdesaulniers, javed.absar

Reviewed By: nickdesaulniers

Subscribers: kristof.beyls, jfb, cfe-commits

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

llvm-svn: 342990

6 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

llvm-svn: 342989

6 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.

llvm-svn: 342988

6 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.

llvm-svn: 342987

6 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.

llvm-svn: 342986

6 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.

llvm-svn: 342985

6 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.

llvm-svn: 342984

6 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.

llvm-svn: 342983

6 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

llvm-svn: 342982

6 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

llvm-svn: 342981

6 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.

llvm-svn: 342980

6 years agoParallelize .gdb_index string table writes.
Rui Ueyama [Tue, 25 Sep 2018 14:34:56 +0000 (14:34 +0000)]
Parallelize .gdb_index string table writes.

When we are creating a large .gdb_index, this change makes a difference.

llvm-svn: 342978

6 years ago[clang-cl] Provide separate flags for all the /O variants
Hans Wennborg [Tue, 25 Sep 2018 14:10:26 +0000 (14:10 +0000)]
[clang-cl] Provide separate flags for all the /O variants

This provides better help text in "clang-cl /?".

Also it cleans things up a bit: previously "/Od" could be handled either
as a separate flag aliased to "-O0", or by the main optimization flag
processing in TranslateOptArg. With this patch, all the flags get
aliased back to /O so they're handled by TranslateOptArg.

Thanks to Nico for the idea!

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

llvm-svn: 342977

6 years ago[VFS] Add a proxy FS that delegates calls to underlying FS by default.
Eric Liu [Tue, 25 Sep 2018 14:02:01 +0000 (14:02 +0000)]
[VFS] Add a proxy FS that delegates calls to underlying FS by default.

Summary:
This is useful when derived file systems want to override some calls
and still proxy other calls.

Reviewers: ilya-biryukov, sammccall

Subscribers: cfe-commits

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

llvm-svn: 342976

6 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

llvm-svn: 342975

6 years ago[clangd] NFC: Simplify code, enforce LLVM Coding Standards
Kirill Bobyrev [Tue, 25 Sep 2018 13:58:48 +0000 (13:58 +0000)]
[clangd] NFC: Simplify code, enforce LLVM Coding Standards

For consistency, functional-style code pieces are replaced with their
simple counterparts to improve readability.

Also, file headers are fixed to comply with LLVM Coding Standards.

`static` member of anonymous namespace is not marked `static` anymore,
because it is redundant.

Reviewed By: sammccall

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

llvm-svn: 342974

6 years ago[AST] Squeeze some bits in LinkageComputer::QueryType
Bruno Ricci [Tue, 25 Sep 2018 13:43:25 +0000 (13:43 +0000)]
[AST] Squeeze some bits in LinkageComputer::QueryType

Replace the pair std::pair<const NamedDecl *, unsigned> where the
unsigned represents an LVComputationKind by a PointerIntPair.
This saves a pointer per entry in the map LinkageComputer::CachedLinkageInfo.

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

Reviewed by: rjmccall, george.burgess.iv, erichkeane

llvm-svn: 342973

6 years ago[OpenMP][libomptarget] Simplify warp master selection for data sharing
Gheorghe-Teodor Bercea [Tue, 25 Sep 2018 13:23:32 +0000 (13:23 +0000)]
[OpenMP][libomptarget] Simplify warp master selection for data sharing

Summary:
There is currently no supported situation where the warp master is not the first thread in the warp.

This also avoids the device execution from hanging on Volta GPUs when ballot_sync is called by a number of threads that is less that the size of a warp.

Reviewers: ABataev, caomhin, grokos

Reviewed By: grokos

Subscribers: guansong, openmp-commits

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

llvm-svn: 342972

6 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.

llvm-svn: 342971