platform/upstream/llvm.git
4 years ago[llvm/DWARF] Return section offset from DWARFUnit::get{Loc,Rng}listOffset
Pavel Labath [Wed, 4 Dec 2019 13:03:18 +0000 (14:03 +0100)]
[llvm/DWARF] Return section offset from DWARFUnit::get{Loc,Rng}listOffset

Summary:
Currently these function return the raw content of the appropriate table
header, which means they are relative to the DW_AT_{loc,rng}list_base,
and one has to relocate them in order to do anything.

This changes the functions to perform the relocation themselves, which
seems more clearer, particularly as they are sitting right next to the
find{Rng,Loc}listFromOffset functions, but one *cannot* simply take the
result of these functions and take pass them there.

The only effect of this patch is to change what value is dumped for the
DW_AT_ranges attribute, which I think is for the better, as previously
the values appeared to point into thin air.

(The main reason I am looking at this is because I was trying to
implement equivalent functionality in lldb's DWARFUnit, and was stumped
by this behavior.

Reviewers: dblaikie, JDevlieghere, aprantl

Subscribers: hiraditya, llvm-commits, SouraVX

Tags: #llvm

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

4 years ago[LiveDebugValues] Silence the unused var warning; NFC
Djordje Todorovic [Thu, 5 Dec 2019 11:21:51 +0000 (12:21 +0100)]
[LiveDebugValues] Silence the unused var warning; NFC

4 years ago[clangd] More unittests for cross-file rename.
Haojian Wu [Thu, 5 Dec 2019 11:08:31 +0000 (12:08 +0100)]
[clangd] More unittests for cross-file rename.

Summary:
The previous unittests for cross-file rename was kind of weak. With this
patch, we should have more test coverage, and it is easy to add more tests in
the future.

Reviewers: ilya-biryukov, kbobyrev

Reviewed By: ilya-biryukov

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

Tags: #clang

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

4 years ago[DebugInfo] Handle call site values for instructions before call bundle
David Stenberg [Thu, 5 Dec 2019 09:49:41 +0000 (10:49 +0100)]
[DebugInfo] Handle call site values for instructions before call bundle

Summary:
If a call is bundled then the code that looks for instructions that
produce parameter values would break when reaching the call's bundle
header, due to the `ifCall(/*AnyInBundle*/)` invocation returning true.

It is not enough to simply ignore bundle headers in the `isCall()`
invocation, as the bundle header may have defines of parameter registers
due to the call, meaning that such registers would incorrectly be
removed from the worklist. Therefore, do not look at bundle headers at
all.

Reviewers: djtodoro, NikolaPrica, aprantl, vsk

Reviewed By: aprantl, vsk

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

4 years agoFix the clang interpreter example which was broken by 4fc68b9b7f3e0.
Lang Hames [Thu, 5 Dec 2019 10:41:40 +0000 (02:41 -0800)]
Fix the clang interpreter example which was broken by 4fc68b9b7f3e0.

4 years ago[lldb] Don't put compile unit name into the support file list and support DWARF5...
Pavel Labath [Thu, 28 Nov 2019 09:19:23 +0000 (10:19 +0100)]
[lldb] Don't put compile unit name into the support file list and support DWARF5 line tables

Summary:
Lldb's "format-independent" debug info made use of the fact that DWARF
(<=4) did not use the file index zero, and reused the support file index
zero for storing the compile unit name.

While this provided some convenience for DWARF<=4, it meant that the PDB
plugin needed to artificially remap file indices in order to free up
index 0. Furthermore, DWARF v5 make file index 0 legal, which meant that
similar remapping would be needed in the dwarf plugin too.

What this patch does instead is remove the requirement of having the
compile unit name in the index 0. It is not that useful since the name
can always be fetched from the CompileUnit object. Remapping code in the
pdb plugin(s) has been removed or simplified.

DWARF plugin has started inserting an empty FileSpec at index 0 to
ensure the indices keep matching up (in case of DWARF<=4). For DWARF5,
we insert the file 0 from the line table.

I add a test to ensure we can correctly lookup line table entries
referencing file 0, and in particular the case where the file 0 is also
duplicated in another file entry, as this is how clang produces line
tables in some circumstances (see pr44170). Though this is probably a
bug in clang, this is not forbidden by DWARF, and lldb already has
support for that in some (but not all) cases -- this adds a test for the
code path which was not fixed in this patch.

Reviewers: clayborg, JDevlieghere, jdoerfert

Subscribers: aprantl, lldb-commits

Tags: #lldb

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

4 years ago[AArch64][SVE] Implement element count intrinsics
Cullen Rhodes [Thu, 5 Dec 2019 09:56:00 +0000 (09:56 +0000)]
[AArch64][SVE] Implement element count intrinsics

Summary:
Adds intrinsics for the following:

    * cntb
    * cnth
    * cntw
    * cntd
    * cntp

Reviewers: sdesmalen, huntergr, dancgr, rengolin, efriedma, rovka

Reviewed By: efriedma

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

Tags: #llvm

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

4 years ago[LLD][ELF][AArch64] .note.gnu.property sections should have alignment 8
Peter Smith [Fri, 29 Nov 2019 18:44:21 +0000 (18:44 +0000)]
[LLD][ELF][AArch64] .note.gnu.property sections should have alignment 8

The .note.gnu.property SHT_NOTE sections on AArch64 (a 64-bit target)
should have alignment 8 to more closely match the binutils implementation
where alignment is 4-bytes on 32-bit machines and 8-bytes on 64-bit
machines.

Previously LLD was using 4 for both 32-bit and 64-bit machines.

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

4 years agoReland "[LiveDebugValues] Introduce entry values of unmodified params"
Djordje Todorovic [Tue, 3 Dec 2019 13:18:02 +0000 (14:18 +0100)]
Reland "[LiveDebugValues] Introduce entry values of unmodified params"

Relanding this after resolving the cause of the test failure.

4 years ago[Checkers] Added support for freopen to StreamChecker.
Balázs Kéri [Wed, 4 Dec 2019 16:15:03 +0000 (17:15 +0100)]
[Checkers] Added support for freopen to StreamChecker.

Summary: Extend StreamChecker with a new evaluation function for API call 'freopen'.

Reviewers: NoQ, baloghadamsoftware, Szelethus, martong

Reviewed By: baloghadamsoftware, martong

Subscribers: martong, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

4 years ago[LLD][ELF] Add support for PT_GNU_PROPERTY
Peter Smith [Mon, 2 Dec 2019 18:34:56 +0000 (18:34 +0000)]
[LLD][ELF] Add support for PT_GNU_PROPERTY

The PT_GNU_PROPERTY program header describes the location of the
.note.gnu.property SHT_NOTES section. The linux kernel uses this program
header to find the .note.gnu.property section rather than parsing.
Executables that have properties that the kernel needs to act on that don't
have the PT_GNU_PROPERTY program header will not boot.

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

4 years ago[clangd] Fix an incorrect comment, NFC.
Haojian Wu [Thu, 5 Dec 2019 09:43:29 +0000 (10:43 +0100)]
[clangd] Fix an incorrect comment, NFC.

4 years ago[ORC] Remove the automagic Main JITDylib fram ExecutionSession.
Lang Hames [Thu, 5 Dec 2019 06:45:38 +0000 (22:45 -0800)]
[ORC] Remove the automagic Main JITDylib fram ExecutionSession.

This patch removes the magic "main" JITDylib from ExecutionEngine. The main
JITDylib was created automatically at ExecutionSession construction time, and
all subsequently created JITDylibs were added to the main JITDylib's
links-against list by default. This saves a couple of lines of boilerplate for
simple JIT setups, but this isn't worth introducing magical behavior for.

ORCv2 clients should now construct their own main JITDylib using
ExecutionSession::createJITDylib and set up its linkages manually using
JITDylib::setSearchOrder (or related methods in JITDylib).

4 years ago[MCRegInfo] Add forward sub and super register iterators. (NFC)
Florian Hahn [Thu, 5 Dec 2019 09:16:08 +0000 (09:16 +0000)]
[MCRegInfo] Add forward sub and super register iterators. (NFC)

This patch adds forward iterators mc_difflist_iterator,
mc_subreg_iterator and mc_superreg_iterator, based on the existing
DiffListIterator. Those are used to provide iterator ranges over
sub- and super-register from TRI, which are slightly more convenient
than the existing MCSubRegIterator/MCSuperRegIterator. Unfortunately,
it duplicates a bit of functionality, but the new iterators are a bit
more convenient (and can be used with various existing iterator
utilities)  and should probably replace the old iterators in the future.

This patch updates some existing users.

Reviewers: evandro, qcolombet, paquette, MatzeB, arsenm

Reviewed By: qcolombet

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

4 years ago[MIBundle] Turn MachineOperandIteratorBase into a forward iterator.
Florian Hahn [Thu, 5 Dec 2019 08:52:24 +0000 (08:52 +0000)]
[MIBundle] Turn MachineOperandIteratorBase into a forward iterator.

This patch turns MachineOperandIteratorBase into a regular forward
iterator, which can be used with iterator_range.

It also adds mi_bundle_ops and const_mi_bundle_ops that return iterator
ranges over all operands in a bundle and updates a use of the old
iterator.

Reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm

Reviewed By: arsenm

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

4 years agoAvoid triple corruption while merging core info
Muhammad Omair Javaid [Thu, 5 Dec 2019 08:04:04 +0000 (13:04 +0500)]
Avoid triple corruption while merging core info

Summary:
This patch fixes a bug where when target triple created from elf information
is arm-*-linux-eabihf and platform triple is armv8l-*-linux-gnueabihf. Merging
both triple results in armv8l--unknown-unknown.

This happens because we order a triple update while calling CoreUpdated and
CoreUpdated creates a new triple with no vendor or environment information.

Making sure we do not update triple and just update to more specific core
fixes the issue.

Reviewers: labath, jasonmolenda, clayborg

Reviewed By: jasonmolenda

Subscribers: jankratochvil, kristof.beyls, lldb-commits

Tags: #lldb

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

4 years ago[llvm-readelf/llvm-readobj] - Remove getSecTypeName() helper.
Georgii Rymar [Wed, 4 Dec 2019 15:29:01 +0000 (18:29 +0300)]
[llvm-readelf/llvm-readobj] - Remove getSecTypeName() helper.

We do not need it, we have
`object::getELFSectionTypeName` that can be used instead.

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

4 years agoFix the macro fusion table for X86 according to Intel optimization
Shengchen Kan [Thu, 5 Dec 2019 01:40:11 +0000 (09:40 +0800)]
Fix the macro fusion table for X86 according to Intel optimization
manual and add function isMacroFused

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

4 years agoReland [MachineCopyPropagation] Extend MCP to do trivial copy backward propagation.
Kai Luo [Thu, 5 Dec 2019 06:01:00 +0000 (14:01 +0800)]
Reland [MachineCopyPropagation] Extend MCP to do trivial copy backward propagation.

Fix assertion error
```
bool llvm::MachineOperand::isRenamable() const: Assertion `Register::isPhysicalRegister(getReg()) && "isRenamable should only be checked on physical registers"' failed.
```
by checking if the register is 0 before invoking `isRenamable`.

4 years agoRevert "Properly convert all declaration non-type template arguments when"
David L. Jones [Thu, 5 Dec 2019 06:08:38 +0000 (22:08 -0800)]
Revert "Properly convert all declaration non-type template arguments when"

This reverts commit 11d10527852b4d3ed738aa90d8bec0f398160593.

This change is problematic with function pointer template parameters. For
example, building libcxxabi with futexes (-D_LIBCXXABI_USE_FUTEX) produces this
diagnostic:

    In file included from .../llvm-project/libcxxabi/src/cxa_guard.cpp:15:
    .../llvm-project/libcxxabi/src/cxa_guard_impl.h:416:54: error: address of function 'PlatformThreadID' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
        has_thread_id_support(this->thread_id_address && GetThreadIDArg),
                                                      ~~ ^~~~~~~~~~~~~~
    .../llvm-project/libcxxabi/src/cxa_guard.cpp:38:26: note: in instantiation of member function '__cxxabiv1::(anonymous namespace)::InitByteFutex<&__cxxabiv1::(anonymous namespace)::PlatformFutexWait, &__cxxabiv1::(anonymous namespace)::PlatformFutexWake, &__cxxabiv1::(anonymous namespace)::PlatformThreadID>::InitByteFutex' requested here
      SelectedImplementation imp(raw_guard_object);
                             ^
    .../llvm-project/libcxxabi/src/cxa_guard_impl.h:416:54: note: prefix with the address-of operator to silence this warning
        has_thread_id_support(this->thread_id_address && GetThreadIDArg),
                                                         ^
                                                         &
    1 error generated.

The diagnostic is incorrect: adding the address-of operator also fails ("cannot
take the address of an rvalue of type 'uint32_t (*)()' (aka 'unsigned int
(*)()')").

4 years agoRevert "[MachineCopyPropagation] Extend MCP to do trivial copy backward propagation"
Kai Luo [Thu, 5 Dec 2019 04:48:37 +0000 (12:48 +0800)]
Revert "[MachineCopyPropagation] Extend MCP to do trivial copy backward propagation"

This reverts commit 75b3a1c318ccad0f96c38689279bc5db63e2ad05, since it
breaks bootstrap build.

4 years agoAdd a default copy-assignment or copy-constructor for -Wdeprecated-copy warnings.
Eric Christopher [Thu, 5 Dec 2019 04:34:56 +0000 (20:34 -0800)]
Add a default copy-assignment or copy-constructor for -Wdeprecated-copy warnings.

4 years ago[AArch64][SVE] Add intrinsics and patterns for logical predicate instructions
Danilo Carvalho Grael [Thu, 5 Dec 2019 02:45:59 +0000 (21:45 -0500)]
[AArch64][SVE] Add intrinsics and patterns for logical predicate instructions

Add instrinics and patters for the following logical predicate instructions:
-- and, ands, bic, bics, eor, eors
-- sel
-- orr, orrs, orn, orns, nor, nors, nand, nads

4 years ago[Signal] Allow one-shot SIGPIPE handler to be reached
Vedant Kumar [Thu, 5 Dec 2019 03:21:14 +0000 (19:21 -0800)]
[Signal] Allow one-shot SIGPIPE handler to be reached

As SIGPIPE is no longer in the IntSigs array, handle SIGPIPE before
handling any interrupt signals.

Thanks to Alexandre Ganea for pointing out the issue here.

4 years ago[fix][unittests][llvm] Fix running unit tests without assertions. [NFCI]
Francesco Petrogalli [Thu, 5 Dec 2019 03:23:31 +0000 (03:23 +0000)]
[fix][unittests][llvm] Fix running unit tests without assertions. [NFCI]

4 years ago[clangd] Add xref for macro to static index.
Utkarsh Saxena [Wed, 20 Nov 2019 14:18:54 +0000 (15:18 +0100)]
[clangd] Add xref for macro to static index.

Summary:
This adds the references for macros to the SymbolCollector (used for static index).
Enabled if `CollectMacro` option is set.

Reviewers: hokein

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

Tags: #clang

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

4 years ago[MachineCopyPropagation] Extend MCP to do trivial copy backward propagation
Kai Luo [Wed, 4 Dec 2019 03:19:50 +0000 (11:19 +0800)]
[MachineCopyPropagation] Extend MCP to do trivial copy backward propagation

Summary:
This patch mainly do such transformation
```
$R0 = OP ...
... // No read/clobber of $R0 and $R1
$R1 = COPY $R0 // $R0 is killed
```
Replace $R0 with $R1 and remove the COPY, we have
```
$R1 = OP ...
```
This transformation can also expose more opportunities for existing
copy elimination in MCP.

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

4 years agoProperly convert all declaration non-type template arguments when
Richard Smith [Thu, 5 Dec 2019 02:53:34 +0000 (18:53 -0800)]
Properly convert all declaration non-type template arguments when
forming non-type template parameter values.

4 years ago[c++17] Fix assert / wrong code when passing a noexcept pointer to
Richard Smith [Thu, 5 Dec 2019 01:31:58 +0000 (17:31 -0800)]
[c++17] Fix assert / wrong code when passing a noexcept pointer to
member function to a non-noexcept pointer to member non-type template
parameter.

4 years ago[lldb/Reproducers] Don't instrument SBFileSpec::GetPath
Jonas Devlieghere [Thu, 5 Dec 2019 01:51:23 +0000 (17:51 -0800)]
[lldb/Reproducers] Don't instrument SBFileSpec::GetPath

This method uses a char* and length as output arguments and the
reproducer instrumentation doesn't know how to deal with that (yet).

4 years ago[lldb/Reproducers] Add missing instrumentation for SBFile (2/2)
Jonas Devlieghere [Thu, 5 Dec 2019 01:49:34 +0000 (17:49 -0800)]
[lldb/Reproducers] Add missing instrumentation for SBFile (2/2)

Found another issue while running TestDefaultConstructorForAPIObjects.

4 years ago[X86] Remove override of shouldUseStrictFP_TO_INT for fp80. NFC
Craig Topper [Thu, 5 Dec 2019 01:44:32 +0000 (17:44 -0800)]
[X86] Remove override of shouldUseStrictFP_TO_INT for fp80. NFC

I suspect this became unnecessary after r354161. Prior to that
we may have been going through the default expansion of FP_TO_UINT
on 64-bit targets and then ending up back in Custom X86 handling
to handle the FP_TO_SINT for it. Now we just Custom handle the
FP_TO_UINT directly. We already need to handle it for 32-bit mode
during type legalization so we wouldn't save any code by using
the default expansion on 64-bit.

4 years agoClear out the python class name in OptionParsingStarted for the OptionGroupPythonClas...
Jim Ingham [Thu, 5 Dec 2019 01:40:57 +0000 (17:40 -0800)]
Clear out the python class name in OptionParsingStarted for the OptionGroupPythonClassWithDict
options class.  This value was hanging around so for instance if you made a scripted breakpoint
resolver, then went to set another breakpoint, it would still think you had passed in a class
name and the breakpoint wouldn't do what you expected.

4 years ago[lldb/Reproducers] Add missing instrumentation for SBFile
Jonas Devlieghere [Thu, 5 Dec 2019 01:37:08 +0000 (17:37 -0800)]
[lldb/Reproducers] Add missing instrumentation for SBFile

This was properly captured by the instrumentation framework when running
TestRunCommandInterpreterAPI.py in capture-mode.

4 years agoReland [AArch64][MachineOutliner] Return address signing for outlined functions
David Tellenbach [Thu, 5 Dec 2019 01:20:59 +0000 (02:20 +0100)]
Reland [AArch64][MachineOutliner] Return address signing for outlined functions

Summary:
Reland after fixing an ASan failure by stopping outlining early if the
constraints for return address signing removed too many outlining candidates.

During AArch64 frame lowering instructions to enable return address
signing are inserted into functions if needed. Functions generated during
machine outlining don't run through target frame lowering and hence are
missing such instructions.

This patch introduces the following changes:

1. If not all functions that potentially participate in function outlining agree
   on their return address signing scope and their return address signing key,
   outlining is disabled for these functions.
2. If not all functions that potentially participate in function outlining agree
   on their support for v8.3A features, outlining is disabled for these
   functions.
3. If an outlining candidate would outline instructions that modify sp in a way
   that invalidates return address signing, outlining is disabled for that
   particular candidate.
4. If all candidate functions agree on the signing scope, signing key and their
   support for v8.3 features, the outlined function behaves as if it had the
   same scope and key attributes and as if it would provide the same v8.3A
   support as the original functions.

Reviewers: ostannard, paquette

Reviewed By: ostannard

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[GlobalISel] Fix compiler crash lowering G_LOAD in AArch64.
Amara Emerson [Thu, 5 Dec 2019 01:01:07 +0000 (17:01 -0800)]
[GlobalISel] Fix compiler crash lowering G_LOAD in AArch64.

Patch by Daniel Rodríguez Troitiño.

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

4 years ago[clang][IFS] Ignoring -Xlinker/-Xclang arguments in InterfaceStubs pass for now.
Puyan Lotfi [Fri, 29 Nov 2019 06:38:25 +0000 (01:38 -0500)]
[clang][IFS] Ignoring -Xlinker/-Xclang arguments in InterfaceStubs pass for now.

Many of the inputs to clang driver toolchain tools can be things other
than files such as -Xclang and -Xlinker arguments. For now we don't take
such tool pass-through type arguments (although having an -Xifs would be nice to
have to replace things like -emit-merged-ifs). So because for the moment
we are not doing any sort of argument pass-through, I am going to have
InterfaceStubs Merger ignore any non-file type input arguments.

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

4 years agogn build: Merge 27f12444575
LLVM GN Syncbot [Thu, 5 Dec 2019 00:59:20 +0000 (00:59 +0000)]
gn build: Merge 27f12444575

4 years ago[clangd] Add a tweak refactoring to wrap Objective-C string literals in `NSLocalized...
Alex Lorenz [Thu, 5 Dec 2019 00:58:12 +0000 (16:58 -0800)]
[clangd]  Add a tweak refactoring to wrap Objective-C string literals in `NSLocalizedString` macros

The commit adds a refactoring to Clangd that mimics the existing refactoring action in Xcode that wraps around an Objective-C string literal in an NSLocalizedString macro.

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

4 years ago[clangd] NFC, add getLangOpts helper to ParsedAST
Alex Lorenz [Wed, 4 Dec 2019 23:09:35 +0000 (15:09 -0800)]
[clangd] NFC, add getLangOpts helper to ParsedAST

The addition of the helper is split out from https://reviews.llvm.org/D69543
as suggested by Kadir. I also updated the existing uses to use the new API.

4 years ago[lldb/Reproducers] Propagate LLDB_CAPTURE_REPRODUCER to the test suite
Jonas Devlieghere [Thu, 5 Dec 2019 00:43:19 +0000 (16:43 -0800)]
[lldb/Reproducers] Propagate LLDB_CAPTURE_REPRODUCER to the test suite

4 years ago[lldb/Reproducers] Override capture with LLDB_CAPTURE_REPRODUCER env var
Jonas Devlieghere [Thu, 5 Dec 2019 00:06:48 +0000 (16:06 -0800)]
[lldb/Reproducers] Override capture with LLDB_CAPTURE_REPRODUCER env var

Make it possible to override reproducer capture with the
LLDB_CAPTURE_REPRODUCER environment variable.

The goal of this change is twofold.

(1) I want to be able to enable capturing reproducers during regular
    test runs, both locally and on the bots. To do so I need a way to
    force capture. I cannot do this through the Python API, because
    reproducer capture must be enabled *before* the debugger
    initialized, which happens automatically when doing `import lldb`.

(2) I want to provide an escape hatch for when reproducers are enabled
    by default. Downstream we have reproducer capture enabled by default
    in the driver.

This patch solves both problems by overriding the reproducer mode based
on the environment variable. Acceptable values are 0/1 and ON/OFF.

4 years agoRevert "Reland [AArch64][MachineOutliner] Return address signing for outlined functions"
Sterling Augustine [Thu, 5 Dec 2019 00:27:26 +0000 (16:27 -0800)]
Revert "Reland [AArch64][MachineOutliner] Return address signing for outlined functions"

This reverts commit 02760b750b2ffcc0e2f5d78ecb137c80930c42c3.

The original commit is not asan clean.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/37147/steps/check-llvm%20asan/logs/stdio

4 years ago[analyzer] Fix more ObjC accessor body farms after 2073dd2d.
Artem Dergachev [Thu, 5 Dec 2019 00:26:16 +0000 (16:26 -0800)]
[analyzer] Fix more ObjC accessor body farms after 2073dd2d.

Fix a crash when constructing a body farm for accessors of a property
that is declared and @synthesize'd in different (but related) interfaces
with the explicit ivar syntax.

This is a follow-up for 0b58b80e.

4 years ago[clang][IFS] Adding support for new clang interface stubs decl types.
Puyan Lotfi [Tue, 26 Nov 2019 18:02:18 +0000 (13:02 -0500)]
[clang][IFS] Adding support for new clang interface stubs decl types.

NamespaceAliasDecl UnresolvedUsingTypenameDecl CXXDeductionGuideDecl
ConstructorUsingShadowDecl

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

4 years agoAdd parray example for lldb, vrs. *ptr@count gdb cmd.
Jason Molenda [Wed, 4 Dec 2019 23:43:38 +0000 (15:43 -0800)]
Add parray example for lldb, vrs. *ptr@count gdb cmd.

4 years ago[llvm] Fixing MIRVRegNamerUtils to properly handle 2+ MachineBasicBlocks.
Puyan Lotfi [Sun, 1 Dec 2019 00:00:10 +0000 (19:00 -0500)]
[llvm] Fixing MIRVRegNamerUtils to properly handle 2+ MachineBasicBlocks.

An interplay of code from D70210, along with code from the
Value-Numbering-esque hash-based namer from D70210, as well as some
crusty code from the original MIR-Canon code lead to multiple causes of
failure when canonicalizing or renaming vregs for MIR with multiple
basic blocks. This patch fixes those issues while deleting some no
longer needed code and adding a nice diamond test case to boot.

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

4 years agoAdd help text for parray and poarray aliases.
Jason Molenda [Wed, 4 Dec 2019 23:33:54 +0000 (15:33 -0800)]
Add help text for parray and poarray aliases.

4 years agoUpstream debugserver arm64e support.
Jason Molenda [Wed, 4 Dec 2019 23:20:56 +0000 (15:20 -0800)]
Upstream debugserver arm64e support.

The changes are minor; primarily debugserver needs to go through
accessor functions/macros when changing pc/fp/sp/lr, and debugserver
needs to clear any existing pointer auth bits from values in two
cases.  debugserver can fetch the number of bits used for addressing
from a sysctl, and will include that in the qHostInfo reply.  Update
qHostInfo documentation to document it.

4 years ago[llvm-symbolizer] Support debug file lookup using build ID
Petr Hosek [Wed, 27 Nov 2019 01:18:42 +0000 (17:18 -0800)]
[llvm-symbolizer] Support debug file lookup using build ID

Build ID is a protocol for looking up debug files that's already
supported by various tools including debuggers. For example, when
locating debug files, gdb would check the following directories:

- /usr/lib/debug/.build-id/ab/cdef1234.debug
- /usr/bin/ls.debug
- /usr/bin/.debug/ls.debug
- /usr/lib/debug/usr/bin/ls.debug

llvm-symbolizer currently consults all of these except for build ID
based one. This patch implements support for build ID lookup. The
set of debug directories to search is specified by the new option:
--debug-file-directory, whose name matches the debug-file-directory
variable used by gdb for the same purpose.

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

4 years ago[ThinLTO] Fix importing of writeonly variables in distributed ThinLTO
Teresa Johnson [Tue, 3 Dec 2019 20:22:51 +0000 (12:22 -0800)]
[ThinLTO] Fix importing of writeonly variables in distributed ThinLTO

Summary:
D69561/dde5893 enabled importing of readonly variables with references,
however, it introduced a bug relating to importing/internalization of
writeonly variables with references.

A fix for this was added in D70006/7f92d66. But this didn't work in
distributed ThinLTO mode. The reason is that the fix (importing the
writeonly var with a zeroinitializer) was only applied when there were
references on the writeonly var summary. In distributed ThinLTO mode,
where we only have a small slice of the index, we will not have the
references on the importing side if we are not importing those
referenced values. Rather than changing this handshaking (which will
require a lot of other changes, since that's how we know what to import
in the distributed backend clang invocation), we can simply always give
the writeonly variable a zero initializer.

Reviewers: evgeny777, steven_wu

Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

4 years agoRevert "[OpenMP50] Add parallel master construct, by Chi Chun Chen."
Reid Kleckner [Wed, 4 Dec 2019 22:50:06 +0000 (14:50 -0800)]
Revert "[OpenMP50] Add parallel master construct, by Chi Chun Chen."

This reverts commit 713dab21e27c987b9114547ce7136bac2e775de9.

Tests do not pass on Windows.

4 years agoBug 43965 - Value of _MSVC_LANG doesn't match MSVC++ VS2019 /std:c++latest mode
Soumi Manna [Wed, 4 Dec 2019 22:38:00 +0000 (14:38 -0800)]
Bug 43965 - Value of _MSVC_LANG doesn't match MSVC++ VS2019 /std:c++latest mode

Summary:
The patch adds correct value of _MSVC_LANG to match with MSVC++ VS2019 /std:c++latest mode.

    Bugzilla - Bug 43965
    https://bugs.llvm.org/show_bug.cgi?id=43965

    The value for a MS specific macro differs from Microsoft starting with VS2019 in /std:c++latest mode.

    -bash-4.2$ cat msvclang.cpp
    _MSVC_LANG

    -bash-4.2$ cl /std:c++latest -E msvclang.cpp
    Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27508.1 for x64
    Copyright (C) Microsoft Corporation.  All rights reserved.

    /std:c++latest is provided as a preview of language features from the latest C++
    working draft, and we're eager to hear about bugs and suggestions for improvements.
    However, note that these features are provided as-is without support, and subject
    to changes or removal as the working draft evolves. See
    https://go.microsoft.com/fwlink/?linkid=2045807 for details.

    msvclang.cpp

    201705L

    -bash-4.2$ clang-cl /std:c++latest -E  msvclang.cpp
    201704L

Reviewers: rnk

Reviewed By: rnk

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

4 years agoRevert "Add --strip-trailing-cr to compression tests so they pass on Windows."
Xiangling Liao [Wed, 4 Dec 2019 22:23:57 +0000 (17:23 -0500)]
Revert "Add --strip-trailing-cr to compression tests so they pass on Windows."

This reverts commit d6cbc9528d46d30416a6f9cd6c8570b704a0bd33.

It causes the tests to fail on AIX.

4 years ago[lit] Document the undocumented pre-defined substitutions
Daniel Sanders [Wed, 4 Dec 2019 22:24:51 +0000 (14:24 -0800)]
[lit] Document the undocumented pre-defined substitutions

4 years ago[compiler-rt] FuzzedDataProvider: do not call memcpy on empty vector.
Max Moroz [Wed, 4 Dec 2019 21:24:59 +0000 (13:24 -0800)]
[compiler-rt] FuzzedDataProvider: do not call memcpy on empty vector.

Summary:
Some versions of memcpy mark pointer arguments as __nonnull, that triggers UBSan
errors even when the length passed is 0.

Reviewers: manojgupta, metzman

Subscribers: dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

[compiler-rt] FDP: assert that num_bytes_to_consume == 0 when size == 0.

4 years ago[NFC][InstCombine] Autogenerate check lines in a few tests
Roman Lebedev [Wed, 4 Dec 2019 22:07:23 +0000 (01:07 +0300)]
[NFC][InstCombine] Autogenerate check lines in a few tests

These files are potentially affected by Negator (D68408) patch.

4 years ago[LLDB] Actually fix the win-i386-line-table.s test when executed on windows
Martin Storsjö [Wed, 4 Dec 2019 20:54:51 +0000 (22:54 +0200)]
[LLDB] Actually fix the win-i386-line-table.s test when executed on windows

The previous fix attempt, in 62a635e864e0, used too much escaping
for the backslashes.

But instead of using regexes to match both path separator forms,
remove the path altogether to unify the output from the testcase
between platforms.

4 years ago[DWARF5][Debuginfo] Compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compi...
Alexey Lapshin [Sat, 30 Nov 2019 20:48:32 +0000 (23:48 +0300)]
[DWARF5][Debuginfo] Compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit) do not match.

That patch fixes incompatible compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit) error.

cat split-dwarf.cpp
int main()
{
  int a = 1;
  return 0;
}

clang++ -O -g -gsplit-dwarf -gdwarf-5 split-dwarf.cpp; llvm-dwarfdump --verify ./a.out | grep skeleton
error: Compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit) do not match.

The fix is to change DW_TAG_compile_unit into DW_TAG_skeleton_unit when skeleton file is generated.

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

4 years agoAdd --strip-trailing-cr to compression tests so they pass on Windows.
Amy Huang [Wed, 4 Dec 2019 19:42:13 +0000 (11:42 -0800)]
Add --strip-trailing-cr to compression tests so they pass on Windows.

4 years ago[MIBundle] Remove unused/obsolete MIOperands/ConstMIOperands (NFC).
Florian Hahn [Wed, 4 Dec 2019 20:46:08 +0000 (20:46 +0000)]
[MIBundle] Remove unused/obsolete MIOperands/ConstMIOperands (NFC).

Those iterators are unused and the respective iterators from
MachineInstr should be used (e.g. MachineInstr::operands(),
https://llvm.org/doxygen/classllvm_1_1MachineInstr.html#aef0e7e42e45e15f86b2a122b56ab829c)

Reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm, ab

Reviewed By: ab

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

4 years ago[OPENMP50]Add support for if clause for simd part in taskloop simd
Alexey Bataev [Wed, 4 Dec 2019 14:50:21 +0000 (09:50 -0500)]
[OPENMP50]Add support for if clause for simd part in taskloop simd
directive.

According to OpenMP 5.0, the `if` clause can be applied to simd
subdirective in the combined directive.

4 years ago[VectorUtils] API for VFShape, update VFInfo.
Francesco Petrogalli [Wed, 20 Nov 2019 20:51:24 +0000 (20:51 +0000)]
[VectorUtils] API for VFShape, update VFInfo.

Summary:
This patch introduces an API to build and modify vector shapes.

The validity of a VFShape can be checked with the
`hasValidParameterList` method, which is also run in an assertion each
time a VFShape is modified.

The field VFISAKind has been moved to VFInfo under the assumption that
different ISAs can map to the same VFShape (as it can be in the case
of vector extensions with the same registers size, for example AVX and
AVX2).

Reviewers: sdesmalen, jdoerfert, simoll, hsaito

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[X86] Add missing break to the end of the last case in a switch. NFC
Craig Topper [Wed, 4 Dec 2019 20:12:22 +0000 (12:12 -0800)]
[X86] Add missing break to the end of the last case in a switch. NFC

4 years ago[LangRef] make per-element poison behavior explicit
Sanjay Patel [Wed, 4 Dec 2019 20:32:19 +0000 (15:32 -0500)]
[LangRef] make per-element poison behavior explicit

As discussed in D70246 and PR43958:
https://bugs.llvm.org/show_bug.cgi?id=43958

The LangRef seems ambiguous about the behavior of poison with respect
to vectors.

We could go further with text and/or examples - suggestions welcome.

Also, see discussion on llvm-dev;
http://lists.llvm.org/pipermail/llvm-dev/2019-November/137243.html

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

4 years agoRevert " Reapply af57dbf12e54 "Add support for options -frounding-math, ftrapp...
Melanie Blower [Wed, 4 Dec 2019 20:21:23 +0000 (12:21 -0800)]
Revert "        Reapply af57dbf12e54 "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior=""

This reverts commit cdbed2dd856c14687efd741c2d8321686102acb8.
Build break on Windows (lit fail)

4 years agoFix crash-on-invalid-code in lambda constant evaluation.
James Y Knight [Wed, 4 Dec 2019 04:32:57 +0000 (23:32 -0500)]
Fix crash-on-invalid-code in lambda constant evaluation.

If the lambda used 'this' without without capturing it, an error was
emitted, but the constant evaluator would still attempt to lookup the
capture, and failing to find it, dereference a null pointer.

This only happens in C++17 (as that's when lambdas were made
potentially-constexpr). Therefore, I also updated the
lambda-expressions.cpp test to run in both C++14 and C++17 modes.

4 years ago[OPENMP]Update list of implemented features, NFC.
Alexey Bataev [Wed, 4 Dec 2019 20:11:19 +0000 (15:11 -0500)]
[OPENMP]Update list of implemented features, NFC.

4 years ago[OpenMP50] Add parallel master construct, by Chi Chun Chen.
cchen [Wed, 4 Dec 2019 19:36:07 +0000 (14:36 -0500)]
[OpenMP50] Add parallel master construct, by Chi Chun Chen.

Reviewers: ABataev, jdoerfert

Reviewed By: ABataev

Subscribers: jholewinski, guansong, arphaman, jfb, cfe-commits, sandoval, dreachem

Tags: #clang

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

4 years agoAdd support for lowering 32-bit/64-bit pointers
Amy Huang [Thu, 24 Oct 2019 23:37:23 +0000 (16:37 -0700)]
Add support for lowering 32-bit/64-bit pointers

Summary:
This follows a previous patch that changes the X86 datalayout to represent
mixed size pointers (32-bit sext, 32-bit zext, and 64-bit) with address spaces
(https://reviews.llvm.org/D64931)

This patch implements the address space cast lowering to the corresponding
sign extension, zero extension, or truncate instructions.

Related to https://bugs.llvm.org/show_bug.cgi?id=42359

Reviewers: rnk, craig.topper, RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago Reapply af57dbf12e54 "Add support for options -frounding-math, ftrapping...
Melanie Blower [Mon, 2 Dec 2019 19:22:52 +0000 (11:22 -0800)]
    Reapply af57dbf12e54 "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="

        Patch was reverted because https://bugs.llvm.org/show_bug.cgi?id=44048
        The original patch is modified to set the strictfp IR attribute
        explicitly in CodeGen instead of as a side effect of IRBuilder

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

4 years agoRevert "Add some missing includes to MicrosoftDemangle.cpp (PR44217)"
David Blaikie [Wed, 4 Dec 2019 19:09:18 +0000 (11:09 -0800)]
Revert "Add some missing includes to MicrosoftDemangle.cpp (PR44217)"

This reverts commit 9b962d83ece841e43fd2823375dc6ddc94c1b178.

This didn't address the underlying issue (in MicrosoftDemangleNodes.h)
that was fixed 6 months ago anyway.

4 years agoRevert "[DebugInfo] Recover debug intrinsics when killing duplicated/empty basic...
Tozer [Wed, 4 Dec 2019 18:47:08 +0000 (18:47 +0000)]
Revert "[DebugInfo] Recover debug intrinsics when killing duplicated/empty basic blocks"

This reverts commit 72ce759928e6dfee6a9efa310b966c19722352ba.

Reverted due to build failure.

4 years agoReland [AArch64][MachineOutliner] Return address signing for outlined functions
David Tellenbach [Tue, 3 Dec 2019 16:37:56 +0000 (17:37 +0100)]
Reland [AArch64][MachineOutliner] Return address signing for outlined functions

Summary:
Reland after fixing a bug that allowed outlining of SP modifying instructions
that invalidated return address signing.

During AArch64 frame lowering instructions to enable return address
signing are inserted into functions if needed. Functions generated during
machine outlining don't run through target frame lowering and hence are
missing such instructions.

This patch introduces the following changes:

1. If not all functions that potentially participate in function outlining agree
   on their return address signing scope and their return address signing key,
   outlining is disabled for these functions.
2. If not all functions that potentially participate in function outlining agree
   on their support for v8.3A features, outlining is disabled for these
   functions.
3. If an outlining candidate would outline instructions that modify sp in a way
   that invalidates return address signing, outlining is disabled for that
   particular candidate.
4. If all candidate functions agree on the signing scope, signing key and their
   support for v8.3 features, the outlined function behaves as if it had the
   same scope and key attributes and as if it would provide the same v8.3A
   support as the original functions.

Reviewers: ostannard, paquette

Reviewed By: ostannard

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoRevert "[Coverage] Revise format to reduce binary size"
Vedant Kumar [Wed, 4 Dec 2019 18:35:14 +0000 (10:35 -0800)]
Revert "[Coverage] Revise format to reduce binary size"

This reverts commit e18531595bba495946aa52c0a16b9f9238cff8bc.

On Windows, there is an error:

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/54963/steps/stage%201%20check/logs/stdio

error: C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\test\profile\Profile-x86_64\Output\instrprof-merging.cpp.tmp.v1.o: Failed to load coverage: Malformed coverage data

4 years ago[dsymutil] Remove recursion from lookForChildDIEsToKeep (2/2) (NFC)
Jonas Devlieghere [Wed, 4 Dec 2019 03:41:04 +0000 (19:41 -0800)]
[dsymutil] Remove recursion from lookForChildDIEsToKeep (2/2) (NFC)

The functions lookForDIEsToKeep and keepDIEAndDependencies are mutually
recursive and can cause a stackoverflow for large projects. While this
has always been the case, it became a bigger issue when we parallelized
dsymutil, because threads get only a fraction of the stack space.

This patch removes the final recursive call from lookForDIEsToKeep. The
call was used to look at the current DIE's parent chain and mark
everything as kept.

This was tested by running dsymutil on clang built in debug (both with
and without modules) and comparing the MD5 hash of the generated dSYM
companion file.

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

4 years ago[dsymutil] Remove recursion from lookForChildDIEsToKeep (1/2) (NFC)
Jonas Devlieghere [Tue, 3 Dec 2019 19:10:04 +0000 (11:10 -0800)]
[dsymutil] Remove recursion from lookForChildDIEsToKeep (1/2) (NFC)

The functions lookForDIEsToKeep and keepDIEAndDependencies are mutually
recursive and can cause a stackoverflow for large projects. While this
has always been the case, it became a bigger issue when we parallelized
dsymutil, because threads get only a fraction of the stack space.

In an attempt to tackle this issue, we removed part of the recursion in
r338536 by introducing a worklist. Processing of child DIEs was no
longer recursive. However, we still received bug reports where we'd run
out of stack space.

This patch removes another recursive call from lookForDIEsToKeep. The
call was used to look at DIEs that reference the current DIE. To make
this possible, we inlined keepDIEAndDependencies and added this work to
the existing worklist. Because the function is not tail recursive, we
needed to add two more types of worklist entries to perform the
subsequent work.

This was tested by running dsymutil on clang built in debug (both with
and without modules) and comparing the MD5 hash of the generated dSYM
companion file.

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

4 years ago[Coverage] Revise format to reduce binary size
Vedant Kumar [Mon, 21 Oct 2019 18:48:38 +0000 (11:48 -0700)]
[Coverage] Revise format to reduce binary size

Revise the coverage mapping format to reduce binary size by:

1. Naming function records and marking them `linkonce_odr`, and
2. Compressing filenames.

This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB)
and speeds up end-to-end single-threaded report generation by 10%. For
reference the compressed name data in llc is 81MB (__llvm_prf_names).

Rationale for changes to the format:

- With the current format, most coverage function records are discarded.
  E.g., more than 97% of the records in llc are *duplicate* placeholders
  for functions visible-but-not-used in TUs. Placeholders *are* used to
  show under-covered functions, but duplicate placeholders waste space.

- We reached general consensus about giving (1) a try at the 2017 code
  coverage BoF [1]. The thinking was that using `linkonce_odr` to merge
  duplicates is simpler than alternatives like teaching build systems
  about a coverage-aware database/module/etc on the side.

- Revising the format is expensive due to the backwards compatibility
  requirement, so we might as well compress filenames while we're at it.
  This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB).

See CoverageMappingFormat.rst for the details on what exactly has
changed.

Fixes PR34533 [2], hopefully.

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html
[2] https://bugs.llvm.org/show_bug.cgi?id=34533

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

4 years ago[Gold Tests] Add missing target flag to X86 test
Troy Johnson [Wed, 4 Dec 2019 17:50:44 +0000 (11:50 -0600)]
[Gold Tests] Add missing target flag to X86 test

This test was failing on non-X86 targets because the gold invocation did not
have the necessary -m flag.

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

4 years ago[LoopInterchange] Improve inner exit loop safety checks.
Florian Hahn [Wed, 4 Dec 2019 17:26:29 +0000 (17:26 +0000)]
[LoopInterchange] Improve inner exit loop safety checks.

The PHI node checks for inner loop exits are too permissive currently.
As indicated by an existing comment, we should only allow LCSSA PHI
nodes that are part of reductions or are only used outside of the loop
nest. We ensure this by checking the users of the LCSSA PHIs.
Specifically, it is not safe to use an exiting value from the inner loop in the latch of the outer
loop.

It also moves the inner loop exit check before the outer loop exit
check.

Fixes PR43473.

Reviewers: efriedma, mcrosier

Reviewed By: efriedma

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

4 years ago[llvm][Transform] Remove unused variable. [NFCI]
Francesco Petrogalli [Wed, 4 Dec 2019 17:12:48 +0000 (17:12 +0000)]
[llvm][Transform] Remove unused variable. [NFCI]

The variable prevents compiling when using -Werror=unused-variable.

4 years ago[HIP] Remove opencl.amdgcn.lib
Yaxun (Sam) Liu [Tue, 3 Dec 2019 21:07:46 +0000 (16:07 -0500)]
[HIP] Remove opencl.amdgcn.lib

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

4 years ago[PGO][PGSO] Distinguish queries from unit tests and explicitly enable for the existin...
Hiroshi Yamauchi [Tue, 3 Dec 2019 23:02:37 +0000 (15:02 -0800)]
[PGO][PGSO] Distinguish queries from unit tests and explicitly enable for the existing IR passes only. NFC.

Summary:
This is one more prep step necessary before the code gen pass instrumentation
code could go in.

Reviewers: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SVE][AArch64] Adding patterns for while intrinsics.
Mikhail Gudim [Wed, 4 Dec 2019 15:20:56 +0000 (10:20 -0500)]
[SVE][AArch64] Adding patterns for while intrinsics.

4 years agoSmall nit in SelectionDAG.h . NFC
Amaury Séchet [Wed, 4 Dec 2019 16:37:00 +0000 (17:37 +0100)]
Small nit in SelectionDAG.h . NFC

4 years ago[LVI] Restructure caching
Nikita Popov [Sat, 16 Nov 2019 15:22:18 +0000 (16:22 +0100)]
[LVI] Restructure caching

Variant on D70103. The caching is switched to always use a BB to
cache entry map, which then contains per-value caches. A separate
set contains value handles with a deletion callback. This allows us
to properly invalidate overdefined values.

A possible alternative would be to always cache by value first and
have per-BB maps/sets in the each cache entry. In that case we could
use a ValueMap and would avoid the separate value handle set. I went
with the BB indexing at the top level to make it easier to integrate
D69914, but possibly that's not the right choice.

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

4 years ago[XCOFF][AIX] Emit TOC entries for object file generation
jasonliu [Wed, 4 Dec 2019 16:22:57 +0000 (16:22 +0000)]
[XCOFF][AIX] Emit TOC entries for object file generation

Summary:
Implement emitTCEntry for PPCTargetXCOFFStreamer.
Add TC csects to TOCCsects for object file writing.

Note:

1. I did not include any raw data testing for this object file generation
because TC entries raw data will all be 0 without relocation implemented.
I will add raw data testing as part of relocation testing later.
2. I removed "Symbol->setFragment(F);" for common symbols because we
 don't need it, and if we have it then we would hit assertions below:
Assertion `(SymbolContents == SymContentsUnset ||
            SymbolContents == SymContentsOffset) &&
            "Cannot get offset for a common/variable symbol"' failed.
3.Fixed incorrect TOC-base alignment.

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

4 years ago[libomptarget] Build a minimal deviceRTL for amdgcn
JonChesterfield [Wed, 4 Dec 2019 16:43:16 +0000 (16:43 +0000)]
[libomptarget] Build a minimal deviceRTL for amdgcn

Summary:
[libomptarget] Build a minimal deviceRTL for amdgcn

Repeat of D70414, with an include path fixed. Diff for sanity checking.

The CMakeLists.txt file is functionally identical to the one used in the aomp fork.
Whitespace changes were made based on nvptx/CMakeLists.txt, plus the
copyright notice updated to match (Greg was the original author so would
like his sign off on that here).

This change will build a small subset of the deviceRTL if an appropriate toolchain is
available, e.g. a local install of rocm. Support.h is moved from nvptx as a dependency
of debug.h.

Reviewers: ABataev, jdoerfert

Reviewed By: ABataev

Subscribers: jvesely, mgorny, jfb, openmp-commits, jdoerfert

Tags: #openmp

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

4 years agoAdd some missing includes to MicrosoftDemangle.cpp (PR44217)
David Blaikie [Wed, 4 Dec 2019 15:48:30 +0000 (07:48 -0800)]
Add some missing includes to MicrosoftDemangle.cpp (PR44217)

4 years ago[llvm-ar][test] Add to thin archive test coverage
gbreynoo [Wed, 4 Dec 2019 16:17:42 +0000 (16:17 +0000)]
[llvm-ar][test] Add to thin archive test coverage

This diff adds test coverage for thin archives including additions to
existing tests. In some cases I have updated the formats of these tests
to better match other tests in the archive.

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

4 years ago[lldb] Simplify debug_{rnglists,ranges}.s tests
Pavel Labath [Wed, 4 Dec 2019 14:54:59 +0000 (15:54 +0100)]
[lldb] Simplify debug_{rnglists,ranges}.s tests

Remove things irrelevant to the test.

4 years ago[DebugInfo] Recover debug intrinsics when killing duplicated/empty basic blocks
stozer [Wed, 4 Dec 2019 09:44:02 +0000 (09:44 +0000)]
[DebugInfo] Recover debug intrinsics when killing duplicated/empty basic blocks

When basic blocks are killed, either due to being empty or to being an if.then
or if.else block whose complement contains identical instructions, some of the
debug intrinsics in that block are lost. This patch sinks those intrinsics
into the single successor block, setting them Undef if necessary to
prevent debug info from falling out-of-date.

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

4 years agoReapply "[llvm][Support] Take in CurrentDirectory as a parameter in ExpandResponseFiles"
Kadir Cetinkaya [Wed, 4 Dec 2019 15:34:56 +0000 (16:34 +0100)]
Reapply "[llvm][Support] Take in CurrentDirectory as a parameter in ExpandResponseFiles"

Attemps to fix windows buildbots.

4 years ago[ELF] Support for PT_GNU_PROPERTY in header and tools
Peter Smith [Fri, 29 Nov 2019 19:12:49 +0000 (19:12 +0000)]
[ELF] Support for PT_GNU_PROPERTY in header and tools

The PT_GNU_PROPERTY is generated by a linker to describe the
.note.gnu.property section. The Linux kernel uses this program header to
locate the .note.gnu.property section.

It is described in "The Linux gABI extension"

Include support for llvm-readelf, llvm-readobj and the yaml reader and
writers.

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

4 years agoAutomaticaly generate copysign-constant-magnitude.ll . NFC
Amaury Séchet [Wed, 4 Dec 2019 15:05:30 +0000 (16:05 +0100)]
Automaticaly generate copysign-constant-magnitude.ll . NFC

4 years agoRevert "[llvm][Support] Take in CurrentDirectory as a parameter in ExpandResponseFiles"
Kadir Cetinkaya [Wed, 4 Dec 2019 14:50:27 +0000 (15:50 +0100)]
Revert "[llvm][Support] Take in CurrentDirectory as a parameter in ExpandResponseFiles"

This reverts commit 75656005dbc8866e1888932a68a830b0df403560.

4 years agoChange Target::FindBreakpointsByName to return Expected<vector>
Joseph Tremoulet [Fri, 22 Nov 2019 17:59:46 +0000 (12:59 -0500)]
Change Target::FindBreakpointsByName to return Expected<vector>

Summary:
Using a BreakpointList corrupts the breakpoints' IDs because
BreakpointList::Add sets the ID, so use a vector instead, and
update the signature to return the vector wrapped in an
llvm::Expected which can propagate any error from the inner
call to StringIsBreakpointName.

Note that, despite the similar name, SBTarget::FindBreakpointsByName
doesn't suffer the same problem, because it uses a SBBreakpointList,
which is more like a BreakpointIDList than a BreakpointList under the
covers.

Add a check to TestBreakpointNames that, without this fix, notices the
ID getting mutated and fails.

Reviewers: jingham, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[clang-change-namespace] Change file pattern to be an anchored regex
Kadir Cetinkaya [Wed, 4 Dec 2019 14:48:21 +0000 (15:48 +0100)]
[clang-change-namespace] Change file pattern to be an anchored regex

4 years ago[opencl] Fix address space deduction on array variables.
Michael Liao [Mon, 2 Dec 2019 18:13:52 +0000 (13:13 -0500)]
[opencl] Fix address space deduction on array variables.

Summary:

- The deduced address space needs applying to its element type as well.

Reviewers: Anastasia

Subscribers: yaxunl, cfe-commits

Tags: #clang

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

4 years ago[ARM][MVE][Intrinsics] Add VMULH/VRMULH intrinsics.
Mark Murray [Mon, 2 Dec 2019 15:22:24 +0000 (15:22 +0000)]
[ARM][MVE][Intrinsics] Add VMULH/VRMULH intrinsics.

Summary: Add MVE VMULH/VRMULH intrinsics and unit tests.

Reviewers: simon_tatham, ostannard, dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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