platform/upstream/llvm.git
4 years agoChange clang option -ffp-model=precise to select ffp-contract=on
Melanie Blower [Tue, 11 Feb 2020 20:39:53 +0000 (12:39 -0800)]
Change clang option -ffp-model=precise to select ffp-contract=on

Reviewers: rjmccall

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

4 years ago[ConstantFold][SVE] Fix constand fold for vector call.
Huihui Zhang [Tue, 11 Feb 2020 22:04:45 +0000 (14:04 -0800)]
[ConstantFold][SVE] Fix constand fold for vector call.

Summary:
Do not iterate on scalable vectors.

Reviewers: sdesmalen, efriedma, apazos, huntergr, willlovett

Reviewed By: sdesmalen

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[xray][clang] Always add xray-skip-entry/exit and xray-ignore-loops attrs
Ian Levesque [Tue, 11 Feb 2020 21:52:45 +0000 (13:52 -0800)]
[xray][clang] Always add xray-skip-entry/exit and xray-ignore-loops attrs

The function attributes xray-skip-entry, xray-skip-exit, and
xray-ignore-loops were only being applied if a function had an
xray-instrument attribute, but they should apply if xray is enabled
globally too.

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

4 years ago[mlir][AffineOps] Adds affine loop fusion transformation function to LoopFusionUtils.
Andy Davis [Tue, 11 Feb 2020 21:30:49 +0000 (13:30 -0800)]
[mlir][AffineOps] Adds affine loop fusion transformation function to LoopFusionUtils.

Summary:
Adds affine loop fusion transformation function to LoopFusionUtils.
Updates TestLoopFusion utility to run loop fusion transformation until a fixed point is reached.
Adds unit tests to test the transformation.
Includes ASAN bug fix for D73190.

Reviewers: bondhugula, dcaballe

Reviewed By: bondhugula, dcaballe

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[compiler-rt] FuzzedDataProvider: add ConsumeData and method.
Max Moroz [Mon, 10 Feb 2020 22:25:00 +0000 (14:25 -0800)]
[compiler-rt] FuzzedDataProvider: add ConsumeData and method.

Reviewers: metzman

Subscribers: dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[Hexagon] Don't generate short vectors in ISD::SELECT in preprocessing
Krzysztof Parzyszek [Tue, 11 Feb 2020 21:17:22 +0000 (15:17 -0600)]
[Hexagon] Don't generate short vectors in ISD::SELECT in preprocessing

Selection DAG preprocessing runs long after legalization, so make sure
that the types can be handled by the selection code.

4 years ago[DebugInfo] Call site entries cannot be generated for FrameSetup calls
lewis-revill [Tue, 11 Feb 2020 21:23:18 +0000 (21:23 +0000)]
[DebugInfo] Call site entries cannot be generated for FrameSetup calls

Instructions marked as FrameSetup do not cause requestLabelAfterInsn to
be called and so no such label is generated. Call instructions which
require call site entries to be generated require this label to be
present in order to calculate the return PC offset/address, but the
check for whether the call instruction is marked as FrameSetup was not
present.

Therefore in the case where a call instruction is marked as FrameSetup,
an assertion failure occurs if a call site entry is to be generated.
This is the case with RISC-V's implementation of save/restore via
library calls.

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

4 years ago[RISCV] Add support for save/restore of callee-saved registers via libcalls
lewis-revill [Tue, 11 Feb 2020 21:23:03 +0000 (21:23 +0000)]
[RISCV] Add support for save/restore of callee-saved registers via libcalls

This patch adds the support required for using the __riscv_save and
__riscv_restore libcalls to implement a size-optimization for prologue
and epilogue code, whereby the spill and restore code of callee-saved
registers is implemented by common functions to reduce code duplication.

Logic is also included to ensure that if both this optimization and
shrink wrapping are enabled then the prologue and epilogue code can be
safely inserted into the basic blocks chosen by shrink wrapping.

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

4 years ago[Attributor][NFC] Clarify the documentation a bit more
Johannes Doerfert [Tue, 11 Feb 2020 21:11:32 +0000 (15:11 -0600)]
[Attributor][NFC] Clarify the documentation a bit more

4 years ago[Attributor] Identify dead uses in PHIs (almost) based on dead edges
Johannes Doerfert [Tue, 11 Feb 2020 06:10:35 +0000 (00:10 -0600)]
[Attributor] Identify dead uses in PHIs (almost) based on dead edges

As an approximation to a dead edge we can check if the terminator is
dead. If so, the corresponding operand use in a PHI node is dead even if
the PHI node itself is not.

4 years ago[mlir][VectorOps] Adds canonicalization rewrite patterns for vector ShapeCastOp.
Andy Davis [Tue, 11 Feb 2020 20:57:57 +0000 (12:57 -0800)]
[mlir][VectorOps] Adds canonicalization rewrite patterns for vector ShapeCastOp.

Summary:
Adds two rewrite patterns for the vector ShapeCastOp.
*) ShapeCastOp decomposer: decomposes ShapeCastOp on tuple-of-vectors to multiple ShapeCastOps each on vector types.
*) ShapeCastOp folder: folds canceling shape cast ops (e.g. shape_cast A -> B followed by shape_cast B -> A) away.

Reviewers: nicolasvasilache, aartbik

Reviewed By: nicolasvasilache

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[NFC] Delete extra white space in a test case.
Steven Wan [Tue, 11 Feb 2020 20:58:32 +0000 (15:58 -0500)]
[NFC] Delete extra white space in a test case.

Remove an extra empty line in one of the AIX driver test cases.

4 years ago[ORC] Fix symbol dependence propagation algorithm in ObjectLinkingLayer.
Lang Hames [Tue, 11 Feb 2020 17:02:22 +0000 (09:02 -0800)]
[ORC] Fix symbol dependence propagation algorithm in ObjectLinkingLayer.

ObjectLinkingLayer was not correctly propagating dependencies through local
symbols within an object. This could cause symbol lookup to return before a
searched-for symbol is ready if the following conditions are met:
(1) The definition of the symbol being searched for transitively depends on a
    local symbol within the same object, and that local symbol in turn
    transitively depends on an external symbol provided by some other module
    in the JIT.
(2) Concurrent compilation is enabled.
(3) Thread scheduling causes the lookup of the searched-for symbol to return
    before all transitive dependencies of the looked-up symbol are emitted.

This bug was found by inspection and has not been observed in practice.

A jitlink test case has been added to verify that symbol dependencies are
correctly propagated through local symbol definitions.

4 years ago[JITLink] Add an assertion that block removal leaves no dangling symbols.
Lang Hames [Tue, 11 Feb 2020 16:51:45 +0000 (08:51 -0800)]
[JITLink] Add an assertion that block removal leaves no dangling symbols.

4 years ago[ORC] Add debug logging to JITDylib::addDependencies.
Lang Hames [Tue, 11 Feb 2020 17:14:44 +0000 (09:14 -0800)]
[ORC] Add debug logging to JITDylib::addDependencies.

4 years ago[OPENMP50]Full handling of atomic_default_mem_order in requires
Alexey Bataev [Tue, 11 Feb 2020 20:15:21 +0000 (15:15 -0500)]
[OPENMP50]Full handling of atomic_default_mem_order in requires
directive.

According to OpenMP 5.0, The atomic_default_mem_order clause specifies the default memory ordering behavior for atomic constructs that must be provided by an implementation. If the default memory ordering is specified as seq_cst, all atomic constructs on which memory-order-clause is not specified behave as if the seq_cst clause appears. If the default memory ordering is specified as relaxed, all atomic constructs on which memory-order-clause is not specified behave as if the relaxed clause appears.
If the default memory ordering is specified as acq_rel, atomic constructs on which memory-order-clause is not specified behave as if the release clause appears if the atomic write or atomic update operation is specified, as if the acquire clause appears if the atomic read operation is specified, and as if the acq_rel clause appears if the atomic captured update operation is specified.

4 years agoUpdate test for windows.
Sterling Augustine [Tue, 11 Feb 2020 20:35:10 +0000 (12:35 -0800)]
Update test for windows.

4 years agoscudo: Fix various test failures, mostly on 32-bit.
Peter Collingbourne [Tue, 11 Feb 2020 19:28:16 +0000 (11:28 -0800)]
scudo: Fix various test failures, mostly on 32-bit.

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

4 years ago[AMDGPU] Fix implicit operands for ENTER_WWM pseudo
Jay Foad [Tue, 11 Feb 2020 19:12:48 +0000 (19:12 +0000)]
[AMDGPU] Fix implicit operands for ENTER_WWM pseudo

Summary:
SIInstrInfo::expandPostRAPseudo converts ENTER_WWM in-place into an
S_OR_SAVEEXEC instruction that needs certain implicit operands. Without
this patch I get errors like this that make it harder to use -stop-after
to bisect the pass pipeline:

$ llc -march=amdgcn test/CodeGen/AMDGPU/wqm.ll -stop-after=postrapseudos -o - | sed -E 's/ (from|into) custom "TargetCustom[0-9]+"//' | llc -march=amdgcn -x=mir
error: <stdin>:1295:70: missing implicit register operand 'implicit-def $scc'
    renamable $sgpr2_sgpr3 = S_OR_SAVEEXEC_B64 -1, implicit-def $exec
                                                                     ^

Note that this error is currently only generated by MIParser but it
comes with a FIXME comment:

// FIXME: Move the implicit operand verification to the machine verifier.

Reviewers: critson, arsenm, rampitec, nhaehnle

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

Tags: #llvm

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

4 years ago[libc++] Unbreak test suite (CWG1423)
David Zarzycki [Tue, 11 Feb 2020 19:58:05 +0000 (14:58 -0500)]
[libc++] Unbreak test suite (CWG1423)

clang 9ce6dc9872be4081fb98f6161c28581e1cbbe7dc drops support for
implicit conversion of nullptr_t to bool. From that commit:

    The C++ rules briefly allowed this, but the rule changed nearly 10
    years ago and we never updated our implementation to match. However,
    we've warned on this by default for a long time, and no other compiler
    accepts (even as an extension).

4 years agoAllow retrieving source files relative to the compilation directory.
Sterling Augustine [Fri, 24 Jan 2020 22:36:22 +0000 (14:36 -0800)]
Allow retrieving source files relative to the compilation directory.

Summary:
Dwarf stores source-file names the three parts:
<compilation_directory><include_directory><filename>

Prior to this change, the code only allowed retrieving either all
three as the absolute path, or just the filename.  But many
compile-command lines--especially those in hermetic build systems
don't specify an absolute path, nor just the filename, but rather the
path relative to the compilation directory. This features allows
retrieving them in that style.

Add tests for path printing styles.

Modify createBasicPrologue to handle include directories.

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[NFC] Refactor the tuple of symbol information with structure for llvm-objdump
diggerlin [Tue, 11 Feb 2020 19:41:24 +0000 (14:41 -0500)]
[NFC] Refactor the tuple of symbol information with structure for llvm-objdump

SUMMARY:

address  the comment of
https://reviews.llvm.org/D74240#inline-676127
https://reviews.llvm.org/D74240#inline-675875

Reviewers: daltenty, jason liu, xiangling liao
Subscribers: wuzish, nemanjai, hiraditya

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

4 years ago[gn] Paper over Py3 urllib2 incompatibility in gn/get.py
Reid Kleckner [Wed, 22 Jan 2020 22:31:12 +0000 (14:31 -0800)]
[gn] Paper over Py3 urllib2 incompatibility in gn/get.py

Tested with both Python 2.7 and Python 3.7.

Reviewed By: thakis

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

4 years ago[lldb][NFC] Test ModuleCompletion mode by completing the target modules load argument
Raphael Isemann [Tue, 11 Feb 2020 19:37:26 +0000 (20:37 +0100)]
[lldb][NFC] Test ModuleCompletion mode by completing the target modules load argument

4 years ago[clang-tidy] Added check to disable bugprone-infinite-loop on known false condition
Nathan James [Tue, 11 Feb 2020 19:35:41 +0000 (19:35 +0000)]
[clang-tidy] Added check to disable bugprone-infinite-loop on known false condition

Summary: Addresses [[ https://bugs.llvm.org/show_bug.cgi?id=44816 | bugprone-infinite-loop false positive with CATCH2 ]] by disabling the check on loops where the condition is known to always eval as false, in other words not a loop.

Reviewers: aaron.ballman, alexfh, hokein, gribozavr2, JonasToth

Reviewed By: gribozavr2

Subscribers: xazax.hun, cfe-commits

Tags: #clang, #clang-tools-extra

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

4 years ago[mlir] [VectorOps] Implement vector.reduce operation
aartbik [Tue, 11 Feb 2020 19:09:14 +0000 (11:09 -0800)]
[mlir] [VectorOps] Implement vector.reduce operation

Summary:
This new operation operates on 1-D vectors and
forms the bridge between vector.contract and
llvm intrinsics for vector reductions.

Reviewers: nicolasvasilache, andydavis1, ftynse

Reviewed By: nicolasvasilache

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[BasicAA] Make BasicAA a cfg pass.
Alina Sbirlea [Fri, 7 Feb 2020 18:15:59 +0000 (10:15 -0800)]
[BasicAA] Make BasicAA a cfg pass.

Summary:
Part of the changes in D44564 made BasicAA not CFG only due to it using
PhiAnalysisValues which may have values invalidated.
Subsequent patches (rL340613) appear to have addressed this limitation.

BasicAA should not be invalidated by non-CFG-altering passes.
A concrete example is MemCpyOpt which preserves CFG, but we are testing
it invalidates BasicAA.

llvm-dev RFC: https://groups.google.com/forum/#!topic/llvm-dev/eSPXuWnNfzM

Reviewers: john.brawn, sebpop, hfinkel, brzycki

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[X86] Raise the latency for VectorImul from 4 to 5 in Skylake scheduler models
Craig Topper [Tue, 11 Feb 2020 19:04:47 +0000 (11:04 -0800)]
[X86] Raise the latency for VectorImul from 4 to 5 in Skylake scheduler models

Based on uops.info these should have 5 cycle latency as they did on Haswell/Broadwell. I have no additional internal information from Intel.

This was also shown as a discrepancy in the spreadsheet that was sent with an early llvm-dev post about llvm-exegesis.
It also matches Agner Fog.

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

4 years ago[gn build] Port 453a8f3af78
LLVM GN Syncbot [Tue, 11 Feb 2020 19:14:15 +0000 (19:14 +0000)]
[gn build] Port 453a8f3af78

4 years ago[AMDGPU] Remove AMDGPURegisterInfo
Stanislav Mekhanoshin [Tue, 11 Feb 2020 18:55:14 +0000 (10:55 -0800)]
[AMDGPU] Remove AMDGPURegisterInfo

R600 and GCN do not have anything in common in terms of register
file organization anymore.

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

4 years ago[lldb][NFC] Test SourceFileCompletion by completing the target line-table argument
Raphael Isemann [Tue, 11 Feb 2020 18:59:21 +0000 (19:59 +0100)]
[lldb][NFC] Test SourceFileCompletion by completing the target line-table argument

4 years ago[Polly] LLVM OpenMP Backend -- Fix "static chunked" scheduling.
Michael Halkenhäuser [Tue, 11 Feb 2020 18:46:31 +0000 (12:46 -0600)]
[Polly] LLVM OpenMP Backend -- Fix "static chunked" scheduling.

Static chunked OpenMP scheduling has not been treated correctly.
This patch fixes the problem that threads would not process their
(work-)chunks as intended.

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

4 years agoRestore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP"
Teresa Johnson [Thu, 6 Feb 2020 18:54:15 +0000 (10:54 -0800)]
Restore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP"

This restores commit 748bb5a0f1964d20dfb3891b0948ab6c66236c70, along
with a fix for a Chromium test suite build issue (and a new test for
that case).

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

4 years ago[Hexagon] Fix ABI info for returning HVX vectors
Krzysztof Parzyszek [Tue, 11 Feb 2020 17:06:21 +0000 (11:06 -0600)]
[Hexagon] Fix ABI info for returning HVX vectors

4 years ago[llvm][TextAPI] add simulators to output
Cyndy Ishida [Tue, 11 Feb 2020 18:31:54 +0000 (10:31 -0800)]
[llvm][TextAPI] add simulators to output

Summary:
* for <= tbd_v3, simulator platforms appear the same as the real
platform and we distinct the difference from the architecture.

fixes: rdar://problem/59161559

Reviewers: ributzka, steven_wu

Reviewed By: ributzka

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years agoUse std::foo_t rather than std::foo in clang.
Justin Lebar [Tue, 11 Feb 2020 07:23:44 +0000 (23:23 -0800)]
Use std::foo_t rather than std::foo in clang.

Summary: No functional change.

Reviewers: bkramer, MaskRay, martong, shafik

Subscribers: martong, cfe-commits

Tags: #clang

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

4 years agoFix SFINAE in CFG.cpp.
Justin Lebar [Tue, 11 Feb 2020 06:52:00 +0000 (22:52 -0800)]
Fix SFINAE in CFG.cpp.

Summary: Used std::enable_if without ::type.

Reviewers: bkramer, MaskRay

Subscribers: martong, cfe-commits

Tags: #clang

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

4 years ago[mlir] Turn flags in ConvertStandardToLLVM into pass flags
Diego Caballero [Tue, 11 Feb 2020 17:38:34 +0000 (09:38 -0800)]
[mlir] Turn flags in ConvertStandardToLLVM into pass flags

Follow-up on D72802. Turn -convert-std-to-llvm-use-alloca and
-convert-std-to-llvm-bare-ptr-memref-call-conv into pass flags
of LLVMLoweringPass.

Reviewed By: mehdi_amini

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

4 years ago[NFC] Fix unused var in release builds
Jordan Rupprecht [Tue, 11 Feb 2020 18:10:52 +0000 (10:10 -0800)]
[NFC] Fix unused var in release builds

4 years agogn build: Make scudo cflags more consistent with the cmake build.
Peter Collingbourne [Tue, 11 Feb 2020 18:03:35 +0000 (10:03 -0800)]
gn build: Make scudo cflags more consistent with the cmake build.

4 years ago[lldb][test] Remove symlink for API tests.
Jordan Rupprecht [Tue, 11 Feb 2020 18:01:16 +0000 (10:01 -0800)]
[lldb][test] Remove symlink for API tests.

Summary: Moves lldbsuite tests to lldb/test/API.

This is a largely mechanical change, moved with the following steps:

```
rm lldb/test/API/testcases
mkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}}
mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runner
for d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done
```

lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure.

Reviewers: labath, JDevlieghere

Tags: #lldb

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

4 years ago[BPF] implement isTruncateFree and isZExtFree in BPFTargetLowering
Yonghong Song [Wed, 5 Feb 2020 18:27:43 +0000 (10:27 -0800)]
[BPF] implement isTruncateFree and isZExtFree in BPFTargetLowering

Currently, isTruncateFree() and isZExtFree() callbacks return false
as they are not implemented in BPF backend. This may cause suboptimal
code generation. For example, if the load in the context of zero extension
has more than one use, the pattern zextload{i8,i16,i32} will
not be generated. Rather, the load will be matched first and
then the result is zero extended.

For example, in the test together with this commit, we have
   I1: %0 = load i32, i32* %data_end1, align 4, !tbaa !2
   I2: %conv = zext i32 %0 to i64
   ...
   I3: %2 = load i32, i32* %data, align 4, !tbaa !7
   I4: %conv2 = zext i32 %2 to i64
   ...
   I5: %4 = trunc i64 %sub.ptr.lhs.cast to i32
   I6: %conv13 = sub i32 %4, %2
   ...

The I1 and I2 will match to one zextloadi32 DAG node, where SUBREG_TO_REG is
used to convert a 32bit register to 64bit one. During code generation,
SUBREG_TO_REG is a noop.

The %2 in I3 is used in both I4 and I6. If isTruncateFree() is false,
the current implementation will generate a SLL_ri and SRL_ri
for the zext part during lowering.

This patch implement isTruncateFree() in the BPF backend, so for the
above example, I3 and I4 will generate a zextloadi32 DAG node with
SUBREG_TO_REG is generated during lowering to Machine IR.

isZExtFree() is also implemented as it should help code gen as well.

This patch also enables the change in https://reviews.llvm.org/D73985
since it won't kick in generates MOV_32_64 machine instruction.

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

4 years ago[lldb][NFC] Remove support file searching from SourceFileCompleter
Raphael Isemann [Tue, 11 Feb 2020 17:44:02 +0000 (18:44 +0100)]
[lldb][NFC] Remove support file searching from SourceFileCompleter

This code seems wrong as the directory variable actually contains
the file name. It's also unreachable code as m_include_support_files
is hardcoded to false which is the condition for the surrounding 'if
statement'. Let's just remove all of this.

4 years ago[DirectoryWatcher] Fix misuse of FSEvents API and data race
Ben Langmuir [Tue, 11 Feb 2020 01:22:52 +0000 (17:22 -0800)]
[DirectoryWatcher] Fix misuse of FSEvents API and data race

I observed two bugs in the DirectoryWatcher on macOS

1. We were calling FSEventStreamStop and FSEventStreamInvalidate before
we called FSEventStreamStart and FSEventStreamSetDispatchQueue, if the
DirectoryWatcher was destroyed before the initial async work was done.
This violates the requirements of the FSEvents API.

2. Calls to Receiver could race between the initial work and the
invalidation during destruction.

The second issue is easier to see when using TSan.

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

rdar://59215667

4 years ago[Attributor][NFC] Improve documentation
Johannes Doerfert [Tue, 11 Feb 2020 17:19:34 +0000 (11:19 -0600)]
[Attributor][NFC] Improve documentation

4 years ago[CodingStandards] Add link to "Picking the Right Data Structure"
Johannes Doerfert [Tue, 11 Feb 2020 17:06:04 +0000 (11:06 -0600)]
[CodingStandards] Add link to "Picking the Right Data Structure"

See https://reviews.llvm.org/D74340

4 years ago[Attributor] Return uses do not free pointers
Johannes Doerfert [Fri, 10 Jan 2020 20:49:45 +0000 (14:49 -0600)]
[Attributor] Return uses do not free pointers

If a pointer is returned that does not mean it is freed in the current
(function) scope. We can ignore such uses in AANoFree.

4 years ago[Attributor][FIX] Remove duplicate, half-broken functionality
Johannes Doerfert [Sun, 12 Jan 2020 06:17:08 +0000 (00:17 -0600)]
[Attributor][FIX] Remove duplicate, half-broken functionality

The changeXXXAfterManifest functions are better suited to deal with
changes so we should prefer them. These functions also recursively
delete dead instructions which is why we see test changes.

4 years ago[Attributor][NFC] Improve debug message
Johannes Doerfert [Sun, 12 Jan 2020 05:36:17 +0000 (23:36 -0600)]
[Attributor][NFC] Improve debug message

4 years ago[OPENMP50]Add support for relaxed clause in atomic directive.
Alexey Bataev [Tue, 11 Feb 2020 16:10:43 +0000 (11:10 -0500)]
[OPENMP50]Add support for relaxed clause in atomic directive.

Added full support for relaxed clause.

4 years ago[IRBuilder] Remove more unnecessary NoFolder methods
Nikita Popov [Tue, 11 Feb 2020 16:41:32 +0000 (17:41 +0100)]
[IRBuilder] Remove more unnecessary NoFolder methods

Split out from D73835. I removed some of these before, but missed
these ones. They are not part of the ConstantFolder interface
and are not going to be used by the IRBuilder.

4 years ago[InstCombine] Use replaceOperand() in more places
Nikita Popov [Mon, 3 Feb 2020 20:17:36 +0000 (21:17 +0100)]
[InstCombine] Use replaceOperand() in more places

This is a followup to D73803, which uses the replaceOperand()
helper in more places.

This should be NFC apart from changes to worklist order.

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

4 years agoFix errors/warnings in scudo build.
Peter Collingbourne [Tue, 11 Feb 2020 16:29:16 +0000 (08:29 -0800)]
Fix errors/warnings in scudo build.

4 years ago[SystemZ] Fix new test case for expensive checks.
Jonas Paulsson [Tue, 11 Feb 2020 16:28:10 +0000 (11:28 -0500)]
[SystemZ]  Fix new test case for expensive checks.

It needs 'tracksRegLiveness: true' to pass the machine verifier.

4 years ago[X86CmovConversion] Make heuristic for optimized cmov depth more conservative (PR44539)
Nikita Popov [Thu, 6 Feb 2020 20:16:10 +0000 (21:16 +0100)]
[X86CmovConversion] Make heuristic for optimized cmov depth more conservative (PR44539)

Fix/workaround for https://bugs.llvm.org/show_bug.cgi?id=44539.
As discussed there, this pass makes some overly optimistic
assumptions, as it does not have access to actual branch weights.

This patch makes the computation of the depth of the optimized cmov
more conservative, by assuming a distribution of 75/25 rather than
50/50 and placing the weights to get the more conservative result
(larger depth). The fully conservative choice would be
std::max(TrueOpDepth, FalseOpDepth), but that would break at least
one existing test (which may or may not be an issue in practice).

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

4 years ago[libc++] Make sure that vector copy-construction is disabled for non-copyable types
Louis Dionne [Tue, 11 Feb 2020 16:11:00 +0000 (17:11 +0100)]
[libc++] Make sure that vector copy-construction is disabled for non-copyable types

The Standard requires the value_type of the vector to be Cpp17CopyInsertable
in order for copy-construction to be enabled:

http://eel.is/c++draft/container.requirements#tab:container.req

rdar://problem/56674564

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

4 years ago[test][DebugInfo][NFC] Fix line endings
James Henderson [Tue, 11 Feb 2020 16:10:56 +0000 (16:10 +0000)]
[test][DebugInfo][NFC] Fix line endings

4 years ago[ms] [llvm-ml] Add support for attempted register parsing
Eric Astor [Tue, 11 Feb 2020 14:18:08 +0000 (09:18 -0500)]
[ms] [llvm-ml] Add support for attempted register parsing

Summary:
Add a new method (tryParseRegister) that attempts to parse a register specification.

MASM allows the use of IFDEF <register>, as well as IFDEF <symbol>. To accommodate this, we make it possible to check whether a register specification can be parsed at the current location, without failing the entire parse if it can't.

Reviewers: thakis

Reviewed By: thakis

Tags: #llvm

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

4 years ago[SystemZ] Bugfix in emitSelect()
Jonas Paulsson [Mon, 10 Feb 2020 20:08:23 +0000 (21:08 +0100)]
[SystemZ]  Bugfix in emitSelect()

When more than one SelectPseudo instruction is handled a new MBB is
returned. This must not be done if that would result in leaving an undhandled
isel pseudo behind in the original MBB.

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

Review: Ulrich Weigand

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

4 years agoUse C++14-style return type deduction in LLVM.
Justin Lebar [Mon, 10 Feb 2020 23:49:14 +0000 (15:49 -0800)]
Use C++14-style return type deduction in LLVM.

Summary:
Simplifies the C++11-style "-> decltype(...)" return-type deduction.

Note that you have to be careful about whether the function return type
is `auto` or `decltype(auto)`.  The difference is that bare `auto`
strips const and reference, just like lambda return type deduction.  In
some cases that's what we want (or more likely, we know that the return
type is a value type), but whenever we're wrapping a templated function
which might return a reference, we need to be sure that the return type
is decltype(auto).

No functional change.

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

4 years agoFix SFINAE in JSON.h constructor.
Justin Lebar [Tue, 11 Feb 2020 03:38:44 +0000 (19:38 -0800)]
Fix SFINAE in JSON.h constructor.

Summary:
This used std::enable_if without referencing ::type.  Changed to use
std::enable_if_t.

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[SCCP] Remove forcedconstant, go to overdefined instead
Florian Hahn [Tue, 11 Feb 2020 15:06:59 +0000 (15:06 +0000)]
[SCCP] Remove forcedconstant, go to overdefined instead

This patch removes forcedconstant to simplify things for the
move to ValueLattice, which includes constant ranges, but no
forced constants.

This patch removes forcedconstant and changes ResolvedUndefsIn
to mark instructions with unknown operands as overdefined. This
means we do not do simplifications based on undef directly in SCCP
any longer, but this seems to hardly come up in practice (see stats
below), presumably because InstCombine & others take care
of most of the relevant folds already.

It is still beneficial to keep ResolvedUndefIn, as it allows us delaying
going to overdefined until we propagated all known information.

I also built MultiSource, SPEC2000 and SPEC2006 and compared
sccp.IPNumInstRemoved and sccp.NumInstRemoved. It looks like the impact
is quite low:

Tests: 244
Same hash: 238 (filtered out)
Remaining: 6
Metric: sccp.IPNumInstRemoved

Program                                        base     patch    diff
 test-suite...arks/VersaBench/dbms/dbms.test     4.00    3.00  -25.0%
 test-suite...TimberWolfMC/timberwolfmc.test    38.00   34.00  -10.5%
 test-suite...006/453.povray/453.povray.test   158.00  155.00  -1.9%
 test-suite.../CINT2000/176.gcc/176.gcc.test   668.00  668.00   0.0%
 test-suite.../CINT2006/403.gcc/403.gcc.test   1209.00 1209.00  0.0%
 test-suite...arks/mafft/pairlocalalign.test    76.00   76.00   0.0%

Tests: 244
Same hash: 238 (filtered out)
Remaining: 6
Metric: sccp.NumInstRemoved

Program                                        base    patch     diff
 test-suite...arks/mafft/pairlocalalign.test   185.00  175.00  -5.4%
 test-suite.../CINT2006/403.gcc/403.gcc.test   2059.00 2056.00 -0.1%
 test-suite.../CINT2000/176.gcc/176.gcc.test   2358.00 2357.00 -0.0%
 test-suite...006/453.povray/453.povray.test   317.00  317.00   0.0%
 test-suite...TimberWolfMC/timberwolfmc.test    12.00   12.00   0.0%

Reviewers: davide, efriedma, mssimpso

Reviewed By: efriedma

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

4 years ago[ARM][MVE] Tail-Predication: recognise (again) active lanes IR pattern
Sjoerd Meijer [Tue, 11 Feb 2020 15:14:54 +0000 (15:14 +0000)]
[ARM][MVE] Tail-Predication: recognise (again) active lanes IR pattern

A small IR change in calculating the active lanes resulted in no longer
recognising tail-predication. Now recognise both an 'add' and 'or' in
the expression that calculates the active lanes.

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

4 years ago[Clang][Driver] After default -fintegrated-cc1, make llvm::report_fatal_error() gener...
Alexandre Ganea [Tue, 11 Feb 2020 15:17:15 +0000 (10:17 -0500)]
[Clang][Driver] After default -fintegrated-cc1, make llvm::report_fatal_error() generate preprocessed source + reproducer.sh again.

Added a test for #pragma clang __debug llvm_fatal_error to test for the original issue.
Added llvm::sys::Process::Exit() and replaced ::exit() in places where it was appropriate. This new function would call the current CrashRecoveryContext if one is running on the same thread; or call ::exit() otherwise.

Fixes PR44705.

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

4 years ago[OPENMP50]Add restrictions for memory order clauses in atomic directive.
Alexey Bataev [Tue, 11 Feb 2020 14:35:52 +0000 (09:35 -0500)]
[OPENMP50]Add restrictions for memory order clauses in atomic directive.

Added restrictions for atomic directive.
1. If atomic-clause is read then memory-order-clause must not be acq_rel or release.
2. If atomic-clause is write then memory-order-clause must not be
   acq_rel or acquire.
3. If atomic-clause is update or not present then memory-order-clause
   must not be acq_rel or acquire.

4 years ago[mlir][ods] Added RankedIntElementsAttr class
Joonsoo Jeon [Tue, 11 Feb 2020 14:38:14 +0000 (09:38 -0500)]
[mlir][ods] Added RankedIntElementsAttr class

Defines a tablegen class RankedIntElementsAttr. This is an integer
version of RankedFloatElementsAttr.

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

4 years agoCWG1423: don't permit implicit conversion of nullptr_t to bool.
Richard Smith [Tue, 11 Feb 2020 14:09:18 +0000 (06:09 -0800)]
CWG1423: don't permit implicit conversion of nullptr_t to bool.

The C++ rules briefly allowed this, but the rule changed nearly 10 years
ago and we never updated our implementation to match. However, we've
warned on this by default for a long time, and no other compiler accepts
(even as an extension).

4 years agoP1957R2: conversion from a pointer to bool is considered narrowing.
Richard Smith [Mon, 10 Feb 2020 15:22:51 +0000 (07:22 -0800)]
P1957R2: conversion from a pointer to bool is considered narrowing.

This is being implemented somewhat speculatively, to match GCC's
behavior.

4 years ago[RISCV] Optimize seteq/setne pattern expansions for better code size
Andrew Wei [Tue, 11 Feb 2020 14:42:45 +0000 (22:42 +0800)]
[RISCV] Optimize seteq/setne pattern expansions for better code size

ADDI(C.ADDI) may achieve better code size than XORI, since XORI has no C extension.
This patch transforms two patterns and gets almost equivalent results.

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

4 years agoRevert "[DSE] Add first version of MemorySSA-backed DSE (Bottom up walk)."
Kadir Cetinkaya [Tue, 11 Feb 2020 14:26:15 +0000 (15:26 +0100)]
Revert "[DSE] Add first version of MemorySSA-backed DSE (Bottom up walk)."

This reverts commit d0c4d4fe0929098a98d9fb20c5e5e19d71341517.

Revert "[DSE,MSSA] Move more passing test cases from todo to simple.ll."

This reverts commit 02266e64bb6dacf76f3aa510df4b59f66d834b1f.

Revert "[DSE,MSSA] Adjust mda-with-dbg-values.ll to MSSA backed DSE."

This reverts commit 74f03e4ff0c1f11c29102329af95f7d9782426dc.

4 years ago[clangd] Expose completion range in code completion results (C++ API)
Sam McCall [Mon, 10 Feb 2020 10:52:42 +0000 (11:52 +0100)]
[clangd] Expose completion range in code completion results (C++ API)

Summary:
Informative only, useful for positioning UI, interacting with other sources of
completion etc. As requested by an embedder of clangd.

Reviewers: usaxena95

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

Tags: #clang

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

4 years ago[MLIR][GPU] Disallow llvm tanh intrinsics when lowering to NVVM/ROCm.
Stephan Herhut [Tue, 11 Feb 2020 09:20:55 +0000 (10:20 +0100)]
[MLIR][GPU] Disallow llvm tanh intrinsics when lowering to NVVM/ROCm.

Summary:
The lowering to NVVM and ROCm handles tanh operations differently by
mapping them to NVVM/ROCm specific intrinsics. This conflicts with
the lowering to LLVM, which uses the default llvm intrinsic. This change
declares the LLVM intrinsics to be illegal, hence disallowing the
correspondign rewrite.

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

4 years ago[NFC] [lldb] Remove unused declaration
Jan Kratochvil [Tue, 11 Feb 2020 13:54:23 +0000 (14:54 +0100)]
[NFC] [lldb] Remove unused declaration

ObjectFileELF::GetSectionIndexByType declaration without definition was
added by commit 17220c188635721e948cf02d2b6ad36b267ea393.

4 years ago[libc++] Disable a filesystem test that uses debug mode with the macOS system libc++
Louis Dionne [Tue, 11 Feb 2020 13:47:53 +0000 (14:47 +0100)]
[libc++] Disable a filesystem test that uses debug mode with the macOS system libc++

The system libc++.dylib doesn't support the debug mode, so this test
can't be supported. As a fly-by fix, we also specify more stringently
that only the macOS system library is unsupported in other tests using
the debug mode.

4 years ago[X86] combineConcatVectorOps - reuse IsSplat and remove duplicate code. NFC.
Simon Pilgrim [Tue, 11 Feb 2020 13:37:44 +0000 (13:37 +0000)]
[X86] combineConcatVectorOps - reuse IsSplat and remove duplicate code. NFC.

4 years ago[VectorCombine] remove unused debug counter; NFC
Sanjay Patel [Mon, 10 Feb 2020 22:49:48 +0000 (17:49 -0500)]
[VectorCombine] remove unused debug counter; NFC

The variable was added to the initial commit via copy/paste of existing
code, but it wasn't actually used in the code. We can add it back with
the proper usage if/when that is needed.

4 years ago[lldb][NFC] Remove the CppVirtualMadness test
Raphael Isemann [Tue, 11 Feb 2020 13:09:55 +0000 (14:09 +0100)]
[lldb][NFC] Remove the CppVirtualMadness test

We now have a virtual-functions test and a multiple-inheritance test that
are testing the same functionality (and more) using the newer test functions which
we have in LLDB these days. These tests should also be less flaky and
less dependent on other unrelated LLDB functionality.

4 years ago[mlir] StdToLLVM: add a separate test for the new memref calling convention
Alex Zinenko [Tue, 11 Feb 2020 12:54:55 +0000 (13:54 +0100)]
[mlir] StdToLLVM: add a separate test for the new memref calling convention

4 years ago[libc++][macOS CI] Ensure that the SDK version is not older than the deployment target
Louis Dionne [Tue, 11 Feb 2020 12:50:38 +0000 (13:50 +0100)]
[libc++][macOS CI] Ensure that the SDK version is not older than the deployment target

4 years ago[lldb][NFC] Remove ConstString -> const char * -> StringRef conversions when calling...
Raphael Isemann [Tue, 11 Feb 2020 12:31:00 +0000 (13:31 +0100)]
[lldb][NFC] Remove ConstString -> const char * -> StringRef conversions when calling Stream::Indent

Let's just pass in a StringRef and save the strlen call when rebuilding the StringRef parameter.

4 years ago[mlir] Use the first location in the fused location for diagnostic handler
Feng Liu [Tue, 11 Feb 2020 12:33:38 +0000 (07:33 -0500)]
[mlir] Use the first location in the fused location for diagnostic handler

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

4 years ago[lldb] Add test for multiple inheritance
Raphael Isemann [Tue, 11 Feb 2020 11:48:37 +0000 (12:48 +0100)]
[lldb] Add test for multiple inheritance

4 years ago[lldb][NFC] Remove Stream::Indent(const char *) overload in favor of the StringRef...
Raphael Isemann [Tue, 11 Feb 2020 12:04:48 +0000 (13:04 +0100)]
[lldb][NFC] Remove Stream::Indent(const char *) overload in favor of the StringRef version

4 years ago[lldb] Delete the SharingPtr class
Pavel Labath [Tue, 4 Feb 2020 02:05:21 +0000 (18:05 -0800)]
[lldb] Delete the SharingPtr class

Summary:
The only use of this class was to implement the SharedCluster of ValueObjects.
However, the same functionality can be implemented using a regular
std::shared_ptr, and its little-known "sub-object pointer" feature, where the
pointer can point to one thing, but actually delete something else when it goes
out of scope.

This patch reimplements SharedCluster using this feature --
SharedClusterPointer::GetObject now returns a std::shared_pointer which points
to the ValueObject, but actually owns the whole cluster. The only change I
needed to make here is that now the SharedCluster object needs to be created
before the root ValueObject. This means that all private ValueObject
constructors get a ClusterManager argument, and their static Create functions do
the create-a-manager-and-pass-it-to-value-object dance.

Reviewers: teemperor, JDevlieghere, jingham

Subscribers: mgorny, jfb, lldb-commits

Tags: #lldb

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

4 years ago[X86][SSE] lowerShuffleAsBitRotate - lower to vXi8 shuffles to ROTL on pre-SSSE3...
Simon Pilgrim [Tue, 11 Feb 2020 11:59:17 +0000 (11:59 +0000)]
[X86][SSE] lowerShuffleAsBitRotate - lower to vXi8 shuffles to ROTL on pre-SSSE3 targets

Without PSHUFB we are better using ROTL (expanding to OR(SHL,SRL)) than using the generic v16i8 shuffle lowering - but if we can widen to v8i16 or more then the existing shuffles are still the better option.

4 years ago[ARM][MVE] Fix a corner case of checking for MVE-I with -mfpu=none
Momchil Velikov [Tue, 11 Feb 2020 12:01:17 +0000 (12:01 +0000)]
[ARM][MVE] Fix a corner case of checking for MVE-I with -mfpu=none

-march=armv8.1-m.main+mve.fp+nomve -mfpu=none should disable FP
registers and instructions moving to/from FP registers.

This patch fixes the case when "+mve" (added to the feature list by
"+mve.fp"), is followed by "-mve" (added by "+nomve").

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

4 years ago[clang-format] Improve handling of C# attributes
Jonathan Coe [Mon, 10 Feb 2020 08:17:42 +0000 (08:17 +0000)]
[clang-format] Improve handling of C# attributes

Summary:
C# attributes can appear on classes and methods, in which case they should go on their own line, or on method parameters in which case
they should be left inline.

Reviewers: krasimir, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: klimek

Tags: #clang-format

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

4 years ago[Debuginfo][NFC] Rename error handling functions using the same pattern.
Alexey Lapshin [Mon, 10 Feb 2020 20:57:01 +0000 (23:57 +0300)]
[Debuginfo][NFC] Rename error handling functions using the same pattern.

Summary:
That patch is extracted from https://reviews.llvm.org/D74308.
Currently there are two patterns to name error handling functions:
using "Callback" and "Handler". This patch uses "Handler" for all
usage places.

Reviewers: jhenderson, dblaikie, probinson, aprantl

Reviewed By: jhenderson, dblaikie

Subscribers: hiraditya, llvm-commits

Tags: #llvm, #debug-info

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

4 years ago[compiler-rt] Restrict sanitizer_linux.cpp dlinfo(3) to FreeBSD
Kamil Rytarowski [Tue, 11 Feb 2020 09:57:16 +0000 (10:57 +0100)]
[compiler-rt] Restrict sanitizer_linux.cpp dlinfo(3) to FreeBSD

FreeBSD is currently the only user in this file.
Accessing this symbol on Linux does not work as is.

4 years ago[libc++] span: Fix incorrect return type of span::subspan
Louis Dionne [Tue, 11 Feb 2020 10:57:35 +0000 (11:57 +0100)]
[libc++] span: Fix incorrect return type of span::subspan

The extent of the returned span was always std::dynamic_extent, which
is incorrect.

Thanks to Michael Schellenberger Costa for the patch.

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

4 years ago[Mips] Add intrinsics for 4-byte and 8-byte MSA loads/stores.
Mirko Brkusanin [Tue, 11 Feb 2020 10:35:23 +0000 (11:35 +0100)]
[Mips] Add intrinsics for 4-byte and 8-byte MSA loads/stores.

New intrinisics are implemented for when we need to port SIMD code from other
arhitectures and only load or store portions of MSA registers.

Following intriniscs are added which only load/store element 0 of a vector:
v4i32 __builtin_msa_ldrq_w (const void *, imm_n2048_2044);
v2i64 __builtin_msa_ldr_d (const void *, imm_n4096_4088);
void __builtin_msa_strq_w (v4i32, void *, imm_n2048_2044);
void __builtin_msa_str_d (v2i64, void *, imm_n4096_4088);

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

4 years ago[lldb/test] Add alternate symbol to StackFrame Recognizer
Med Ismail Bennani [Mon, 10 Feb 2020 22:29:12 +0000 (23:29 +0100)]
[lldb/test] Add alternate symbol to StackFrame Recognizer

This reimplements commit 6b2979c12300b90a1e69791d43ee9cff14f4265e and updates
the tests to reflect the addition of the alternate symbol attribute.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
4 years ago[libcxx] span: Remove unneeded comparison
Louis Dionne [Tue, 11 Feb 2020 10:38:00 +0000 (11:38 +0100)]
[libcxx] span: Remove unneeded comparison

size_t is always greater than 0, so remove the artifact from the old
index_type.

Patch by Michael Schellenberger Costa.

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

4 years ago[lldb] Add test for calling overloaded virtual functions
Raphael Isemann [Tue, 11 Feb 2020 10:28:14 +0000 (11:28 +0100)]
[lldb] Add test for calling overloaded virtual functions

4 years ago[AArch64][SVE] Add SVE2 intrinsics for complex integer dot product
Kerry McLaughlin [Tue, 11 Feb 2020 10:09:27 +0000 (10:09 +0000)]
[AArch64][SVE] Add SVE2 intrinsics for complex integer dot product

Summary:
Implements the following intrinsics:
 - @llvm.aarch64.sve.cdot
 - @llvm.aarch64.sve.cdot.lane

Reviewers: sdesmalen, efriedma, dancgr, c-rhodes, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[DebugInfo][NFC] Fixup the UserValue methods to use FragmentInfo
OCHyams [Tue, 11 Feb 2020 10:07:03 +0000 (10:07 +0000)]
[DebugInfo][NFC] Fixup the UserValue methods to use FragmentInfo

Fixup the UserValue methods to use FragmentInfo instead of DIExpression because
the DIExpression is only ever used to get the to get the FragmentInfo. The
DIExpression is meaningless in the UserValue class because each definition point
added to a UserValue may have a unique DIExpression.

Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D74057

4 years ago[DebugInfo][NFC] Rename the class DbgValueLocation to DbgVariableValue
OCHyams [Tue, 11 Feb 2020 10:02:31 +0000 (10:02 +0000)]
[DebugInfo][NFC] Rename the class DbgValueLocation to DbgVariableValue

Rename the class DbgValueLocation to DbgVariableValue and instances from Loc to
DbgValue. These names better express the new semantics introduced in D74053.

The class previously represented a { Location } only. It now represents a
{ Location, DIExpression } pair which together describe a value.

Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D74055

4 years ago[DebugInfo] Teach LDV how to handle identical variable fragments
OCHyams [Tue, 11 Feb 2020 09:44:32 +0000 (09:44 +0000)]
[DebugInfo] Teach LDV how to handle identical variable fragments

LiveDebugVariables uses interval maps to explicitly represent DBG_VALUE
intervals. DBG_VALUEs are filtered into an interval map based on their {
Variable, DIExpression }. The interval map will coalesce adjacent entries that
use the same { Location }.  Under this model, DBG_VALUEs which refer to the same
bits of the same variable will be filtered into different interval maps if they
have different DIExpressions which means the original intervals will not be
properly preserved.

This patch fixes the problem by using { Variable, Fragment } to filter the
DBG_VALUEs into maps, and coalesces adjacent entries iff they have the same
{ Location, DIExpression } pair.

The solution is not perfect because we see the similar issues appear when
partially overlapping fragments are encountered, but is far simpler than a
complete solution (i.e. D70121).

Fixes: pr41992, pr43957
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D74053

4 years ago[libc++] span: Cleanup includes
Louis Dionne [Tue, 11 Feb 2020 10:16:40 +0000 (11:16 +0100)]
[libc++] span: Cleanup includes

Thanks to Michael Schellenberger Costa for the patch.

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

4 years ago[lldb] Add test for lldb_private::Stream's indentation functionality
Raphael Isemann [Tue, 11 Feb 2020 10:12:54 +0000 (11:12 +0100)]
[lldb] Add test for lldb_private::Stream's indentation functionality