platform/upstream/llvm.git
6 years ago[docs] Add some subsections to make it possible to find portions of the statepoint...
Philip Reames [Thu, 8 Nov 2018 22:56:41 +0000 (22:56 +0000)]
[docs] Add some subsections to make it possible to find portions of the statepoint overview

llvm-svn: 346446

6 years ago[WebAssembly] Fix LowerEmscriptenEHSjLj when there's only longjmp
Heejin Ahn [Thu, 8 Nov 2018 22:56:26 +0000 (22:56 +0000)]
[WebAssembly] Fix LowerEmscriptenEHSjLj when there's only longjmp

Summary:
The pass incorrectly assumed if there's a longjmp declaration in the
module, there is also a setjmp function declaration. Fixed it, and now
the pass only converts longjmp and does not do any other transformation
when there's no setjmp declaration in the module.

Fixes PR39562.

Reviewers: jgravelle-google, sbc100

Subscribers: dschuff, sunfish, llvm-commits

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

llvm-svn: 346445

6 years agoRevert "Fix bug in PE/COFF plugin and ValueObjectVariable."
Davide Italiano [Thu, 8 Nov 2018 22:47:40 +0000 (22:47 +0000)]
Revert "Fix bug in PE/COFF plugin and ValueObjectVariable."

It breaks some tests on MacOS.

llvm-svn: 346444

6 years agoChange $CURRENT_ARCH settings in xcode project file to hardcoded
Jason Molenda [Thu, 8 Nov 2018 22:41:19 +0000 (22:41 +0000)]
Change $CURRENT_ARCH settings in xcode project file to hardcoded
"x86_64" - used for finding the llvm build directory.  Newer
Xcodes do not define CURRENT_ARCH.

llvm-svn: 346443

6 years ago[lldb] Silence unhandled enums warning.
Jorge Gorbe Moya [Thu, 8 Nov 2018 22:04:58 +0000 (22:04 +0000)]
[lldb] Silence unhandled enums warning.

The warning was introduced by r346392, which introduces new builtin
types (to support cl_intel_device_side_avc_motion_estimation OpenCL
extension).

Note that this patch only inserts empty cases to silence the warning and
unblock our integrate, does not aim to add support for the new types in
lldb.

llvm-svn: 346441

6 years ago[ARM64] [Windows] Improve error reporting for unsupported SEH unwind.
Eli Friedman [Thu, 8 Nov 2018 21:20:52 +0000 (21:20 +0000)]
[ARM64] [Windows] Improve error reporting for unsupported SEH unwind.

Use report_fatal_error instead of crashing or miscompiling. (It's
currently easier than it should be to hit this case because we don't
reuse codes across epilogs.)

llvm-svn: 346440

6 years ago[Frontend/Modules] Show diagnostics on prebuilt module configuration mismatch too
David Blaikie [Thu, 8 Nov 2018 20:47:30 +0000 (20:47 +0000)]
[Frontend/Modules] Show diagnostics on prebuilt module configuration mismatch too

The current version only emits  the below error for a module (attempted to be loaded) from the `prebuilt-module-path`:

```
error: module file blabla.pcm cannot be loaded due to a configuration mismatch with the current compilation [-Wmodule-file-config-mismatch]
```

With this change, if the prebuilt module is used, we allow the proper diagnostic behind the configuration mismatch to be shown.

```
error: POSIX thread support was disabled in PCH file but is currently enabled
error: module file blabla.pcm cannot be loaded due to a configuration mismatch with the current compilation [-Wmodule-file-config-mismatch]
```

(A few lines later an error is emitted anyways, so there is no reason not to complain for configuration mismatches if a config mismatch is found and kills the build.)

Reviewed By: dblaikie

Tags: #clang

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

llvm-svn: 346439

6 years ago[LoopInterchange] Support reductions across inner and outer loop.
Florian Hahn [Thu, 8 Nov 2018 20:44:19 +0000 (20:44 +0000)]
[LoopInterchange] Support reductions across inner and outer loop.

This patch adds logic to detect reductions across the inner and outer
loop by following the incoming values of PHI nodes in the outer loop. If
the incoming values take part in a reduction in the inner loop or come
from outside the outer loop, we found a reduction spanning across inner
and outer loop.

With this change, ~10% more loops are interchanged in the LLVM
test-suite + SPEC2006.

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

Reviewers: mcrosier, efriedma, karthikthecool, davide, hfinkel, dmgreen

Reviewed By: efriedma

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

llvm-svn: 346438

6 years ago[SelectionDAG] Assert on the width of DemandedElts argument to computeKnownBits for...
Craig Topper [Thu, 8 Nov 2018 20:29:17 +0000 (20:29 +0000)]
[SelectionDAG] Assert on the width of DemandedElts argument to computeKnownBits for all vector typed operations not just build_vector.

Fix AArch64 unit test that fails with the assertion added.

llvm-svn: 346437

6 years ago[LTO] Drop non-prevailing definitions only if linkage is not local or appending
Pirama Arumuga Nainar [Thu, 8 Nov 2018 20:10:07 +0000 (20:10 +0000)]
[LTO] Drop non-prevailing definitions only if linkage is not local or appending

Summary:
This fixes PR 37422

In ELF, non-weak symbols can also be non-prevailing.  In this particular
PR, the __llvm_profile_* symbols are non-prevailing but weren't getting
dropped - causing multiply-defined errors with lld.

Also add a test, strong_non_prevailing.ll, to ensure that multiple
copies of a strong symbol are dropped.

To fix the test regressions exposed by this fix,
- do not mark prevailing copies for symbols with 'appending' linkage.
There's no one prevailing copy for such symbols.
- fix the prevailing version in dead-strip-fulllto.ll
- explicitly pass exported symbols to llvm-lto in fumcimport.ll and
funcimport_var.ll

Reviewers: tejohnson, pcc

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith,
dang, srhines, llvm-commits

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

llvm-svn: 346436

6 years ago[lldb] Fix initialization order warnings.
Jorge Gorbe Moya [Thu, 8 Nov 2018 19:57:59 +0000 (19:57 +0000)]
[lldb] Fix initialization order warnings.

Moved the declaration of m_kind below the declaration of cvclass,
cvunion and cvenum. This order is necessary because in one of the
constructors the initialization of m_kind depends on the value of
cvclass.

third_party/llvm/llvm/tools/lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp:50:7: error: field 'cvclass' will be initialized after field 'm_kind' [-Werror,-Wreorder]
    : cvclass(std::move(c)),
      ^
third_party/llvm/llvm/tools/lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp:51:14: error: field 'cvclass' is uninitialized when used here [-Werror,-Wuninitialized]
      m_kind(cvclass.Kind == TypeRecordKind::Struct ? Struct : Class) {}

llvm-svn: 346435

6 years ago[X86] Regenerate loaduse test
Simon Pilgrim [Thu, 8 Nov 2018 19:42:11 +0000 (19:42 +0000)]
[X86] Regenerate loaduse test

llvm-svn: 346434

6 years ago[x86] use shuffles for scalar insertion into high elements of a constant vector
Sanjay Patel [Thu, 8 Nov 2018 19:16:27 +0000 (19:16 +0000)]
[x86] use shuffles for scalar insertion into high elements of a constant vector

As discussed in D54073, we have a potential regression from more aggressive vector narrowing here, so let's try to avoid that by changing build-vector lowering slightly.

Insert-vector-element lowering always does this since there's no "pinsr" for ymm/zmm:

// If the vector is wider than 128 bits, extract the 128-bit subvector, insert
// into that, and then insert the subvector back into the result.

...but we can sometimes do better for insert-into-constant-vector by using shuffle lowering.

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

llvm-svn: 346433

6 years ago[DAGCombine] Improve alias analysis for chain of independent stores.
Nirav Dave [Thu, 8 Nov 2018 19:14:20 +0000 (19:14 +0000)]
[DAGCombine] Improve alias analysis for chain of independent stores.

FindBetterNeighborChains simulateanously improves the chain
dependencies of a chain of related stores avoiding the generation of
extra token factors. For chains longer than the GatherAllAliasDepths,
stores further down in the chain will necessarily fail, a potentially
significant waste and preventing otherwise trivial parallelization.

This patch directly parallelize the chains of stores before improving
each store. This generally improves DAG-level parallelism.

Reviewers: courbet, spatel, RKSimon, bogner, efriedma, craig.topper, rnk

Subscribers: sdardis, javed.absar, hiraditya, jrtc27, atanasyan, llvm-commits

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

llvm-svn: 346432

6 years agoFix -Wextra-qualification warning
Reid Kleckner [Thu, 8 Nov 2018 18:53:56 +0000 (18:53 +0000)]
Fix -Wextra-qualification warning

llvm-svn: 346431

6 years agoFix bug in PE/COFF plugin and ValueObjectVariable.
Zachary Turner [Thu, 8 Nov 2018 18:50:31 +0000 (18:50 +0000)]
Fix bug in PE/COFF plugin and ValueObjectVariable.

There are two bugs here.  The first is that MSVC and clang-cl
emit their bss section under the name '.data' instead of '.bss'
but with the size and file offset set to 0.  ObjectFilePECOFF
didn't handle this, and would only recognize a section as bss
if it was actually called '.bss'.  The effect of this is that
if we tried to print the value of a variable that lived in BSS
we would fail.

The second bug is that ValueObjectVariable was only returning
the forward type, which is insufficient to print the value of an
enum.  So we bump this up to the layout type.

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

llvm-svn: 346430

6 years ago[NativePDB] Higher fidelity reconstruction of AST from Debug Info.
Zachary Turner [Thu, 8 Nov 2018 18:50:11 +0000 (18:50 +0000)]
[NativePDB] Higher fidelity reconstruction of AST from Debug Info.

In order to accurately put a type into the correct location in the AST
we construct from debug info, we need to be able to determine what
DeclContext (namespace, global, nested class, etc) that it goes into.
PDB doesn't contain this mapping.  It does, however, contain the reverse
mapping.  That is, for a given class type T, you can determine all
classes Q1, Q2, ..., Qn that are nested inside of T.  We need to know,
for a given class type Q, what type T is it nested inside of.

This patch builds this map as a pre-processing step when we first
load the PDB by scanning every type.  Initial tests show that while
this can be slow in debug builds of LLDB, it is quite fast in release
builds (less than 2 seconds for a ~1GB PDB, and it only needs to happen
once).

Furthermore, having this pre-processing step in place allows us to
repurpose it for building up other kinds of indexing to it down the
line.  For the time being, this gives us very accurate reconstruction
of the DeclContext hierarchy.

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

llvm-svn: 346429

6 years agoRefactor ClangASTContext::AddEnumerationValueToEnumerationType() to remove redundant...
Shafik Yaghmour [Thu, 8 Nov 2018 18:42:00 +0000 (18:42 +0000)]
Refactor ClangASTContext::AddEnumerationValueToEnumerationType() to remove redundant parameter which can be calculated from other parameter.

rdar://problem/43822994

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

llvm-svn: 346428

6 years ago[COFF] Improve relocation against discarded section error
Reid Kleckner [Thu, 8 Nov 2018 18:38:17 +0000 (18:38 +0000)]
[COFF] Improve relocation against discarded section error

Summary:
Reuse the "referenced by" note diagnostic code that we already use for
undefined symbols. In my case, it turned this:
  lld-link: error: relocation against symbol in discarded section: .text
  lld-link: error: relocation against symbol in discarded section: .text
  ...

Into this:
  lld-link: error: relocation against symbol in discarded section: .text
  >>> referenced by libANGLE.lib(CompilerGL.obj):(.SCOVP$M)
  >>> referenced by libANGLE.lib(CompilerGL.obj):(.SCOVP$M)
  ...

  lld-link: error: relocation against symbol in discarded section: .text
  >>> referenced by obj/third_party/angle/libGLESv2/entry_points_egl_ext.obj:(.SCOVP$M)
  >>> referenced by obj/third_party/angle/libGLESv2/entry_points_egl_ext.obj:(.SCOVP$M)
  ...

I think the new output is more useful.

Reviewers: ruiu, pcc

Subscribers: llvm-commits

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

llvm-svn: 346427

6 years ago[x86] add RUNs for AVX1; NFC
Sanjay Patel [Thu, 8 Nov 2018 18:18:20 +0000 (18:18 +0000)]
[x86] add RUNs for AVX1; NFC

Differences in splat-ability might be reason to differentiate some cases.

llvm-svn: 346426

6 years ago[NFC][BdVer2] Load and store throughput tests: also check sched stats (PR39465)
Roman Lebedev [Thu, 8 Nov 2018 18:15:58 +0000 (18:15 +0000)]
[NFC][BdVer2] Load and store throughput tests: also check sched stats (PR39465)

As noted by Andrea Di Biagio in https://bugs.llvm.org/show_bug.cgi?id=39465
both the loads and stores occupy both the store and load queues.
This is clearly wrong.

llvm-svn: 346425

6 years ago[llvm-mca] Partially revert r346417.
Matt Davis [Thu, 8 Nov 2018 18:08:43 +0000 (18:08 +0000)]
[llvm-mca] Partially revert r346417.

Restored the llvm:: namespace qualifier on make_unique.
This removes the ambiguity with make_unique.

llvm-svn: 346424

6 years agoAdd test case for the regression caused by r344696
Nicolai Haehnle [Thu, 8 Nov 2018 18:01:38 +0000 (18:01 +0000)]
Add test case for the regression caused by r344696

(That change has since been reverted.)

Reduced from https://bugs.freedesktop.org/show_bug.cgi?id=108611

llvm-svn: 346423

6 years agoInstCombine: Avoid introducing poison values when lowering llvm.amdgcn.[us]bfe
Tom Stellard [Thu, 8 Nov 2018 17:57:57 +0000 (17:57 +0000)]
InstCombine: Avoid introducing poison values when lowering llvm.amdgcn.[us]bfe

Summary:
When the 3rd argument to these intrinsics is zero, lowering them
to shift instructions produces poison values, since we end up with
shift amounts equal to the number of bits in the shifted value.  This
means we can only lower these intrinsics if we can prove that the
3rd argument is not zero.

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: bnieuwenhuizen, jvesely, wdng, nhaehnle, llvm-commits

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

llvm-svn: 346422

6 years ago[CodeExtractor] Mark functions noreturn when applicable
Vedant Kumar [Thu, 8 Nov 2018 17:57:09 +0000 (17:57 +0000)]
[CodeExtractor] Mark functions noreturn when applicable

This eliminates the outlining penalty for llvm.trap/unreachable, because
callers no longer have to emit cleanup/ret instructions after calling an
outlined `noreturn` function.

rdar://45523626

llvm-svn: 346421

6 years agoIntroduce `sanitizer_malloc_introspect_t` for Darwin which is a sub-class of Darwin...
Dan Liew [Thu, 8 Nov 2018 17:50:34 +0000 (17:50 +0000)]
Introduce `sanitizer_malloc_introspect_t` for Darwin which is a sub-class of Darwin's `malloc_introspection_t` and use it when setting up the malloc zone.

Summary:
Currently `sanitizer_malloc_introspection_t` just adds a version field
which is used to version the allocator ABI. The current allocator ABI
version is returned by the new `GetMallocZoneAllocatorEnumerationVersion()` function.

The motivation behind this change is to allow external processes to
determine the allocator ABI of a sanitized process.

rdar://problem/45284065

Reviewers: kubamracek, george.karpenkov, vitalybuka

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 346420

6 years ago[llvm-mca] PR39261: Rename FetchStage to EntryStage.
Andrea Di Biagio [Thu, 8 Nov 2018 17:49:30 +0000 (17:49 +0000)]
[llvm-mca] PR39261: Rename FetchStage to EntryStage.

This fixes PR39261.

FetchStage is a misnomer. It causes confusion with the frontend fetch stage,
which we don't currently simulate.  I decided to rename it into EntryStage
mainly because this is meant to be a "source" stage for all pipelines.

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

llvm-svn: 346419

6 years ago[clang-tidy] Untangle layering in ClangTidyDiagnosticConsumer somewhat. NFC
Sam McCall [Thu, 8 Nov 2018 17:42:16 +0000 (17:42 +0000)]
[clang-tidy] Untangle layering in ClangTidyDiagnosticConsumer somewhat. NFC

Summary:
Clang's hierarchy is CompilerInstance -> DiagnosticsEngine -> DiagnosticConsumer.
(Ownership is optional/shared, but this structure is fairly clear).

Currently ClangTidyDiagnosticConsumer *owns* the DiagnosticsEngine:
 - this inverts the hierarchy, which is confusing
 - this means ClangTidyDiagnosticConsumer() mutates the passed-in context, which
   is both surprising and limits flexibility
 - it's not possible to use a different DiagnosticsEngine with ClangTidy

This means a little bit more code in the places ClangTidy is used standalone,
but more flexibility in using ClangTidy with other diagnostics configurations.

Reviewers: hokein

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 346418

6 years ago[llvm-mca] Remove unneeded namespace qualifier. NFC.
Matt Davis [Thu, 8 Nov 2018 17:32:45 +0000 (17:32 +0000)]
[llvm-mca] Remove unneeded namespace qualifier. NFC.

llvm-svn: 346417

6 years ago[docs] Clarify ELF section naming for StackMaps and fix a typo
Philip Reames [Thu, 8 Nov 2018 17:20:35 +0000 (17:20 +0000)]
[docs] Clarify ELF section naming for StackMaps and fix a typo

llvm-svn: 346416

6 years ago[clang-tidy] fix test after r346414
Sam McCall [Thu, 8 Nov 2018 17:10:31 +0000 (17:10 +0000)]
[clang-tidy] fix test after r346414

llvm-svn: 346415

6 years ago[Tooling] Produce diagnostics for missing input files.
Sam McCall [Thu, 8 Nov 2018 16:57:01 +0000 (16:57 +0000)]
[Tooling] Produce diagnostics for missing input files.

Summary:
This was disabled way back in 2011, in the dark times before Driver was VFS-aware.

Also, make driver more VFS-aware :-)

This breaks one ClangTidy test (we improved the error message), will fix when
submitting.

Reviewers: ioeric

Subscribers: cfe-commits, alexfh

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

llvm-svn: 346414

6 years agoFix bitcast to address space cast for coerced load/stores
Yaxun Liu [Thu, 8 Nov 2018 16:55:46 +0000 (16:55 +0000)]
Fix bitcast to address space cast for coerced load/stores

Coerced load/stores through memory do not take into account potential
address space differences when it creates its bitcasts.

Patch by David Salinas.

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

llvm-svn: 346413

6 years ago[dsymutil] Copy the LC_BUILD_VERSION load command into the companion binary.
Adrian Prantl [Thu, 8 Nov 2018 16:54:59 +0000 (16:54 +0000)]
[dsymutil] Copy the LC_BUILD_VERSION load command into the companion binary.

LC_BUILD_VERSION contains platform information that is useful for LLDB
to match up dSYM bundles with binaries. This patch copies the load
command over into the dSYM.

rdar://problem/44145175
rdar://problem/45883463

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

llvm-svn: 346412

6 years ago[PowerPC][llvm-exegesis] Add a PowerPC target
Jinsong Ji [Thu, 8 Nov 2018 16:51:42 +0000 (16:51 +0000)]
[PowerPC][llvm-exegesis] Add a PowerPC target

This is patch to add PowerPC target to llvm-exegesis.
The target does just enough to be able to run llvm-exegesis in latency mode for at least some opcodes.

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

llvm-svn: 346411

6 years agoRevert "[MSP430] Add MC layer"
Davide Italiano [Thu, 8 Nov 2018 16:21:29 +0000 (16:21 +0000)]
Revert "[MSP430] Add MC layer"

This commit broke the module buildbots.
Error:

lib/Target/MSP430/MSP430GenAsmMatcher.inc:1027:1: error: redundant
namespace 'llvm' [-Wmodules-import-nested-redundant]
^

llvm-svn: 346410

6 years ago[Profile] The test for gcov-fork seems to be ok on arm
Calixte Denizet [Thu, 8 Nov 2018 16:16:04 +0000 (16:16 +0000)]
[Profile] The test for gcov-fork seems to be ok on arm

Summary: Remove the XFAIL for arm since it seems to be ok

Reviewers: marco-c

Reviewed By: marco-c

Subscribers: javed.absar, kristof.beyls, delcypher, chrib, llvm-commits, #sanitizers, sylvestre.ledru

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

llvm-svn: 346409

6 years ago[OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping.
Alexey Bataev [Thu, 8 Nov 2018 15:47:39 +0000 (15:47 +0000)]
[OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping.

The base pointer for the lambda mapping must point to the lambda capture
placement and pointer must point to the captured variable itself. Patch
fixes this problem.

llvm-svn: 346408

6 years ago[OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping.
Alexey Bataev [Thu, 8 Nov 2018 15:47:30 +0000 (15:47 +0000)]
[OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping.

Summary:
The base pointer for the lambda mapping must point to the lambda capture
placement and pointer must point to the captured variable itself. Patch
fixes this problem.

Reviewers: gtbercea

Subscribers: guansong, openmp-commits, kkwli0, caomhin

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

llvm-svn: 346407

6 years ago[SystemZ] Bugfix in shouldCoalesce()
Jonas Paulsson [Thu, 8 Nov 2018 15:29:48 +0000 (15:29 +0000)]
[SystemZ] Bugfix in shouldCoalesce()

It was discovered in randomized testing that the SystemZ implementation of
shouldCoalesce() could be caused to crash when subreg liveness was
enabled. This was because an undef use of the virtual register was copied
outside current MBB at the point of shouldCoalesce() being called. For more
details, see https://bugs.llvm.org/show_bug.cgi?id=39276.

This patch changes the check for MBB locality from livein/liveout checks to
do checks for all instructions of both intervals being inside MBB. This
avoids the cases with dead defs / undef uses outside MBB, which are not
affecting liveness in/out of MBB.

The original test case included as a reduced .mir test case.

Review: Ulrich Weigand
https://reviews.llvm.org/D54197

llvm-svn: 346406

6 years ago[docs] Clarify expectations for stack map sections and AOT compilers
Philip Reames [Thu, 8 Nov 2018 15:17:10 +0000 (15:17 +0000)]
[docs] Clarify expectations for stack map sections and AOT compilers

llvm-svn: 346405

6 years ago[NFC][BdVer2] Tests for load and store throughput (PR39465)
Roman Lebedev [Thu, 8 Nov 2018 14:48:56 +0000 (14:48 +0000)]
[NFC][BdVer2] Tests for load and store throughput (PR39465)

During review it was noted that while it appears that
the Piledriver can do two [consecutive] loads per cycle,
it can only do one store per cycle. It was suggested
that the sched model incorrectly models that,
but it was opted to fix this afterwards.

These tests show that the two consecutive loads are
modelled correctly, and one consecutive stores is not
modelled incorrectly. Unless i'm missing the point.

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

llvm-svn: 346404

6 years ago[LLD] Fix Microsoft precompiled headers cross-compile on Linux
Alexandre Ganea [Thu, 8 Nov 2018 14:42:37 +0000 (14:42 +0000)]
[LLD] Fix Microsoft precompiled headers cross-compile on Linux

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

llvm-svn: 346403

6 years ago[X86][SSE] Add PR39387 shuffle test case
Simon Pilgrim [Thu, 8 Nov 2018 14:07:17 +0000 (14:07 +0000)]
[X86][SSE] Add PR39387 shuffle test case

llvm-svn: 346402

6 years ago[ARM] Enable spilling of the hGPR register class in Thumb2
Petr Pavlu [Thu, 8 Nov 2018 13:02:10 +0000 (13:02 +0000)]
[ARM] Enable spilling of the hGPR register class in Thumb2

Generalize code in Thumb2InstrInfo::storeRegToStackSlot() and
loadRegToStackSlot() to allow the GPR class or any of its sub-classes
(including hGPR) to be stored/loaded by ARM::t2STRi12/ARM::t2LDRi12.

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

llvm-svn: 346401

6 years ago[llvm-exegesis][NFC] Add missing header guard + cosmetics.
Clement Courbet [Thu, 8 Nov 2018 12:37:56 +0000 (12:37 +0000)]
[llvm-exegesis][NFC] Add missing header guard + cosmetics.

Reviewers: gchatelet

Reviewed By: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 346400

6 years ago[X86][AVX] Tidyup prefixes and regenerate interleaved tests
Simon Pilgrim [Thu, 8 Nov 2018 12:14:10 +0000 (12:14 +0000)]
[X86][AVX] Tidyup prefixes and regenerate interleaved tests

Share common AVX prefix and split off AVX2OR512 prefix instead

llvm-svn: 346399

6 years agoRevert "[llvm-exegesis] Add a snippet generator to generate snippets to compute ROB...
Clement Courbet [Thu, 8 Nov 2018 12:09:45 +0000 (12:09 +0000)]
Revert "[llvm-exegesis] Add a snippet generator to generate snippets to compute ROB sizes."

This reverts accidental commit rL346394.

llvm-svn: 346398

6 years agoReturn "[IndVars] Smart hard uses detection"
Max Kazantsev [Thu, 8 Nov 2018 11:54:35 +0000 (11:54 +0000)]
Return "[IndVars] Smart hard uses detection"

The patch has been reverted because it ended up prohibiting propagation
of a constant to exit value. For such values, we should skip all checks
related to hard uses because propagating a constant is always profitable.

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

llvm-svn: 346397

6 years agoAdding Yvan as release test backup for Diana
Renato Golin [Thu, 8 Nov 2018 11:51:27 +0000 (11:51 +0000)]
Adding Yvan as release test backup for Diana

Thanks for offering to help, Yvan! :)

llvm-svn: 346396

6 years ago[llvm-exegesis] Add a snippet generator to generate snippets to compute ROB sizes.
Clement Courbet [Thu, 8 Nov 2018 11:45:14 +0000 (11:45 +0000)]
[llvm-exegesis] Add a snippet generator to generate snippets to compute ROB sizes.

llvm-svn: 346394

6 years agoclang-cl: Add "/clang:" pass-through arg support.
Hans Wennborg [Thu, 8 Nov 2018 11:27:04 +0000 (11:27 +0000)]
clang-cl: Add "/clang:" pass-through arg support.

The clang-cl driver disables access to command line options outside of the
"Core" and "CLOption" sets of command line arguments. This filtering makes it
impossible to pass arguments that are interpreted by the clang driver and not
by either 'cc1' (the frontend) or one of the other tools invoked by the driver.

An example driver-level flag is the '-fno-slp-vectorize' flag, which is
processed by the driver in Clang::ConstructJob and used to set the cc1 flag
"-vectorize-slp". There is no negative cc1 flag or -mllvm flag, so it is not
currently possible to disable the SLP vectorizer from the clang-cl driver.

This change introduces the "/clang:" argument that is available when the
driver mode is set to CL compatibility. This option works similarly to the
"-Xclang" option, except that the option values are processed by the clang
driver rather than by 'cc1'. An example usage is:

  clang-cl /clang:-fno-slp-vectorize /O2 test.c

Another example shows how "/clang:" can be used to pass a flag where there is
a conflict between a clang-cl compat option and an overlapping clang driver
option:

  clang-cl /MD /clang:-MD /clang:-MF /clang:test_dep_file.dep test.c

In the previous example, the unprefixed /MD selects the DLL version of the msvc
CRT, while the prefixed -MD flag and the -MF flags are used to create a make
dependency file for included headers.

One note about flag ordering: the /clang: flags are concatenated to the end of
the argument list, so in cases where the last flag wins, the /clang: flags
will be chosen regardless of their order relative to other flags on the driver
command line.

Patch by Neeraj K. Singh!

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

llvm-svn: 346393

6 years ago[OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension
Andrew Savonichev [Thu, 8 Nov 2018 11:25:41 +0000 (11:25 +0000)]
[OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension

Summary:
Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt

Patch by Kristina Bessonova

Reviewers: Anastasia, yaxunl, shafik

Reviewed By: Anastasia

Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits

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

llvm-svn: 346392

6 years ago[MSP430] Fix encodeInstruction() for big endian hosts
Anton Korobeynikov [Thu, 8 Nov 2018 10:17:52 +0000 (10:17 +0000)]
[MSP430] Fix encodeInstruction() for big endian hosts

Reviewers: asl

Subscribers: llvm-commits

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

llvm-svn: 346391

6 years ago[LSR] Combine unfolded offset into invariant register
Gil Rapaport [Thu, 8 Nov 2018 09:01:19 +0000 (09:01 +0000)]
[LSR] Combine unfolded offset into invariant register

LSR reassociates constants as unfolded offsets when the constants fit as
immediate add operands, which currently prevents such constants from being
combined later with loop invariant registers.
This patch modifies GenerateCombinations() to generate a second formula which
includes the unfolded offset in the combined loop-invariant register.

This commit fixes a bug in the original patch (committed at r345114, reverted
at r345123).

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

llvm-svn: 346390

6 years ago[SCEV][NFC] Verify IR in isLoop[Entry,Backedge]GuardedByCond
Max Kazantsev [Thu, 8 Nov 2018 05:07:58 +0000 (05:07 +0000)]
[SCEV][NFC] Verify IR in isLoop[Entry,Backedge]GuardedByCond

We have a lot of various bugs that are caused by misuse of SCEV (in particular in LV),
all of them can simply be described as "we ask SCEV to prove some fact on invalid IR".
Some of examples of those are PR36311, PR37221, PR39160.

The problem is that these failues manifest differently (what we saw was failure of various
asserts across SCEV, but there can also be miscompiles). This patch adds an assert into two
SCEV methods that strongly rely on correctness of the IR and are involved in known failues.
This will at least allow us to have a clear indication of what was wrong in this case.

This patch also fixes a unit test with incorrect IR that fails this verification.

Differential Revision: https://reviews.llvm.org/D52930
Reviewed By: fhahn

llvm-svn: 346389

6 years ago[bindings/go] Add Go bindings to LLVMGetIndices
whitequark [Thu, 8 Nov 2018 04:04:04 +0000 (04:04 +0000)]
[bindings/go] Add Go bindings to LLVMGetIndices

Summary: This instruction is useful for inspecting extractvalue/insertvalue in IR. Unlike most other operations, indices cannot be inspected using the generic Value.Opcode() function so a specialized function needs to be added.

Reviewers: whitequark, pcc

Reviewed By: whitequark

Subscribers: llvm-commits

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

llvm-svn: 346388

6 years ago[OCaml] Fix incorrect use of CAMLlocal in nested blocks
whitequark [Thu, 8 Nov 2018 04:00:18 +0000 (04:00 +0000)]
[OCaml] Fix incorrect use of CAMLlocal in nested blocks

Summary:
The OCaml manual states:

> Local variables of type value must be declared with one of the
> CAMLlocal macros. [...] These macros must be used at the beginning
> of the function, not in a nested block.

This patch moves several instances of CAMLlocal macros from nested
blocks to the function beginning.

Reviewers: whitequark

Reviewed By: whitequark

Subscribers: CodaFi, llvm-commits

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

llvm-svn: 346387

6 years ago[MergeFuncs] Improve ordering of equal functions
whitequark [Thu, 8 Nov 2018 03:58:01 +0000 (03:58 +0000)]
[MergeFuncs] Improve ordering of equal functions

Summary:
MergeFunctions currently tries to process strong functions before
weak functions, because weak functions can simply call strong
functions, while a strong/weak function cannot call a weak function
(a backing strong function is needed).

This patch additionally tries to process external functions before
local functions, because we definitely have to keep the external
function, but may be able to drop the local one (and definitely
can if it is also unnamed_addr).

Unfortunately, this exposes an existing bug in the implementation:
The FnTree and FNodesInTree structures can currently go out of
sync in the case where two weak functions are merged, because the
function in FnTree/FNodesInTree is RAUWed. This leaves it behind in
FnTree (this is intended, as it is the strong backing function which
should be used for further merges), while it is replaced in
FNodesInTree (this is not intended).

This is fixed by switching FNodesInTree from using a ValueMap to
using a DenseMap of AssertingVH.

This exposes another minor issue: Currently FNodesInTree is not
cleared after MergeFunctions finishes running. Currently, this is
potentially dangerous (e.g. if something else wants to RAUW a function
with a non-function), but at the very least it is unnecessary/inefficient.
After the change to use AssertingVH it becomes more problematic,
because there are certainly passes that remove functions.

This issue is fixed by clearing FNodesInTree at the end of the pass.

Reviewers: jfb, whitequark

Reviewed By: whitequark

Subscribers: rkruppe, llvm-commits

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

llvm-svn: 346386

6 years ago[MergeFuncs] Call removeUsers() prior to unnamed_addr RAUW
whitequark [Thu, 8 Nov 2018 03:57:55 +0000 (03:57 +0000)]
[MergeFuncs] Call removeUsers() prior to unnamed_addr RAUW

Summary:
For unnamed_addr functions we RAUW instead of only replacing direct callers. However, functions in which replacements were performed currently are not added back to the worklist, resulting in missed merging opportunities.

Fix this by calling removeUsers() prior to RAUW.

Reviewers: jfb, whitequark

Reviewed By: whitequark

Subscribers: rkruppe, llvm-commits

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

llvm-svn: 346385

6 years ago[WebAssembly] Add V128 to WebAssemblyInstrInfo::copyPhysReg
Thomas Lively [Thu, 8 Nov 2018 02:35:28 +0000 (02:35 +0000)]
[WebAssembly] Add V128 to WebAssemblyInstrInfo::copyPhysReg

Reviewers: aheejin, dschuff

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

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

llvm-svn: 346384

6 years agoRevert "Reorder FindPythonInterp so that config-ix can use PYTHON_EXECUTABLE"
Nathan Lanza [Thu, 8 Nov 2018 01:10:24 +0000 (01:10 +0000)]
Revert "Reorder FindPythonInterp so that config-ix can use PYTHON_EXECUTABLE"

This reverts commit rL346367 due to test error in compiler-rt.

llvm-svn: 346383

6 years ago[sancov] Put .SCOV* sections into the right comdat groups on COFF
Reid Kleckner [Thu, 8 Nov 2018 00:57:33 +0000 (00:57 +0000)]
[sancov] Put .SCOV* sections into the right comdat groups on COFF

Avoids linker errors about relocations against discarded sections.

This was uncovered during the Chromium clang roll here:
https://chromium-review.googlesource.com/c/chromium/src/+/1321863#message-717516acfcf829176f6a2f50980f7a4bdd66469a

After this change, Chromium's libGLESv2 links successfully for me.

Reviewers: metzman, hans, morehouse

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

llvm-svn: 346381

6 years agoNFC: DebugInfo: Track the origin CU rather than just the base address for range lists
David Blaikie [Thu, 8 Nov 2018 00:35:54 +0000 (00:35 +0000)]
NFC: DebugInfo: Track the origin CU rather than just the base address for range lists

Turns out knowing more than just the base address might be useful -
specifically a future change to respect a DICompileUnit flag for the use
of base address specifiers in DWARF < 5.

llvm-svn: 346380

6 years ago[MachineOutliner][NFC] Only map blocks which have adjacent legal instructions
Jessica Paquette [Thu, 8 Nov 2018 00:33:38 +0000 (00:33 +0000)]
[MachineOutliner][NFC] Only map blocks which have adjacent legal instructions

If a block doesn't have any ranges of adjacent legal instructions, then it
can't have outlining candidates. There's no point in mapping legal isntructions
in situations like this.

I noticed this reduces the size of the suffix tree in sqlite3 for AArch64 at
-Oz by about 3%.

llvm-svn: 346379

6 years ago[clang] Set CMP0075 to new
Shoaib Meenai [Thu, 8 Nov 2018 00:29:33 +0000 (00:29 +0000)]
[clang] Set CMP0075 to new

Make the check_include_file* macros honor CMAKE_REQUIRED_LIBRARIES. This
shouldn't cause any of the configuration checks to give different
results, and I verified that a clean configure before and after this
change resulted in identical CMake caches on my machine. The same change
was done for LLVM in r346377.

llvm-svn: 346378

6 years ago[cmake] Set CMP0075 to NEW
Shoaib Meenai [Thu, 8 Nov 2018 00:18:12 +0000 (00:18 +0000)]
[cmake] Set CMP0075 to NEW

Make the check_include_file* macros honor CMAKE_REQUIRED_LIBRARIES. This
shouldn't cause any of the configuration checks to give different
results (and I did clean configures before and after this change and
confirmed that the resulting CMake caches were identical, though of
course that's just one machine). This suppresses a warning when building
with CMake 3.12 or later.

This doesn't suppress the warning in clang, because clang does its own
cmake_minimum_required call even when being built in-tree, and that
resets all policy settings. I'll address that separately.

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

llvm-svn: 346377

6 years ago[AMDGPU] Extend promote alloca vectorization
Stanislav Mekhanoshin [Thu, 8 Nov 2018 00:16:23 +0000 (00:16 +0000)]
[AMDGPU] Extend promote alloca vectorization

Promote alloca can vectorize a small array by bitcasting it to a
vector type. Extend vectorization for the case when alloca is
already a vector type. We still want to replace GEPs with an
insert/extract element instructions in this case.

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

llvm-svn: 346376

6 years ago[FileSystem] Add convenience method to check for directories.
Jonas Devlieghere [Thu, 8 Nov 2018 00:14:50 +0000 (00:14 +0000)]
[FileSystem] Add convenience method to check for directories.

Replace calls to LLVM's is_directory with calls to LLDB's FileSytem
class. For this I introduced a new convenience method that, like the
other methods, takes either a path or filespec. This still uses the LLVM
functions under the hood.

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

llvm-svn: 346375

6 years ago[MSP430] Add MC layer
Anton Korobeynikov [Thu, 8 Nov 2018 00:03:45 +0000 (00:03 +0000)]
[MSP430] Add MC layer

Summary:
This change implements assembler parser, code emitter, ELF object writer
and disassembler for the MSP430 ISA.  Also, more instruction forms are added
to the target description.

Reviewers: asl

Reviewed By: asl

Subscribers: pftbest, krisb, mgorny, llvm-commits

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

llvm-svn: 346374

6 years ago[MachineOutliner][NFC] Don't map MBBs that don't contain legal instructions
Jessica Paquette [Thu, 8 Nov 2018 00:02:11 +0000 (00:02 +0000)]
[MachineOutliner][NFC] Don't map MBBs that don't contain legal instructions

I noticed that there are lots of basic blocks that don't have enough legal
instructions in them to warrant outlining. We can skip mapping these entirely.

In sqlite3, compiled for AArch64 at -Oz, this results in a 10% reduction of
the total nodes in the suffix tree. These nodes can never be part of a
repeated substring, and so they don't impact the result at all.

Before this, there were 62128 nodes in the tree for sqlite3. After this, there
are 56457 nodes.

llvm-svn: 346373

6 years agoExtend virtual file system with `isLocal` method
Jonas Devlieghere [Thu, 8 Nov 2018 00:01:32 +0000 (00:01 +0000)]
Extend virtual file system with `isLocal` method

Expose the `llvm::sys::fs::is_local` function through the VFS.

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

llvm-svn: 346372

6 years ago[llvm-readobj] Implement LLVM style printer for --notes
Jordan Rupprecht [Wed, 7 Nov 2018 23:53:50 +0000 (23:53 +0000)]
[llvm-readobj] Implement LLVM style printer for --notes

Summary:
Port the GNU style printNotes method to the LLVMStyle subclass.

This is basically just a heavy refactor so that the note parsing/formatting logic from the GNUStyle::printNotes can be shared with LLVMStyle::printNotes.

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: dschuff, fedor.sergeev, llvm-commits

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

llvm-svn: 346371

6 years ago[PGO] Exit early if all count values are zero
Rong Xu [Wed, 7 Nov 2018 23:51:20 +0000 (23:51 +0000)]
[PGO] Exit early if all count values are zero

If all the edge counts for a function are zero, skip count population and
annotation, as nothing will happen. This can save some compile time.

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

llvm-svn: 346370

6 years agoFix -Wimplicit-fallthrough warning
Fangrui Song [Wed, 7 Nov 2018 23:51:13 +0000 (23:51 +0000)]
Fix -Wimplicit-fallthrough warning

Reviewers: EricWF, ldionne, mclow.lists

Reviewed By: ldionne

Subscribers: christof, libcxx-commits

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

llvm-svn: 346369

6 years agoAdd 'REQUIRES: default_triple' to test/CodeGen/MIR/X86/zero-probability.mir
Daniel Sanders [Wed, 7 Nov 2018 23:33:55 +0000 (23:33 +0000)]
Add 'REQUIRES: default_triple' to test/CodeGen/MIR/X86/zero-probability.mir

llvm-svn: 346368

6 years agoReorder FindPythonInterp so that config-ix can use PYTHON_EXECUTABLE
Nathan Lanza [Wed, 7 Nov 2018 23:22:09 +0000 (23:22 +0000)]
Reorder FindPythonInterp so that config-ix can use PYTHON_EXECUTABLE

Summary:
Code in config-ix tries to call `PYTHON_EXECUTABLE` to search for some
python modules but that variable isn't set until the moved chunk of
code that finds Python is called.

Reorder it so CMake can use PYTHON_EXECUTABLE

Subscribers: mgorny, llvm-commits

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

llvm-svn: 346367

6 years ago[AArch64] [Windows] Address post-commit review comment on r346358.
Eli Friedman [Wed, 7 Nov 2018 22:30:56 +0000 (22:30 +0000)]
[AArch64] [Windows] Address post-commit review comment on r346358.

In this context, usesWindowsCFI() is basically the same thing as
isOSWindows(), but it makes the relevant property of the target
more explicit.

llvm-svn: 346366

6 years agoAdd parentheses to silence warning.
Jorge Gorbe Moya [Wed, 7 Nov 2018 22:30:01 +0000 (22:30 +0000)]
Add parentheses to silence warning.

DWARFContext.cpp:356:20: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]

llvm-svn: 346365

6 years agoRevert "AMDGPU: Divergence-driven selection of scalar buffer load intrinsics"
Nicolai Haehnle [Wed, 7 Nov 2018 21:53:43 +0000 (21:53 +0000)]
Revert "AMDGPU: Divergence-driven selection of scalar buffer load intrinsics"

This reverts commit r344696 for now (except for some test additions).

See https://bugs.freedesktop.org/show_bug.cgi?id=108611.

llvm-svn: 346364

6 years agoAMDGPU/InsertWaitcnts: Cleanup some old cruft (NFCI)
Nicolai Haehnle [Wed, 7 Nov 2018 21:53:36 +0000 (21:53 +0000)]
AMDGPU/InsertWaitcnts: Cleanup some old cruft (NFCI)

Summary: Remove redundant logic and simplify control flow.

Reviewers: msearles, rampitec, scott.linder, kanarayan

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

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

llvm-svn: 346363

6 years agoAMDGPU/InsertWaitcnts: Remove kill-related logic
Nicolai Haehnle [Wed, 7 Nov 2018 21:53:29 +0000 (21:53 +0000)]
AMDGPU/InsertWaitcnts: Remove kill-related logic

Summary:
This is not needed, because we don't actually insert relevant branches
for KILLs that late in the compilation flow.

Besides, this was always checking for the wrong kill opcode anyway...

Reviewers: msearles, rampitec, scott.linder, kanarayan

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

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

llvm-svn: 346362

6 years agoAMDGPU/NFC: Split FLAT_Global_Atomic_Pseudo into RTN/NO_RTN multiclasses
Konstantin Zhuravlyov [Wed, 7 Nov 2018 21:42:13 +0000 (21:42 +0000)]
AMDGPU/NFC: Split FLAT_Global_Atomic_Pseudo into RTN/NO_RTN multiclasses

llvm-svn: 346361

6 years ago[DWARFv5] Read and dump multiple .debug_info sections.
Paul Robinson [Wed, 7 Nov 2018 21:39:09 +0000 (21:39 +0000)]
[DWARFv5] Read and dump multiple .debug_info sections.
Type units go in .debug_info comdats, not .debug_types, in v5.

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

llvm-svn: 346360

6 years agoFix spelling error
Adrian Prantl [Wed, 7 Nov 2018 21:34:33 +0000 (21:34 +0000)]
Fix spelling error

llvm-svn: 346359

6 years ago[AArch64] [Windows] Trap after noreturn calls.
Eli Friedman [Wed, 7 Nov 2018 21:31:14 +0000 (21:31 +0000)]
[AArch64] [Windows] Trap after noreturn calls.

Like the comment says, this isn't the most efficient fix in terms of
codesize, but it works.

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

llvm-svn: 346358

6 years agoAMDGPU/NFC: Split MUBUF_Pseudo_Atomics into RTN/NO_RTN multiclasses
Konstantin Zhuravlyov [Wed, 7 Nov 2018 21:21:32 +0000 (21:21 +0000)]
AMDGPU/NFC: Split MUBUF_Pseudo_Atomics into RTN/NO_RTN multiclasses

llvm-svn: 346357

6 years ago[PPC64] Use INT32_MIN instead of std::numeric_limits<int32_t>::min()
Fangrui Song [Wed, 7 Nov 2018 21:14:54 +0000 (21:14 +0000)]
[PPC64] Use INT32_MIN instead of std::numeric_limits<int32_t>::min()

Summary:
D53821 fixed the bogus MSVC (at least 2017) C4146 warning (unary minus applied on unsigned type)
by using std::numeric_limits<int32_t>::min().
The warning was because -2147483648 is incorrectly treated as unsigned long instead of long long)

Let's use INT32_MIN which is arguably more readable.
Note, on GCC or clang, -0x80000000 works fine (ILP64: long, LP64: long long).

Reviewers: ruiu, jhenderson, sfertile, espindola

Reviewed By: sfertile

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

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

llvm-svn: 346356

6 years ago[ARM] Fix CPSR liveness in tMOVCCr_pseudo lowering.
Eli Friedman [Wed, 7 Nov 2018 21:08:13 +0000 (21:08 +0000)]
[ARM] Fix CPSR liveness in tMOVCCr_pseudo lowering.

The lowering was missing live-ins in certain cases, like a sequence of
multiple tMOVCCr_pseudo instructions.  This would lead to a verifier
failure, and on pre-v6 Thumb CPSR would be incorrectly clobbered.

For reasons I don't completely understand, it's hard to get a sequence
of multiple tMOVCCr_pseudo instructions; the issue only seems to show up
with 64-bit comparisons where the result is zero-extended. I added some
extra testcases in case that changes in the future. Probably some
optimization opportunities here if anyone is interested. (@test_slt_not
is the case that was getting miscompiled.)

The code to check the liveness of CPSR was stolen from
X86ISelLowering.cpp; maybe it could be refactored into common helper,
but I have no idea where to put it.

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

llvm-svn: 346355

6 years agoAMDGPU/Docs: Add product names for Vega20
Konstantin Zhuravlyov [Wed, 7 Nov 2018 20:54:16 +0000 (20:54 +0000)]
AMDGPU/Docs: Add product names for Vega20

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

llvm-svn: 346354

6 years agoAllow subclassing ExternalAA
Matt Arsenault [Wed, 7 Nov 2018 20:26:42 +0000 (20:26 +0000)]
Allow subclassing ExternalAA

This allows testing AMDGPU alias analysis like any
other alias analysis pass. This fixes the existing
test pointlessly running opt -O3 when it really
just wants to run the one analysis.

Before there was no way to test this using -aa-eval
with opt, since the default constructed pass
is run. The wrapper subclass allows the
default constructor to pass the necessary callback.

llvm-svn: 346353

6 years agoSplit lgammal() from INIT_LGAMMAL
Kamil Rytarowski [Wed, 7 Nov 2018 20:19:53 +0000 (20:19 +0000)]
Split lgammal() from INIT_LGAMMAL

Summary:
Introduce SANITIZER_INTERCEPT_LGAMMAL
dedicated for lgammal(). Disable it for NetBSD
as this routine is not implemented in this OS.

Installation of supernumerary interceptors causes
leaking of errors to dlsym(3)-like operations.

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 346352

6 years agoSplit remquol() from INIT_REMQUO
Kamil Rytarowski [Wed, 7 Nov 2018 20:18:36 +0000 (20:18 +0000)]
Split remquol() from INIT_REMQUO

Summary:
Introduce SANITIZER_INTERCEPT_REMQUOL
dedicated for remquol(). Disable for for NetBSD
as this routine is not implemented in this OS.

Installation of supernumerary interceptors causes
leaking of errors to dlsym(3)-like operations.

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 346351

6 years ago[SimpleLoopUnswitch] partial unswitch needs to be careful when replacing invariants...
Fedor Sergeev [Wed, 7 Nov 2018 20:05:11 +0000 (20:05 +0000)]
[SimpleLoopUnswitch] partial unswitch needs to be careful when replacing invariants with constants

When partial unswitch operates on multiple conditions at once, .e.g:
   if (Cond1 || Cond2 || NonInv) ...

it should infer (and replace) values for individual conditions only on one
side of unswitch and not another.

More precisely only these derivations hold true:
   (Cond1 || Cond2) == false  =>  Cond1 == Cond2 == false
   (Cond1 && Cond2) == true   =>  Cond1 == Cond2 == true

By the way we organize unswitching it means only replacing on "continue" blocks
and never on "unswitched" ones. Since trivial unswitch does not have "unswitched"
blocks it does not have this problem.

Fixes PR 39568.

Reviewers: chandlerc, asbirlea
Differential Revision: https://reviews.llvm.org/D54211

llvm-svn: 346350

6 years ago[MachineOutliner][NFC] Remove Parent field from SuffixTreeNode
Jessica Paquette [Wed, 7 Nov 2018 19:56:13 +0000 (19:56 +0000)]
[MachineOutliner][NFC] Remove Parent field from SuffixTreeNode

This is only used for calculating ConcatLen. This isn't necessary,
since it's easily derived from the traversal setting suffix indices.

Remove that. Rename CurrIdx to CurrNodeLen to better describe what's
going on.

llvm-svn: 346349

6 years ago[Support] Fix line width to 80
Martin Elshuber [Wed, 7 Nov 2018 19:35:04 +0000 (19:35 +0000)]
[Support] Fix line width to 80

Test commit

llvm-svn: 346348

6 years agoRe-commit regularization of the lldb-gtest-build target.
Jason Molenda [Wed, 7 Nov 2018 19:28:03 +0000 (19:28 +0000)]
Re-commit regularization of the lldb-gtest-build target.

llvm-svn: 346347

6 years agoAdjust some id bit shifts to fit inside 32 bit integers
Nathan Lanza [Wed, 7 Nov 2018 19:27:36 +0000 (19:27 +0000)]
Adjust some id bit shifts to fit inside 32 bit integers

Summary:
The DAP on vscode uses a JavaScript `number` for identifiers while the
Visual Studio version uses a C# `Int` for identifiers. lldb-vscode is
bit shifting identifiers 32 bits and then bitwise ORing another 32 bit
identifier into a 64 bit id to form a unique ID. Change this to
a a partitioning of the 32 bits that makes sense for the data types.

Reviewers: clayborg

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

llvm-svn: 346346

6 years ago[MachineOutliner][NFC] Traverse suffix tree using a RepeatedSubstring iterator
Jessica Paquette [Wed, 7 Nov 2018 19:20:55 +0000 (19:20 +0000)]
[MachineOutliner][NFC] Traverse suffix tree using a RepeatedSubstring iterator

This takes the traversal methods introduced in r346269 and adapts them
into an iterator. This allows the outliner to iterate over repeated substrings
within the suffix tree directly without having to initially find all of the
substrings and then iterate over them after you've found them.

llvm-svn: 346345

6 years ago[llvm-mca] Move the AssembleInput logic into its own class.
Matt Davis [Wed, 7 Nov 2018 19:20:04 +0000 (19:20 +0000)]
[llvm-mca] Move the AssembleInput logic into its own class.

Summary:
This patch introduces a CodeRegionGenerator class which is responsible for parsing some type of input and creating a 'CodeRegions' instance for use by llvm-mca.  In the future, we will also have a CodeRegionGenerator subclass for converting an input object file into CodeRegions.  For now, we only have the subclass for converting input assembly into CodeRegions.

This is mostly a NFC patch, as the logic remains close to the original, but now encapsulated in its own class and moved outside of llvm-mca.cpp.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb

Subscribers: mgorny, tschuett, gbedwell, llvm-commits

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

llvm-svn: 346344