platform/upstream/llvm.git
5 years ago[OpenMP] Fix performance issue from 376.kdtree
Jonathan Peyton [Wed, 26 Sep 2018 20:24:39 +0000 (20:24 +0000)]
[OpenMP] Fix performance issue from 376.kdtree

This change improves the performance of 376.kdtree by giving the compiler an
opportunity to do inlining and other optimizations for the call path,
__kmpc_omp_task_complete_if0()->__kmp_task_finish(), which is one of the hot
paths in the program; some functions in kmp_taskdeps.cpp were moved to the new
header file, kmp_taskdeps.h to achieve this.

Patch by Hansang Bae

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

llvm-svn: 343138

5 years ago[OpenMP][OMPT] A few improvements
Jonathan Peyton [Wed, 26 Sep 2018 20:19:44 +0000 (20:19 +0000)]
[OpenMP][OMPT] A few improvements

This change includes miscellaneous improvements as follows:
1) Added ompt_get_proc_id() implementation for Windows
2) Added parser and print tool for omp-tool-var, just in case it needs
   to be printed (OMP_DISPLAY_ENV)
3) omp_control_tool is exported on Windows

Patch by Hansang Bae

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

llvm-svn: 343137

5 years ago[asan] [windows] Don't use CheckFailed in dynamic runtime thunk mode
Martin Storsjo [Wed, 26 Sep 2018 19:49:35 +0000 (19:49 +0000)]
[asan] [windows] Don't use CheckFailed in dynamic runtime thunk mode

Since SVN r342651, CheckFailed isn't exported from asan-dynamic. See
comments in https://reviews.llvm.org/D52279#1246222 for a longer
discussion on this issue.

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

llvm-svn: 343136

5 years ago[ELF][test] Use llvm-readelf's short option -r instead of -relocations and remove...
Fangrui Song [Wed, 26 Sep 2018 19:48:07 +0000 (19:48 +0000)]
[ELF][test] Use llvm-readelf's short option -r instead of -relocations and remove ignored --wide

Reviewers: ruiu, sfertile, espindola

Reviewed By: ruiu

Subscribers: jsji, emaste, nemanjai, arichardson, kbarton, llvm-commits

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

llvm-svn: 343135

5 years agoFix OSX build after r343130
Tatyana Krasnukha [Wed, 26 Sep 2018 19:41:57 +0000 (19:41 +0000)]
Fix OSX build after r343130

llvm-svn: 343134

5 years agoRevert r343129 "[ORC] Change the field order of ThreadSafeModule to ensure the "
Lang Hames [Wed, 26 Sep 2018 19:36:30 +0000 (19:36 +0000)]
Revert r343129 "[ORC] Change the field order of ThreadSafeModule to ensure the "

It broke several bots.

llvm-svn: 343133

5 years ago[LoopInterchange] Preserve LCSSA.
Florian Hahn [Wed, 26 Sep 2018 19:34:25 +0000 (19:34 +0000)]
[LoopInterchange] Preserve LCSSA.

This patch extends LoopInterchange to move LCSSA to the right place
after interchanging. This is required for LoopInterchange to become a
function pass.

An alternative to the manual moving of the PHIs, we could also re-form
the LCSSA phis for a set of interchanged loops, but that's more
expensive.

Reviewers: efriedma, mcrosier, davide

Reviewed By: efriedma

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

llvm-svn: 343132

5 years agoP1008R1 Classes with user-declared constructors are never aggregates in
Richard Smith [Wed, 26 Sep 2018 19:00:16 +0000 (19:00 +0000)]
P1008R1 Classes with user-declared constructors are never aggregates in
C++20.

llvm-svn: 343131

5 years agoReplace "nullptr-terminated" C-arrays of OptionValueEnumeration with safer llvm:...
Tatyana Krasnukha [Wed, 26 Sep 2018 18:50:19 +0000 (18:50 +0000)]
Replace "nullptr-terminated" C-arrays of OptionValueEnumeration with safer llvm::ArrayRef

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

llvm-svn: 343130

5 years ago[ORC] Change the field order of ThreadSafeModule to ensure the Module is
Lang Hames [Wed, 26 Sep 2018 18:50:01 +0000 (18:50 +0000)]
[ORC] Change the field order of ThreadSafeModule to ensure the Module is
destroyed before its ThreadSharedContext.

Destroying the context first is an error if this ThreadSafeModule is the only
owner of its underlying context.

Add a unit test for ThreadSafeModule/ThreadSafeContext to catch this and other
basic usage issues.

llvm-svn: 343129

5 years ago[InstCombine] add tests for vector insert/extract; NFC
Sanjay Patel [Wed, 26 Sep 2018 17:57:38 +0000 (17:57 +0000)]
[InstCombine] add tests for vector insert/extract; NFC

Preliminary step for D52439.

llvm-svn: 343128

5 years ago[X86] Update tzcnt fast-isel tests to match clang r343126.
Craig Topper [Wed, 26 Sep 2018 17:19:28 +0000 (17:19 +0000)]
[X86] Update tzcnt fast-isel tests to match clang r343126.

We now generate cttz with the zero_undef flag set to false. This allows -O0 to avoid the zero check.

llvm-svn: 343127

5 years ago[X86] For lzcnt/tzcnt intrinsics use cttz/ctlz intrinsics with zero_undef flag set...
Craig Topper [Wed, 26 Sep 2018 17:01:44 +0000 (17:01 +0000)]
[X86] For lzcnt/tzcnt intrinsics use cttz/ctlz intrinsics with zero_undef flag set to false.

Previously we used a select and the zero_undef=true intrinsic. In -O2 this pattern will get optimized to zero_undef=false. But in -O0 this optimization won't happen. This results in a compare and cmov being wrapped around a tzcnt/lzcnt instruction.

By using the zero_undef=false intrinsic directly without the select, we can improve the -O0 codegen to just an lzcnt/tzcnt instruction.

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

llvm-svn: 343126

5 years agoAMDGPU/SI: Change predicate to isCIOnly for 32-bit imm s_buffer_load* patterns
Tom Stellard [Wed, 26 Sep 2018 16:53:36 +0000 (16:53 +0000)]
AMDGPU/SI: Change predicate to isCIOnly for 32-bit imm s_buffer_load* patterns

Summary:
This is essentially NFC, because the complex pattern used for these patterns
will fail on non-CI, but this makes the pattern consistent with other CI
smrd patterns.  It is also a performance improvement, because the pattern
will now fail earlier on non-CI.

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 343125

5 years ago[libLTO] Expose LLVMCreateDisasmCPUFeatures from libLTO
Steven Wu [Wed, 26 Sep 2018 16:47:35 +0000 (16:47 +0000)]
[libLTO] Expose LLVMCreateDisasmCPUFeatures from libLTO

The export file of libLTO should has all the interfaces declared in
llvm-c/lto.h and llvm-c/Disassembler.h but LLVMCreateDisasmCPUFeatures
is missing from the list. Export the C API to be consistant.

llvm-svn: 343124

5 years ago[winasan] Pin the ASan DLL to prevent unloading
David Major [Wed, 26 Sep 2018 16:28:39 +0000 (16:28 +0000)]
[winasan] Pin the ASan DLL to prevent unloading

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

llvm-svn: 343123

5 years agoReapply r343058 with a fix for -DLLVM_ENABLE_THREADS=OFF.
Lang Hames [Wed, 26 Sep 2018 16:26:59 +0000 (16:26 +0000)]
Reapply r343058 with a fix for -DLLVM_ENABLE_THREADS=OFF.

Modifies lit to add a 'thread_support' feature that can be used in lit test
REQUIRES clauses. The thread_support flag is set if -DLLVM_ENABLE_THREADS=ON
and unset if -DLLVM_ENABLE_THREADS=OFF. The lit flag is used to disable the
multiple-compile-threads-basic.ll testcase when threading is disabled.

llvm-svn: 343122

5 years ago[DAG] SelectionDAGLegalize::ExpandLegalINT_TO_FP - use getFPExtendOrRound helper...
Simon Pilgrim [Wed, 26 Sep 2018 16:24:07 +0000 (16:24 +0000)]
[DAG] SelectionDAGLegalize::ExpandLegalINT_TO_FP - use getFPExtendOrRound helper. NFCI.

Handles SrcVT == DstVT as well.

llvm-svn: 343121

5 years ago[AArch64] Extend single-operand FP insns to match Arm ARM (NFCI)
Oliver Stannard [Wed, 26 Sep 2018 15:42:47 +0000 (15:42 +0000)]
[AArch64] Extend single-operand FP insns to match Arm ARM (NFCI)

The Armv8.3-A reference manual defines floating-point data-processing
instructions with one source operand to have an opcode of 6 bits
[20:15]. The current class in tablegen, BaseSingleOperandFPData, only
allows [18:15]. This was ok because [20:19] could only be '00', with
other encodings unallocated. Armv8.5-A brings in the FRINT group of
instructions which use other values for these bits.

This patch refactors the existing class a bit to allow using the full 6
bits of the opcode, as defined in the Arm ARM.

Patch by Pablo Barrio!

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

llvm-svn: 343120

5 years ago[doc] Fix HowToManuallyUseTheIndividualPiecesOfPolly
Michael Kruse [Wed, 26 Sep 2018 15:22:39 +0000 (15:22 +0000)]
[doc] Fix HowToManuallyUseTheIndividualPiecesOfPolly

Also remove compiled binaries.

llvm-svn: 343119

5 years agoMove www/experiments to docs/experiments
Michael Kruse [Wed, 26 Sep 2018 15:21:43 +0000 (15:21 +0000)]
Move www/experiments to docs/experiments

llvm-svn: 343118

5 years ago[clangd] Fix bugs with incorrect memory estimate report
Kirill Bobyrev [Wed, 26 Sep 2018 15:06:23 +0000 (15:06 +0000)]
[clangd] Fix bugs with incorrect memory estimate report

* With the current implementation, `sizeof(std::vector<Chunk>)` is added
twice to the `Dex` memory estimate which is incorrect
* `Dex` logs memory usage estimation before `BackingDataSize` is set and
hence the log report excludes size of the external `SymbolSlab` which is
coupled with `Dex` instance

Reviewed By: ioeric

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

llvm-svn: 343117

5 years ago[docs] Update PostingList string representation format
Kirill Bobyrev [Wed, 26 Sep 2018 14:59:49 +0000 (14:59 +0000)]
[docs] Update PostingList string representation format

Because `PostingList` objects are compressed, it is now impossible to
see elements other than the current one and the documentation doesn't
match implementation anymore.

Reviewed By: ioeric

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

llvm-svn: 343116

5 years agolit: Make sure the builtin_commands directory is packaged by setup.py
Tom Stellard [Wed, 26 Sep 2018 14:56:11 +0000 (14:56 +0000)]
lit: Make sure the builtin_commands directory is packaged by setup.py

Summary: This directory was missing from the lit package on pypi.org.

Reviewers: ddunbar

Subscribers: delcypher, llvm-commits

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

llvm-svn: 343115

5 years agoRevert r343112 as CallFrameString API change has broken lldb builds
Luke Cheeseman [Wed, 26 Sep 2018 14:48:03 +0000 (14:48 +0000)]
Revert r343112 as CallFrameString API change has broken lldb builds

llvm-svn: 343114

5 years ago[AArch64] Refactor instructions that write PSTATE (NFCI)
Oliver Stannard [Wed, 26 Sep 2018 14:42:59 +0000 (14:42 +0000)]
[AArch64] Refactor instructions that write PSTATE (NFCI)

Reuse some code in preparation for the v8.5A XAFlag/AXFlag instructions,
which shares part of the encoding of the MSR-immediate.

Patch by Pablo Barrio!

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

llvm-svn: 343113

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

- Reapply r343089 with a fix for DebugInfo/Sparc/gnu-window-save.ll

llvm-svn: 343112

5 years ago[ARM/AArch64][v8.5A] Add Armv8.5-A target
Oliver Stannard [Wed, 26 Sep 2018 14:20:29 +0000 (14:20 +0000)]
[ARM/AArch64][v8.5A] Add Armv8.5-A target

This patch allows targetting Armv8.5-A from Clang. Most of the
implementation is in TargetParser, so this is mostly just adding tests.

Patch by Pablo Barrio!

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

llvm-svn: 343111

5 years ago[llvm-exgesis][NFC] Do not pollute buildbots with messages when
Clement Courbet [Wed, 26 Sep 2018 13:58:26 +0000 (13:58 +0000)]
[llvm-exgesis][NFC] Do not pollute buildbots with messages when
the exegesis lit tests cannot run.

llvm-svn: 343110

5 years ago[AArch64][AsmParser] Show name of missing feature for system instructions
Oliver Stannard [Wed, 26 Sep 2018 13:52:27 +0000 (13:52 +0000)]
[AArch64][AsmParser] Show name of missing feature for system instructions

Parsing of the system instructions (IC, DC, AT and TLBI) uses this
function to show the required architecture when the operand is valid,
but the architecture is not enabled. Armv8.5A adds a few different
system instructions as part of optional features, so we need to extend
it to show individual features, not just base architectures.

This is NFC for now, but will be used by three different features added
in v8.5A, and will be tested by them.

Patch by David Spickett!

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

llvm-svn: 343109

5 years ago[llvm-exegesis] Get rid of debug_string.
Clement Courbet [Wed, 26 Sep 2018 13:35:10 +0000 (13:35 +0000)]
[llvm-exegesis] Get rid of debug_string.

Summary:
THis is a backwards-compatible change (existing files will work as
expected).

See PR39082.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 343108

5 years ago[CodeGen] Always print register ties in MI::dump()
Francis Visoiu Mistrih [Wed, 26 Sep 2018 13:33:09 +0000 (13:33 +0000)]
[CodeGen] Always print register ties in MI::dump()

It was the case when calling MO::dump(), but MI::dump() was still
depending on hasComplexRegisterTies().

The MIR output is not affected.

llvm-svn: 343107

5 years ago[ARM/AArch64] Add target parser unit tests for Armv8.4-A
Oliver Stannard [Wed, 26 Sep 2018 13:09:15 +0000 (13:09 +0000)]
[ARM/AArch64] Add target parser unit tests for Armv8.4-A

These were missed when adding Armv8.4-A support.

Patch by Pablo Barrio!

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

llvm-svn: 343106

5 years ago[analyzer] scan-build: if --status-bugs is passed, don't forget about the exit status...
Roman Lebedev [Wed, 26 Sep 2018 13:08:44 +0000 (13:08 +0000)]
[analyzer] scan-build: if --status-bugs is passed, don't forget about the exit status of the actual build

Summary:
This has been bothering me for a while, but only now i have actually looked into this.
I'm using one CI job for static analysis - clang static analyzers as compilers + clang-tidy via cmake.
And i'd like for the build to fail if at least one of those finds issues.
If clang-tidy finds issues, it will fail the build since the warnings-as-errors is set.
If static analyzer finds anything, since --status-bugs is set, it will fail the build.
But if clang-tidy find anything, but static analyzer does not, the build succeeds :/

Reviewers: sylvestre.ledru, alexfh, jroelofs, ygribov, george.karpenkov, krememek

Reviewed By: jroelofs

Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits

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

llvm-svn: 343105

5 years ago[PassTiming] cleaning up legacy PassTimingInfo interface. NFCI.
Fedor Sergeev [Wed, 26 Sep 2018 13:01:43 +0000 (13:01 +0000)]
[PassTiming] cleaning up legacy PassTimingInfo interface. NFCI.

During D51276 discussion it was decided that legacy PassTimingInfo
interface can not be reused for new pass manager's implementation
of -time-passes.

This is a cleanup in preparation for D51276 to make legacy interface
as concise as possible, moving the PassTimingInfo from the header
into the anonymous legacy namespace in .cpp.

It is rather close to a revert of rL340872 in a sense that it hides
the interface and gets rid of templates. However as compared to
a complete revert it resides in a different translation unit and has
an additional pass-instance counting funcitonality (PassIDCountMap).

Reviewers: philip.pfaffe
Differential Revision: https://reviews.llvm.org/D52356

llvm-svn: 343104

5 years agoRevert r343089 "[AArch64] - Return address signing dwarf support"
Hans Wennborg [Wed, 26 Sep 2018 12:57:45 +0000 (12:57 +0000)]
Revert r343089 "[AArch64] - Return address signing dwarf support"

This caused the DebugInfo/Sparc/gnu-window-save.ll test to fail.

> 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

llvm-svn: 343103

5 years ago[ARM/AArch64][v8.5A] Add Armv8.5-A target
Oliver Stannard [Wed, 26 Sep 2018 12:48:21 +0000 (12:48 +0000)]
[ARM/AArch64][v8.5A] Add Armv8.5-A target

This patch allows targeting Armv8.5-A, adding the architecture to
tablegen and setting the options to be identical to Armv8.4-A for the
time being. Subsequent patches will add support for the different
features included in the Armv8.5-A Reference Manual.

Patch by Pablo Barrio!

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

llvm-svn: 343102

5 years ago[DAG] ExpandLegalINT_TO_FP - pull out repeated getValueType() call. NFCI.
Simon Pilgrim [Wed, 26 Sep 2018 12:42:19 +0000 (12:42 +0000)]
[DAG] ExpandLegalINT_TO_FP - pull out repeated getValueType() call. NFCI.

llvm-svn: 343101

5 years ago[PowerPC] optimize conditional branch on CRSET/CRUNSET
Hiroshi Inoue [Wed, 26 Sep 2018 12:32:45 +0000 (12:32 +0000)]
[PowerPC] optimize conditional branch on CRSET/CRUNSET

This patch adds a check to optimize conditional branch (BC and BCn) based on a constant set by CRSET or CRUNSET.
Other optimizers, such as block placement, may generate such code and hence
I do this at the very end of the optimization in pre-emit peephole pass.

A conditional branch based on a constant is eliminated or converted into unconditional branch.
Also CRSET/CRUNSET is eliminated if the condition code register is not used
by instruction other than the branch to be optimized.

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

llvm-svn: 343100

5 years agoRevert r343058 "[ORC] Add support for multithreaded compiles to LLJIT and LLLazyJIT."
Hans Wennborg [Wed, 26 Sep 2018 12:15:23 +0000 (12:15 +0000)]
Revert r343058 "[ORC] Add support for multithreaded compiles to LLJIT and LLLazyJIT."

This doesn't work well in builds configured with LLVM_ENABLE_THREADS=OFF,
causing the following assert when running
ExecutionEngine/OrcLazy/multiple-compile-threads-basic.ll:

  lib/ExecutionEngine/Orc/Core.cpp:1748: Expected<llvm::JITEvaluatedSymbol>
  llvm::orc::lookup(const llvm::orc::JITDylibList &, llvm::orc::SymbolStringPtr):
  Assertion `ResultMap->size() == 1 && "Unexpected number of results"' failed.

> 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: 343099

5 years ago[llvm-exegesis][NFC] Move CodeTemplate to it's own file.
Guillaume Chatelet [Wed, 26 Sep 2018 11:57:24 +0000 (11:57 +0000)]
[llvm-exegesis][NFC] Move CodeTemplate to it's own file.

Summary: This is is preparation of exploring value ranges.

Reviewers: courbet

Reviewed By: courbet

Subscribers: mgorny, tschuett, llvm-commits

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

llvm-svn: 343098

5 years ago[X86][SSE] Refresh PR34947 test code to handle D52504
Simon Pilgrim [Wed, 26 Sep 2018 11:53:51 +0000 (11:53 +0000)]
[X86][SSE] Refresh PR34947 test code to handle D52504

The previously reduced version used urem <9 x i32> zeroinitializer, %tmp which D52504 will simplify.

llvm-svn: 343097

5 years ago[X86][SSE] canReduceVMulWidth - use ComputeNumSignBits/SignBitIsZero directly
Simon Pilgrim [Wed, 26 Sep 2018 11:48:52 +0000 (11:48 +0000)]
[X86][SSE] canReduceVMulWidth - use ComputeNumSignBits/SignBitIsZero directly

Don't reinvent the wheel for BUILD_VECTOR/ZERO_EXTEND - its only the ANY_EXTEND special case that needs handling.

llvm-svn: 343096

5 years agoDisable tests from r342917 on Windows; -lm won't work there
Hans Wennborg [Wed, 26 Sep 2018 11:23:00 +0000 (11:23 +0000)]
Disable tests from r342917 on Windows; -lm won't work there

llvm-svn: 343095

5 years ago[llvm-exegesis] Add support for measuring NumMicroOps.
Clement Courbet [Wed, 26 Sep 2018 11:22:56 +0000 (11:22 +0000)]
[llvm-exegesis] Add support for measuring NumMicroOps.

Summary:
Example output for vzeroall:

---
mode:            uops
key:
  instructions:
    - 'VZEROALL'
  config:          ''
  register_initial_values:
cpu_name:        haswell
llvm_triple:     x86_64-unknown-linux-gnu
num_repetitions: 10000
measurements:
  - { debug_string: HWPort0, value: 0.0006, per_snippet_value: 0.0006,
      key: '3' }
  - { debug_string: HWPort1, value: 0.0011, per_snippet_value: 0.0011,
      key: '4' }
  - { debug_string: HWPort2, value: 0.0004, per_snippet_value: 0.0004,
      key: '5' }
  - { debug_string: HWPort3, value: 0.0018, per_snippet_value: 0.0018,
      key: '6' }
  - { debug_string: HWPort4, value: 0.0002, per_snippet_value: 0.0002,
      key: '7' }
  - { debug_string: HWPort5, value: 1.0019, per_snippet_value: 1.0019,
      key: '8' }
  - { debug_string: HWPort6, value: 1.0033, per_snippet_value: 1.0033,
      key: '9' }
  - { debug_string: HWPort7, value: 0.0001, per_snippet_value: 0.0001,
      key: '10' }
  - { debug_string: NumMicroOps, value: 20.0069, per_snippet_value: 20.0069,
      key: NumMicroOps }
error:           ''
info:            ''
assembled_snippet: C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C5FC77C3
...

Reviewers: gchatelet

Subscribers: tschuett, RKSimon, andreadb, llvm-commits

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

llvm-svn: 343094

5 years ago[X86][SSE] Use ISD::MULHS for constant vXi16 ISD::SRA lowering (PR38151)
Simon Pilgrim [Wed, 26 Sep 2018 10:57:05 +0000 (10:57 +0000)]
[X86][SSE] Use ISD::MULHS for constant vXi16 ISD::SRA lowering (PR38151)

Similar to the existing ISD::SRL constant vector shifts from D49562, this patch adds ISD::SRA support with ISD::MULHS.

As we're dealing with signed values, we have to handle shift by zero and shift by one special cases, so XOP+AVX2/AVX512 splitting/extension is still a better solution - really we should still use ISD::MULHS if one of the special cases are used but for now I've just left a TODO and filtered by isKnownNeverZero.

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

llvm-svn: 343093

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

llvm-svn: 343092

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

llvm-svn: 343091

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

llvm-svn: 343090

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

llvm-svn: 343089

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

llvm-svn: 343088

5 years ago[unittest] Fix NativeProcessProtocolTest.cpp (NFC)
Jonas Devlieghere [Wed, 26 Sep 2018 10:09:44 +0000 (10:09 +0000)]
[unittest] Fix NativeProcessProtocolTest.cpp (NFC)

Cast std::min's second argument to size_t to prevent conflicting types
for parameter deduction.

llvm-svn: 343087

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

llvm-svn: 343086

5 years agoRemoved extra semicolon to fix Wpedantic. (NFCI).
Simon Pilgrim [Wed, 26 Sep 2018 09:12:55 +0000 (09:12 +0000)]
Removed extra semicolon to fix Wpedantic. (NFCI).

llvm-svn: 343085

5 years ago[PDB] Restore the calling convention from PDB
Aleksandr Urakov [Wed, 26 Sep 2018 09:03:34 +0000 (09:03 +0000)]
[PDB] Restore the calling convention from PDB

Summary:
This patch implements restoring of the calling convention from PDB.
It is necessary for expressions evaluation, if we want to call a function
of the debuggee process with a calling convention other than ccall.

Reviewers: clayborg, zturner, labath, asmith

Reviewed By: clayborg

Subscribers: teemperor, lldb-commits, stella.stamenova

Tags: #lldb

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

llvm-svn: 343084

5 years agoRemoved extra semicolon to fix Wpedantic. (NFCI).
Simon Pilgrim [Wed, 26 Sep 2018 09:02:45 +0000 (09:02 +0000)]
Removed extra semicolon to fix Wpedantic. (NFCI).

llvm-svn: 343083

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

llvm-svn: 343082

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

llvm-svn: 343081

5 years agoclang-format: [JS] space after parameter naming.
Martin Probst [Wed, 26 Sep 2018 08:28:33 +0000 (08:28 +0000)]
clang-format: [JS] space after parameter naming.

Summary:
Previously:
    foo(/*bar=*/baz);

Now:
    foo(/*bar=*/ baz);

The run-in parameter naming comment is not intended in JS.

Reviewers: mboehme

Subscribers: cfe-commits

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

llvm-svn: 343080

5 years ago[libc++] Remove Fuchsia-specific knowledge to pick the ABI version
Louis Dionne [Wed, 26 Sep 2018 08:24:51 +0000 (08:24 +0000)]
[libc++] Remove Fuchsia-specific knowledge to pick the ABI version

Summary:
The ABI version used by libc++ is a configuration option just like any other
configuration option. It is a knob that can be used by vendors to customize
the libc++ that they ship. As such, we should not be hardcoding vendor-specific
configuration choices in libc++.

When building libc++ for Fuchsia, Fuchsia's build scripts should simply define
the libc++ ABI version to 2 -- this will result in the _LIBCPP_ABI_VERSION
macro being defined in the __config header that is generated when libc++ is
built and installed, which is the correct way to customize libc++'s behavior
for specific vendors.

Reviewers: phosek, EricWF

Subscribers: mgorny, christof, dexonsmith, cfe-commits, libcxx-commits

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

llvm-svn: 343079

5 years ago[ELF] - Do not fail on R_*_NONE relocations when parsing the debug info.
George Rimar [Wed, 26 Sep 2018 08:11:34 +0000 (08:11 +0000)]
[ELF] - Do not fail on R_*_NONE relocations when parsing the debug info.

This is https://bugs.llvm.org//show_bug.cgi?id=38919.

Currently, LLD may report "unsupported relocation target while parsing debug info"
when parsing the debug information.

At the same time LLD does that for zeroed R_X86_64_NONE relocations,
which obviously has "invalid" targets.

The nature of R_*_NONE relocation assumes them should be ignored.
This patch teaches LLD to stop reporting the debug information parsing errors for them.

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

llvm-svn: 343078

5 years ago[clang-cl] Make /Gs imply default stack probes, not /Gs0 (PR39074)
Hans Wennborg [Wed, 26 Sep 2018 07:39:04 +0000 (07:39 +0000)]
[clang-cl] Make /Gs imply default stack probes, not /Gs0 (PR39074)

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

llvm-svn: 343077

5 years agoFix a memory read bug in lldb-server
Pavel Labath [Wed, 26 Sep 2018 07:31:41 +0000 (07:31 +0000)]
Fix a memory read bug in lldb-server

NativeProcessProtocol::ReadMemoryWithoutTrap had a bug, where it failed
to properly remove inserted breakpoint opcodes if the memory read
partially overlapped the trap opcode. This could not happen on x86
because it has a one-byte breakpoint instruction, but it could happen on
arm, which has a 4-byte breakpoint instruction (in arm mode).

Since triggerring this condition would only be possible on an arm
machine (and even then it would be a bit tricky). I test this using a
NativeProcessProtocol unit test.

llvm-svn: 343076

5 years ago[CUDA] Fix two failed test cases using --cuda-path-ignore-env
Jiading Gai [Wed, 26 Sep 2018 07:07:48 +0000 (07:07 +0000)]
[CUDA] Fix two failed test cases using --cuda-path-ignore-env

Add --cuda-path-ignore-env option to those test cases to ensure the clang
driver always pick the CUDA path specified by --sysroot.

Reviewers: tra, Hahnfeld

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

llvm-svn: 343075

5 years ago[CMake] [MinGW] Build address sanitizer for MinGW if building with clang
Martin Storsjo [Wed, 26 Sep 2018 06:53:01 +0000 (06:53 +0000)]
[CMake] [MinGW] Build address sanitizer for MinGW if building with clang

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

llvm-svn: 343074

5 years ago[ASan] [MinGW] Only try to export MSVC specific C++ symbols if building with a MSVC...
Martin Storsjo [Wed, 26 Sep 2018 06:52:55 +0000 (06:52 +0000)]
[ASan] [MinGW] Only try to export MSVC specific C++ symbols if building with a MSVC like compiler

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

llvm-svn: 343073

5 years ago[Frontend] Tidy up -print-decl-contexts conditions
Fangrui Song [Wed, 26 Sep 2018 06:28:14 +0000 (06:28 +0000)]
[Frontend] Tidy up -print-decl-contexts conditions

The existing conditions are not consistent. Some have braces and define a temporary Decl while others simply call `<< *cast<XXXDecl>(I)` (mostly the NamedDecl overload of operator<<).
Just use the latter for consistency and brevity.

llvm-svn: 343072

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.

llvm-svn: 343071

5 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

5 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

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.

llvm-svn: 343068

5 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

5 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

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.

llvm-svn: 343065

5 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

5 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

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

llvm-svn: 343062

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.

llvm-svn: 343061

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.

llvm-svn: 343060

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.

llvm-svn: 343059

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.

llvm-svn: 343058

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.

llvm-svn: 343057

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.

llvm-svn: 343056

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

llvm-svn: 343055

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

llvm-svn: 343054

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

llvm-svn: 343053

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

llvm-svn: 343052

5 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

5 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

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.

llvm-svn: 343049

5 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

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

llvm-svn: 343047

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.

llvm-svn: 343046

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.

llvm-svn: 343045

5 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

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.

llvm-svn: 343043

5 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

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.

llvm-svn: 343041

5 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

5 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