platform/upstream/llvm.git
4 years ago[libunwind] Factor out getInfoFromFdeCie. NFCI.
Ryan Prichard [Tue, 18 Aug 2020 09:31:38 +0000 (02:31 -0700)]
[libunwind] Factor out getInfoFromFdeCie. NFCI.

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

4 years ago[libunwind] Minor fixes in libunwind
Ryan Prichard [Wed, 19 Aug 2020 08:54:17 +0000 (01:54 -0700)]
[libunwind] Minor fixes in libunwind

 * When _LIBUNWIND_SUPPORT_COMPACT_UNWIND is defined in config.h,
   define it to "1" like the other macros. These macros are still
   checked using "#if defined(...)", however.

 * Include libunwind.h in AddressSpace.hpp before using
   _LIBUNWIND_ARM_EHABI.

 * Rename ProcessFrameHeaderCache to TheFrameHeaderCache, because some
   configurations (e.g. Android / hermetic static libraries) can have
   one cache per shared object in the process. (When there are more
   copies, it's more important not to waste memory in the cache.)

 * Add 3 missing header files to LIBUNWIND_HEADERS.

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

4 years agoGlobalISel: IRTranslate minimum of pointer sizes on memcpy
Matt Arsenault [Mon, 17 Aug 2020 02:17:12 +0000 (22:17 -0400)]
GlobalISel: IRTranslate minimum of pointer sizes on memcpy

I forgot to squash this with 0b7f6cc71a72a85f8a0cbee836a7a8e31876951a

4 years agoGlobalISel: Add generic instructions for memory intrinsics
Matt Arsenault [Mon, 3 Aug 2020 13:00:24 +0000 (09:00 -0400)]
GlobalISel: Add generic instructions for memory intrinsics

AArch64, X86 and Mips currently directly consumes these and custom
lowering to produce a libcall, but really these should follow the
normal legalization process through the libcall/lower action.

4 years ago[ORC][JITLink] Switch to unique ownership for EHFrameRegistrars.
Lang Hames [Wed, 26 Aug 2020 23:56:33 +0000 (16:56 -0700)]
[ORC][JITLink] Switch to unique ownership for EHFrameRegistrars.

This will make stateful registrars (e.g. a future TargetProcessControl based
registrar) easier to deal with.

4 years ago[OpenMP] Always emit debug messages that indicate offloading failure
Joseph Huber [Wed, 26 Aug 2020 22:11:26 +0000 (18:11 -0400)]
[OpenMP] Always emit debug messages that indicate offloading failure

Summary:

This patch changes the libomptarget runtime to always emit debug messages that
occur before offloading failure. The goal is to provide users with information
about why their application failed in the target region rather than a single
failure message. This is only done in regions that precede offloading failure
so this should not impact runtime performance. if the debug environment
variable is set then the message is forwarded to the debug output as usual.

A new environment variable was added for future use but does nothing in this
current patch. LIBOMPTARGET_INFO will be used to report runtime information to
the user if requrested, such as grid size, SPMD usage, or data mapping. It will
take an integer indicating the level of information verbosity and a value of 0
will disable it.

Reviewers: jdoerfort

Subscribers: guansong sstefan1 yaxunl ye-luo

Tags: #OpenMP

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

4 years ago[X86] Update release notes for -mtune support.
Craig Topper [Wed, 26 Aug 2020 22:58:38 +0000 (15:58 -0700)]
[X86] Update release notes for -mtune support.

4 years agoFix OCaml bindings
Arthur Eubanks [Wed, 26 Aug 2020 23:10:02 +0000 (16:10 -0700)]
Fix OCaml bindings

Caused by https://reviews.llvm.org/D85159

4 years ago[ConstProp] Remove ConstantPropagation
Arthur Eubanks [Mon, 3 Aug 2020 20:46:11 +0000 (13:46 -0700)]
[ConstProp] Remove ConstantPropagation

As discussed in
http://lists.llvm.org/pipermail/llvm-dev/2020-July/143801.html.

Currently no users outside of unit tests.

Replace all instances in tests of -constprop with -instsimplify.
Notable changes in tests:
* vscale.ll - @llvm.sadd.sat.nxv16i8 is evaluated by instsimplify, use a fake intrinsic instead
* InsertElement.ll - insertelement undef is removed by instsimplify in @insertelement_undef
llvm/test/Transforms/ConstProp moved to llvm/test/Transforms/InstSimplify/ConstProp

Reviewed By: lattner, nikic

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

4 years agoLoad correct module for linux and android when duplicates exist in minidump.
Greg Clayton [Fri, 21 Aug 2020 21:40:21 +0000 (14:40 -0700)]
Load correct module for linux and android when duplicates exist in minidump.

Breakpad creates minidump files that can a module loaded multiple times. We found that when a process mmap's the object file for a library, this can confuse breakpad into creating multiple modules in the module list. This patch fixes the GetFilteredModules() to check the linux maps for permissions and use the one that has execute permissions. Typically when people mmap a file into memory they don't map it as executable. This helps people to correctly load minidump files for post mortem analysis.

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

4 years ago[X86] Change pentium4 tuning settings and scheduler model back to their values before...
Craig Topper [Wed, 26 Aug 2020 22:21:55 +0000 (15:21 -0700)]
[X86] Change pentium4 tuning settings and scheduler model back to their values before D83913.

Clang now defaults to -march=pentium4 -mtune=generic so we don't
need modern tune settings on pentium4.

4 years agoUse properlyDominates in RDFLiveness when sorting on dominance.
Alina Sbirlea [Wed, 26 Aug 2020 22:03:22 +0000 (15:03 -0700)]
Use properlyDominates in RDFLiveness when sorting on dominance.

Summary:
When looking for all reaching definitions, we sort basic blocks on dominance. When sorting looking for properlyDominates() handles the case A == B.

Authored by: pranavb

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

4 years agoBring llvm::Optional data formatter back in sync with the implementation.
Adrian Prantl [Wed, 26 Aug 2020 22:10:31 +0000 (15:10 -0700)]
Bring llvm::Optional data formatter back in sync with the implementation.

4 years ago[X86] Default to -mtune=generic unless -march is passed to the driver. Add TuneCPU...
Craig Topper [Wed, 26 Aug 2020 21:44:25 +0000 (14:44 -0700)]
[X86] Default to -mtune=generic unless -march is passed to the driver. Add TuneCPU to the AST serialization

This patch defaults to -mtune=generic unless -march is present. If -march is present we'll use the empty string unless its overridden by mtune. The back should use the target cpu if the tune-cpu isn't present.

It also adds AST serialization support to fix some tests that emit AST and parse it back. These tests diff the IR against the output from not going through AST. So if we don't serialize the tune CPU we fail the diff.

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

4 years ago[IR] Remove noundef from masked store/load/gather/scatter's pointer operands
Juneyoung Lee [Wed, 26 Aug 2020 20:12:40 +0000 (05:12 +0900)]
[IR] Remove noundef from masked store/load/gather/scatter's pointer operands

As discussed in D86576, noundef attribute is removed from masked store/load/gather/scatter's
pointer operands.

Reviewed By: efriedma

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

4 years ago[AArch64] Use CCAssignFnForReturn helper in more spots. NFC.
Ahmed Bougacha [Wed, 26 Aug 2020 21:00:11 +0000 (14:00 -0700)]
[AArch64] Use CCAssignFnForReturn helper in more spots. NFC.

It was added for GISel, but SDAG could use it too!

4 years ago[LangRef] Memset/memcpy/memmove can take undef/poison pointer if the size is 0
Juneyoung Lee [Wed, 26 Aug 2020 13:06:36 +0000 (22:06 +0900)]
[LangRef] Memset/memcpy/memmove can take undef/poison pointer if the size is 0

According to the current LangRef, Memset/memcpy/memmove can take a
null/dangling pointer if the size is zero.
(Relevant thread: http://lists.llvm.org/pipermail/llvm-dev/2017-July/115665.html )
This patch expands it and allows the functions to take undef/poison pointers
too.

This required the updates in the align attribute since it isn't specified
what is the alignment of undef/poison pointers.
This patch states that their alignment is 1.

Reviewed By: efriedma

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

4 years ago[mlir][vector] Add vector.bitcast operation
Thomas Raoux [Wed, 26 Aug 2020 21:13:52 +0000 (14:13 -0700)]
[mlir][vector] Add vector.bitcast operation

Based on the RFC discussed here:
https://llvm.discourse.group/t/rfc-vector-standard-add-bitcast-operation/1628/

Adding a vector.bitcast operation that allows casting to a vector of different
element type. The most minor dimension bitwidth must stay unchanged.

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

4 years ago[libomptarget][amdgpu] Improve thread safety, remove dead code
JonChesterfield [Wed, 26 Aug 2020 21:04:03 +0000 (22:04 +0100)]
[libomptarget][amdgpu] Improve thread safety, remove dead code

4 years ago[VectorCombine] adjust test for better coverage; NFC
Sanjay Patel [Wed, 26 Aug 2020 20:36:55 +0000 (16:36 -0400)]
[VectorCombine] adjust test for better coverage; NFC

A >2x insert might crash if we do not generate the shuffle mask carefully.

D86160

4 years ago[InstSimplify] Fold min/max intrinsic based on icmp of operands
Nikita Popov [Thu, 13 Aug 2020 19:58:25 +0000 (21:58 +0200)]
[InstSimplify] Fold min/max intrinsic based on icmp of operands

This is a reboot of D84655, now performing the inner icmp
simplification query without undef folds.

It should be possible to handle the current foldMinMaxSharedOp()
fold based on this, by moving the logic into icmp of min/max instead,
making it more general. We can't drop the folds for constant operands,
because those also allow undef, which we exclude here.

The tests use assumes for exhaustive coverage, and have a few
more examples of misc folds we get based on icmp simplification.

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

4 years ago[InstSimplify] Add additional umax tests (NFC)
Nikita Popov [Wed, 26 Aug 2020 19:59:05 +0000 (21:59 +0200)]
[InstSimplify] Add additional umax tests (NFC)

A sample of some folds we get if we perform icmp simplification
on min/max intrinsics.

4 years ago[AArch64][SVE] Add lowering for llvm fceil
Muhammad Asif Manzoor [Wed, 26 Aug 2020 19:36:26 +0000 (15:36 -0400)]
[AArch64][SVE] Add lowering for llvm fceil

Add the functionality to lower fceil for passthru variant

Reviewed By: paulwalker-arm

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

4 years ago[test] Rewrite various tests to not use constprop
Arthur Eubanks [Wed, 26 Aug 2020 19:47:59 +0000 (12:47 -0700)]
[test] Rewrite various tests to not use constprop

Reviewed By: nikic

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

4 years agoReapply D70800: Fix AArch64 AAPCS frame record chain
Owen Anderson [Wed, 26 Aug 2020 19:36:13 +0000 (19:36 +0000)]
Reapply D70800: Fix AArch64 AAPCS frame record chain

Original Commit Message:
After the commit r368987 (rG643adb55769e) was landed, the frame record (FP and LR register)
may be placed in the middle of a stack frame if a function has both callee-saved
general-purpose registers and floating point registers. This will break the stack unwinders
that simply walk through the frame records (based on the guarantee from AAPCS64
"The Frame Pointer" section). This commit fixes the problem by adding the frame record offset.

Patch By: logan

4 years ago[DAGCombiner] allow store merging non-i8 truncated ops
Sanjay Patel [Wed, 26 Aug 2020 19:21:54 +0000 (15:21 -0400)]
[DAGCombiner] allow store merging non-i8 truncated ops

We have a gap in our store merging capabilities for shift+truncate
patterns as discussed in:
https://llvm.org/PR46662

I generalized the code/comments for this function in earlier commits,
so we only need ease the type restriction and adjust the address/endian
checking to make this work.

AArch64 lets us switch endian to make sure that patterns are matched
either way.

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

4 years ago[llvm] [Thumb2] Test unusual length for active lane mask
aartbik [Wed, 26 Aug 2020 18:00:55 +0000 (11:00 -0700)]
[llvm] [Thumb2] Test unusual length for active lane mask

Thumb2 test for the fixed issue with unusual length.

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

Reviewed By: SjoerdMeijer

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

4 years ago[Support][Windows] Fix incorrect GetFinalPathNameByHandleW() return value check in...
Aleksandr Platonov [Wed, 26 Aug 2020 19:10:35 +0000 (22:10 +0300)]
[Support][Windows] Fix incorrect GetFinalPathNameByHandleW() return value check in realPathFromHandle()

`GetFinalPathNameByHandleW(,,N,)` returns:
- `< N` on success (this value does not include the size of the terminating null character)
- `>= N` if buffer is too small (this value includes the size of the terminating null character)

So, when `N == Buffer.capacity() - 1`, we need to resize buffer if return value is > `Buffer.capacity() - 2`.
Also, we can set `N` to `Buffer.capacity()`.

Thus, without this patch `realPathFromHandle()` returns unfilled buffer when length of the final path of the file is equal to `Buffer.capacity()` or `Buffer.capacity() - 1`.

Reviewed By: andrewng, amccarth

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

4 years ago[libomptarget][amdgpu] Update plugin CMake to work with latest rocr library
Jon Chesterfield [Wed, 26 Aug 2020 19:01:42 +0000 (20:01 +0100)]
[libomptarget][amdgpu] Update plugin CMake to work with latest rocr library

4 years ago[OpenMP] Fix import library installation with MinGW
AndreyChurbanov [Wed, 26 Aug 2020 18:56:01 +0000 (21:56 +0300)]
[OpenMP] Fix import library installation with MinGW

Patch by mati865@gmail.com

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

4 years ago[mlir] NFC: fix trivial typos in documents
Kazuaki Ishizaki [Wed, 26 Aug 2020 18:50:14 +0000 (03:50 +0900)]
[mlir] NFC: fix trivial typos in documents

Reviewed By: mravishankar

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

4 years agoAdd cmake test support for LLJITWithThinLTOSummaries to make sure
Eric Christopher [Wed, 26 Aug 2020 18:44:57 +0000 (11:44 -0700)]
Add cmake test support for LLJITWithThinLTOSummaries to make sure
it's being built and called (and substituted).

4 years ago[InstSimplify] Simplify to vector constants when possible
Arthur Eubanks [Mon, 10 Aug 2020 19:53:30 +0000 (12:53 -0700)]
[InstSimplify] Simplify to vector constants when possible

InstSimplify should do all transformations that ConstProp does, but
one thing that ConstProp does that InstSimplify wouldn't is inline
vector instructions that are constants, e.g. into a ret.

Previously vector instructions wouldn't be inlined in InstSimplify
because llvm::Simplify*Instruction() would return nullptr for specific
instructions, such as vector instructions that were actually constants,
if it couldn't simplify them.

This changes SimplifyInsertElementInst, SimplifyExtractElementInst, and
SimplifyShuffleVectorInst to return a vector constant when possible.

Reviewed By: efriedma

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

4 years ago[gn build] Manually port ed07e1fe
Arthur Eubanks [Wed, 26 Aug 2020 18:30:10 +0000 (11:30 -0700)]
[gn build] Manually port ed07e1fe

4 years ago[MC][SVE] Fix data operand for instruction alias of `st1d`.
Francesco Petrogalli [Wed, 26 Aug 2020 15:43:56 +0000 (15:43 +0000)]
[MC][SVE] Fix data operand for instruction alias of `st1d`.

The version of `st1d` that operates with vector plus immediate
addressing mode uses the alias `st1d { <Zn>.d }, <Pg>, [<Za>.d]` for
rendering `st1d { <Zn>.d }, <Pg>, [<Za>.d, #0]`. The disassembler was
generating `<Zn>.s` instead of `<Zn>.d>`.

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

4 years ago[LTO] Don't apply LTOPostLink module flag during writeMergedModule
Steven Wu [Wed, 26 Aug 2020 18:17:26 +0000 (11:17 -0700)]
[LTO] Don't apply LTOPostLink module flag during writeMergedModule

For `ld64` which uses legacy LTOCodeGenerator, it relies on
writeMergedModule to perform `ld -r` (generates a linked object file).
If all the inputs to `ld -r` is fullLTO bitcode, `ld64` will linked the
bitcode module, internalize all the symbols and write out another
fullLTO bitcode object file. This bitcode file doesn't have all the
bitcode inputs and it should not have LTOPostLink module flag. It will
also cause error when this bitcode object file is linked with other LTO
object file.
Fix the issue by not applying LTOPostLink flag during writeMergedModule
function. The flag should only be added when all the bitcode are linked
and ready to be optimized.

rdar://problem/58462798

Reviewed By: tejohnson

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

4 years ago[Polly] Inline ShoulDelete lambda. NFC.
Michael Kruse [Wed, 26 Aug 2020 18:11:41 +0000 (13:11 -0500)]
[Polly] Inline ShoulDelete lambda. NFC.

As suggested by David Blaikie at
ihttps://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20200824/822584.html

4 years ago[Polly] Use llvm::function_ref. NFC.
Michael Kruse [Wed, 26 Aug 2020 18:03:18 +0000 (13:03 -0500)]
[Polly] Use llvm::function_ref. NFC.

As suggested by David Blaike at
https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20200824/822584.html

4 years ago[SVE] Remove calls to VectorType::getNumElements from clang
Christopher Tetreault [Wed, 26 Aug 2020 17:06:28 +0000 (10:06 -0700)]
[SVE] Remove calls to VectorType::getNumElements from clang

Reviewed By: RKSimon

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

4 years ago[Hexagon] Implement llvm.masked.load and llvm.masked.store for HVX
Krzysztof Parzyszek [Mon, 24 Aug 2020 23:29:57 +0000 (18:29 -0500)]
[Hexagon] Implement llvm.masked.load and llvm.masked.store for HVX

4 years agoAMDGPU: Don't assert on misaligned DS read2/write2 offsets
Matt Arsenault [Wed, 26 Aug 2020 14:45:07 +0000 (10:45 -0400)]
AMDGPU: Don't assert on misaligned DS read2/write2 offsets

This would assert with unaligned DS access enabled. The offset may not
be aligned. Theoretically the pattern predicate should check the
memory alignment, although it is possible to have the memory be
aligned but not the immediate offset.

In this case I would expect it to use ds_{read|write}_b64 with
unaligned access, but am not clear if there's a reason it doesn't.

4 years ago[SampleFDO] Enhance profile remapping support for searching inline instance
Wei Mi [Tue, 25 Aug 2020 05:59:20 +0000 (22:59 -0700)]
[SampleFDO] Enhance profile remapping support for searching inline instance
and indirect call promotion candidate.

Profile remapping is a feature to match a function in the module with its
profile in sample profile if the function name and the name in profile look
different but are equivalent using given remapping rules. This is a useful
feature to keep the performance stable by specifying some remapping rules
when sampleFDO targets are going through some large scale function signature
change.

However, currently profile remapping support is only valid for outline
function profile in SampleFDO. It cannot match a callee with an inline
instance profile if they have different but equivalent names. We found
that without the support for inline instance profile, remapping is less
effective for some large scale change.

To add that support, before any remapping lookup happens, all the names
in the profile will be inserted into remapper and the Key to the name
mapping will be recorded in a map called NameMap in the remapper. During
name lookup, a Key will be returned for the given name and it will be used
to extract an equivalent name in the profile from NameMap. So with the help
of the NameMap, we can translate any given name to an equivalent name in
the profile if it exists. Whenever we try to match a name in the module to
a name in the profile, we will try the match with the original name first,
and if it doesn't match, we will use the equivalent name got from remapper
to try the match for another time. In this way, the patch can enhance the
profile remapping support for searching inline instance and searching
indirect call promotion candidate.

In a planned large scale change of int64 type (long long) to int64_t (long),
we found the performance of a google internal benchmark degraded by 2% if
nothing was done. If existing profile remapping was enabled, the performance
degradation dropped to 1.2%. If the profile remapping with the current patch
was enabled, the performance degradation further dropped to 0.14% (Note the
experiment was done before searching indirect call promotion candidate was
added. We hope with the remapping support of searching indirect call promotion
candidate, the degradation can drop to 0% in the end. It will be evaluated
post commit).

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

4 years ago[IR] Add NoUndef attribute to Intrinsics.td
Juneyoung Lee [Tue, 25 Aug 2020 19:50:29 +0000 (04:50 +0900)]
[IR] Add NoUndef attribute to Intrinsics.td

This patch adds NoUndef to Intrinsics.td.
The attribute is attached to llvm.assume's operand, because llvm.assume(undef)
is UB.
It is attached to pointer operands of several memory accessing intrinsics
as well.

This change makes ValueTracking::getGuaranteedNonPoisonOps' intrinsic check
unnecessary, so it is removed.

Reviewed By: jdoerfert

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

4 years ago[X86] Add assembler support for .d32 and .d8 mnemonic suffixes to control displacemen...
Craig Topper [Wed, 26 Aug 2020 17:41:51 +0000 (10:41 -0700)]
[X86] Add assembler support for .d32 and .d8 mnemonic suffixes to control displacement size.

This is an older syntax than the {disp32} and {disp8} pseudo
prefixes that were added a few weeks ago. We can reuse most of
the support for that to support .d32 and .d8 as well.

4 years ago[clang] Exclude invalid destructors from lookups.
Adam Czachorowski [Wed, 26 Aug 2020 14:20:01 +0000 (16:20 +0200)]
[clang] Exclude invalid destructors from lookups.

This fixes a crash when declaring a destructor with a wrong name, then
writing result to pch file and loading it again. The PCH storage uses
DeclarationNameKey as key and it is the same key for both the invalid
destructor and the implicit one that was created because the other one
was invalid. When querying for the Foo::~Foo we end up getting
Foo::~Bar, which is then rejected and we end up with nullptr in
CXXRecordDecl::GetDestructor().

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

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

4 years ago[Value][InstCombine] Fix one-use checks in PHI-of-op -> Op-of-PHI[s] transforms to...
Roman Lebedev [Wed, 26 Aug 2020 14:06:03 +0000 (17:06 +0300)]
[Value][InstCombine] Fix one-use checks in PHI-of-op -> Op-of-PHI[s] transforms to be one-user checks

As FIXME said, they really should be checking for a single user,
not use, so let's do that. It is not *that* unusual to have
the same value as incoming value in a PHI node, not unlike
how a PHI may have the same incoming basic block more than once.

There isn't a nice way to do that, Value::users() isn't uniqified,
and Value only tracks it's uses, not Users, so the check is
potentially costly since it does indeed potentially involes
traversing the entire use list of a value.

4 years ago[NFC][Value] Fixup comments, "N users" is NOT the same as "N uses".
Roman Lebedev [Wed, 26 Aug 2020 14:09:51 +0000 (17:09 +0300)]
[NFC][Value] Fixup comments, "N users" is NOT the same as "N uses".

In those cases, it really means "N uses".

4 years ago[NFC][InstCombine] Add tests with PHI-of-{insert,extract}value with multiple uses
Roman Lebedev [Wed, 26 Aug 2020 13:59:04 +0000 (16:59 +0300)]
[NFC][InstCombine] Add tests with PHI-of-{insert,extract}value with multiple uses

It is fine if the operation has multiple uses, as long as they are all
in this very PHI node.

4 years agoRevert "Fix frame pointer layout on AArch64 Linux."
Owen Anderson [Wed, 26 Aug 2020 17:17:14 +0000 (17:17 +0000)]
Revert "Fix frame pointer layout on AArch64 Linux."

This broke stage2 of clang-cmake-aarch64-full.

This reverts commit a0aed80b22d1b698b86e0c16109fdfd4d592756f.

4 years ago[llvm] [DAG] Fix bug in llvm.get.active.lane.mask lowering
aartbik [Wed, 26 Aug 2020 00:14:44 +0000 (17:14 -0700)]
[llvm] [DAG] Fix bug in llvm.get.active.lane.mask lowering

This intrinsic only accepted proper machine vector lengths.
Fixed by this change. With unit tests.

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

Reviewed By: SjoerdMeijer

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

4 years ago[ThinLTO][Legacy] Compute PreservedGUID based on IRName in Symtab
Steven Wu [Wed, 26 Aug 2020 17:14:26 +0000 (10:14 -0700)]
[ThinLTO][Legacy] Compute PreservedGUID based on IRName in Symtab

Instead of computing GUID based on some assumption about symbol mangling
rule from IRName to symbol name, lookup the IRName from all the symtabs
from all the input files to see if there are any matching symbols entry
provides the IRName for GUID computation.

rdar://65853754

Reviewed By: mehdi_amini

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

4 years ago[XCOFF][AIX] Support relocation generation for large code model
jasonliu [Wed, 26 Aug 2020 16:08:43 +0000 (16:08 +0000)]
[XCOFF][AIX] Support relocation generation for large code model

Summary:
Support TOCU and TOCL relocation type for object file generation.

Reviewed by: DiggerLin

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

4 years ago[profile] Add InstrProfilingVersionVar.c.o to Darwin kext builtins
Vedant Kumar [Wed, 26 Aug 2020 17:00:37 +0000 (10:00 -0700)]
[profile] Add InstrProfilingVersionVar.c.o to Darwin kext builtins

Fixes a build failure in the Darwin kernel. Tested with:

% nm -mU lib/libclang_rt.cc_kext_x86_64h_osx.a | grep __llvm_profile_raw_version

rdar://67809173

4 years ago[LegalizeTypes] Remove WidenVecRes_Shift and just use WidenVecRes_Binary
Craig Topper [Wed, 26 Aug 2020 16:45:15 +0000 (09:45 -0700)]
[LegalizeTypes] Remove WidenVecRes_Shift and just use WidenVecRes_Binary

This function seems to allow for the shift amount to have a different type than the result, but I don't think we do that anywhere else for vector shifts. We also don't have any support for legalizing the shift amount alone if the result is legal and the shift amount type isn't. The code coverage report here shows this code as uncovered http://lab.llvm.org:8080/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp.html

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

4 years ago[SyntaxTree] Migrate `ParamatersAndQualifiers` to use the new List API
Eduardo Caldas [Wed, 26 Aug 2020 08:51:21 +0000 (08:51 +0000)]
[SyntaxTree] Migrate `ParamatersAndQualifiers` to use the new List API

Fix: Add missing `List::getTerminationKind()`, `List::canBeEmpty()`,
`List::getDelimiterTokenKind()` for `CallArguments`.

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

4 years ago[SystemZ/ZOS] Add header file to encapsulate use of <sysexits.h>
Kai Nacke [Wed, 20 May 2020 09:10:31 +0000 (11:10 +0200)]
[SystemZ/ZOS] Add header file to encapsulate use of <sysexits.h>

The non-standard header file `<sysexits.h>` provides some return values.
`EX_IOERR` is used to as a special value to signal a broken pipe to the clang driver.
On z/OS Unix System Services, this header file does not exists. This patch

- adds a check for `<sysexits.h>`, removing the dependency on `LLVM_ON_UNIX`
- adds a new header file `llvm/Support/ExitCodes`, which either includes
  `<sysexits.h>` or defines `EX_IOERR`
- updates the users of `EX_IOERR` to include the new header file

Reviewed By: hubert.reinterpretcast

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

4 years ago[libFuzzer] Error and exit if user supplied fuzzer writeable directories don't exist
Matt Morehouse [Wed, 26 Aug 2020 16:06:12 +0000 (09:06 -0700)]
[libFuzzer] Error and exit if user supplied fuzzer writeable directories don't exist

Currently, libFuzzer will exit with an error message if a non-existent
corpus directory is provided. However, if a user provides a non-existent
directory for the `artifact_prefix`, `exact_artifact_path`, or
`features_dir`, libFuzzer will continue execution but silently fail to
write artifacts/features.

To improve the user experience, this PR adds validation for the existence of
all user supplied directories before executing the main fuzzing loop. If they
don't exist, libFuzzer will exit with an error message.

Patch By: dgg5503

Reviewed By: morehouse

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

4 years agoRevert "[LiveDebugValues][NFC] Add instr-ref tests, adapt old tests"
Jeremy Morse [Wed, 26 Aug 2020 16:19:13 +0000 (17:19 +0100)]
Revert "[LiveDebugValues][NFC] Add instr-ref tests, adapt old tests"

Asan has picked up a memory leak, which will require some investigation:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/45372/steps/check-llvm%20asan/logs/stdio

This reverts commit 60db26a66d5346b2feae279f6c928bde48078893.

4 years agoFix quiet mode in git-clang-format
Gi Vald [Tue, 25 Aug 2020 20:37:14 +0000 (22:37 +0200)]
Fix quiet mode in git-clang-format

Quiet mode is very useful for scripting, when only the diff format output is
required, or no output if not formatting is needed.
In case of no modified files, git-clang-format will output to screen even though
the quiet mode enabled.

This patch changes this behavior, so if quiet flag passes in - no output will be
available, even if no modified files exists.

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

4 years agoFix frame pointer layout on AArch64 Linux.
Owen Anderson [Wed, 26 Aug 2020 16:09:28 +0000 (16:09 +0000)]
Fix frame pointer layout on AArch64 Linux.

When floating point callee-saved registers were used, the frame pointer would
incorrectly point to the bottom of the CSR space (containing saved floating-point
registers), rather than to the frame record.

While all frame offsets were calculated consistently, resulting in working code,
this prevented stack walkers from being about to traverse the frame list.

4 years ago[LV] Fallback strategies if tail-folding fails
Sjoerd Meijer [Wed, 26 Aug 2020 15:55:25 +0000 (16:55 +0100)]
[LV] Fallback strategies if tail-folding fails

This implements 2 different vectorisation fallback strategies if tail-folding
fails: 1) don't vectorise at all, or 2) vectorise using a scalar epilogue. This
can be controlled with option -prefer-predicate-over-epilogue, that has been
changed to take a numeric value corresponding to the tail-folding preference
and preferred fallback.

Patch by: Pierre van Houtryve, Sjoerd Meijer.

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

4 years ago[LiveDebugValues][NFC] Add instr-ref tests, adapt old tests
Jeremy Morse [Tue, 25 Aug 2020 15:43:47 +0000 (16:43 +0100)]
[LiveDebugValues][NFC] Add instr-ref tests, adapt old tests

This patch adds a few tests in DebugInfo/MIR/InstrRef/ of interesting
behaviour that the instruction referencing implementation of
LiveDebugValues has. Mostly, these tests exist to ensure that if you
give the "-experimental-debug-variable-locations" command line switch,
the right implementation runs; and to ensure it behaves the same way as
the VarLoc LiveDebugValues implementation.

I've also touched roughly 30 other tests, purely to make the tests less
rigid about what output to accept. DBG_VALUE instructions are usually
printed with a trailing !debug-location indicating its scope:

  !debug-location !1234

However InstrRefBasedLDV produces new DebugLoc instances on the fly,
meaning there sometimes isn't a numbered node when they're printed,
making the output:

  !debug-location !DILocation(line: 0, blah blah)

Which causes a ton of these tests to fail. This patch removes checks for
that final part of each DBG_VALUE instruction. None of them appear to
be actually checking the scope is correct, just that it's present, so
I don't believe there's any loss in coverage here.

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

4 years ago[libc++] Use xcrun to find Ninja in the macOS backdeployment CI too
Louis Dionne [Wed, 26 Aug 2020 15:32:40 +0000 (11:32 -0400)]
[libc++] Use xcrun to find Ninja in the macOS backdeployment CI too

4 years ago[Clang] Fix tests following rG087047144210
Alexandre Ganea [Wed, 26 Aug 2020 15:32:17 +0000 (11:32 -0400)]
[Clang] Fix tests following rG087047144210

4 years ago[clang][NFC] Properly fix a GCC warning in ASTImporterTest.cpp
Raphael Isemann [Wed, 26 Aug 2020 14:37:35 +0000 (16:37 +0200)]
[clang][NFC] Properly fix a GCC warning in ASTImporterTest.cpp

Follow up to c9b45ce1fd97531c228e092bedee719b971f82a3 which just defined
the function instead of just 'using' the function from the base class (thanks
David).

4 years ago[clangd] Use string[] for allCommitCharacters
Kirill Bobyrev [Wed, 26 Aug 2020 15:08:00 +0000 (17:08 +0200)]
[clangd] Use string[] for allCommitCharacters

As per LSP specification, allCommitCharacters should be string[] instead of
string:

https://microsoft.github.io/language-server-protocol/specification#textDocument_completion

Reviewed By: sammccall

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

4 years ago[libc++] Always run Ninja through xcrun in the macOS CI scripts
Louis Dionne [Wed, 26 Aug 2020 14:44:38 +0000 (10:44 -0400)]
[libc++] Always run Ninja through xcrun in the macOS CI scripts

Ninja isn't installed by default on OSX, so run it through xcrun to find
the one in the developer tools if needed.

4 years ago[clangd] Enable recovery-ast-type by default.
Haojian Wu [Wed, 26 Aug 2020 14:46:24 +0000 (16:46 +0200)]
[clangd] Enable recovery-ast-type by default.

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

4 years agoBump -len_control value in fuzzer-custommutator.test (PR47286)
Hans Wennborg [Wed, 26 Aug 2020 14:44:55 +0000 (16:44 +0200)]
Bump -len_control value in fuzzer-custommutator.test (PR47286)

to make the test more stable, as suggested by mmoroz.

4 years agoFix failing tests after VCTOOLSDIR change
Zachary Henkel [Wed, 26 Aug 2020 14:30:33 +0000 (16:30 +0200)]
Fix failing tests after VCTOOLSDIR change

Switch from hardcoded x64 arch to a regex in the target triple

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

4 years ago[lldb][NFC] Simplify string literal in GDBRemoteCommunicationClient
Raphael Isemann [Wed, 26 Aug 2020 09:49:28 +0000 (11:49 +0200)]
[lldb][NFC] Simplify string literal in GDBRemoteCommunicationClient

4 years ago[AMDGPU] Make more use of Subtarget reference in SIInstrInfo
Jay Foad [Wed, 26 Aug 2020 13:53:41 +0000 (14:53 +0100)]
[AMDGPU] Make more use of Subtarget reference in SIInstrInfo

4 years ago[OpenMP] Fix build on macOS sdk 10.12 and newer
AndreyChurbanov [Wed, 26 Aug 2020 13:52:46 +0000 (16:52 +0300)]
[OpenMP] Fix build on macOS sdk 10.12 and newer

Patch by nihui (Ni Hui)

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

4 years ago[libc] Add implementations for sqrt, sqrtf, and sqrtl.
Tue Ly [Tue, 28 Jul 2020 05:41:36 +0000 (01:41 -0400)]
[libc] Add implementations for sqrt, sqrtf, and sqrtl.

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

4 years ago[LegalizeTypes] Add ROTL/ROTR to ScalarizeVectorResult.
Jay Foad [Wed, 26 Aug 2020 08:41:23 +0000 (09:41 +0100)]
[LegalizeTypes] Add ROTL/ROTR to ScalarizeVectorResult.

We can scalarize these just like any other binary operation.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47303 caused by D77152.

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

4 years ago[Support] Allow printing the stack trace only for a given depth
Dibya Ranjan Mishra [Wed, 26 Aug 2020 13:21:34 +0000 (09:21 -0400)]
[Support] Allow printing the stack trace only for a given depth

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

4 years agoAMDGPU: Use Subtarget reference in SIInstrInfo
Matt Arsenault [Wed, 26 Aug 2020 13:15:25 +0000 (09:15 -0400)]
AMDGPU: Use Subtarget reference in SIInstrInfo

4 years agoAdd clang-cl "vctoolsdir" option to specify the location of the msvc toolchain
Zachary Henkel [Wed, 26 Aug 2020 12:58:39 +0000 (14:58 +0200)]
Add clang-cl "vctoolsdir" option to specify the location of the msvc toolchain

Add an option to directly specify where the msvc toolchain lives for
clang-cl and avoid unwanted file and registry probes.

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

4 years agoAMDGPU/GlobalISel: Tolerate negated control flow intrinsic outputs
Matt Arsenault [Tue, 25 Aug 2020 23:53:32 +0000 (19:53 -0400)]
AMDGPU/GlobalISel: Tolerate negated control flow intrinsic outputs

If the condition output is negated, swap the branch targets. This is
similar to what SelectionDAG does for when SelectionDAGBuilder
decides to invert the condition and swap the branches.

This is leaving behind a dead constant def for some reason.

4 years agoGlobalISel: Combine G_ADD of G_PTRTOINT to G_PTR_ADD
Matt Arsenault [Sun, 16 Aug 2020 15:49:41 +0000 (11:49 -0400)]
GlobalISel: Combine G_ADD of G_PTRTOINT to G_PTR_ADD

This produces less work for addressing mode matching. I think this is
safe since I don't think machine IR is supposed to give the same
aliasing properties as getelementptr in the IR.

4 years ago[AMDGPU][GlobalISel] Eliminate barrier if workgroup size is not greater than wavefron...
Jay Foad [Wed, 26 Aug 2020 10:41:39 +0000 (11:41 +0100)]
[AMDGPU][GlobalISel] Eliminate barrier if workgroup size is not greater than wavefront size

If a workgroup size is known to be not greater than wavefront size
the s_barrier instruction is not needed since all threads are guaranteed
to come to the same point at the same time.

This is the same optimization that was implemented for SelectionDAG in
D31731.

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

4 years ago[DWARFYAML] Make the unit_length and header_length fields optional.
Xing GUO [Wed, 26 Aug 2020 12:34:36 +0000 (20:34 +0800)]
[DWARFYAML] Make the unit_length and header_length fields optional.

This patch makes the unit_length and header_length fields of line tables
optional. yaml2obj is able to infer them for us.

Reviewed By: jhenderson

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

4 years ago[Scheduling] Implement a new way to cluster loads/stores
QingShan Zhang [Wed, 26 Aug 2020 12:26:21 +0000 (12:26 +0000)]
[Scheduling] Implement a new way to cluster loads/stores

Before calling target hook to determine if two loads/stores are clusterable,
we put them into different groups to avoid fake cluster due to dependency.
For now, we are putting the loads/stores into the same group if they have
the same predecessor. We assume that, if two loads/stores have the same
predecessor, it is likely that, they didn't have dependency for each other.

However, one SUnit might have several predecessors and for now, we just
pick up the first predecessor that has non-data/non-artificial dependency,
which is too arbitrary. And we are struggling to fix it.

So, I am proposing some better implementation.
1. Collect all the loads/stores that has memory info first to reduce the complexity.
2. Sort these loads/stores so that we can stop the seeking as early as possible.
3. For each load/store, seeking for the first non-dependency instruction with the
   sorted order, and check if they can cluster or not.

Reviewed By: Jay Foad

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

4 years ago[mlir][PDL] Add a PDL Interpreter Dialect
River Riddle [Wed, 26 Aug 2020 12:12:07 +0000 (05:12 -0700)]
[mlir][PDL] Add a PDL Interpreter Dialect

The PDL Interpreter dialect provides a lower level abstraction compared to the PDL dialect, and is targeted towards low level optimization and interpreter code generation. The dialect operations encapsulates low-level pattern match and rewrite "primitives", such as navigating the IR (Operation::getOperand), creating new operations (OpBuilder::create), etc. Many of the operations within this dialect also fuse branching control flow with some form of a predicate comparison operation. This type of fusion reduces the amount of work that an interpreter must do when executing.

An example of this representation is shown below:

```mlir
// The following high level PDL pattern:
pdl.pattern : benefit(1) {
  %resultType = pdl.type
  %inputOperand = pdl.input
  %root, %results = pdl.operation "foo.op"(%inputOperand) -> %resultType
  pdl.rewrite %root {
    pdl.replace %root with (%inputOperand)
  }
}

// May be represented in the interpreter dialect as follows:
module {
  func @matcher(%arg0: !pdl.operation) {
    pdl_interp.check_operation_name of %arg0 is "foo.op" -> ^bb2, ^bb1
  ^bb1:
    pdl_interp.return
  ^bb2:
    pdl_interp.check_operand_count of %arg0 is 1 -> ^bb3, ^bb1
  ^bb3:
    pdl_interp.check_result_count of %arg0 is 1 -> ^bb4, ^bb1
  ^bb4:
    %0 = pdl_interp.get_operand 0 of %arg0
    pdl_interp.is_not_null %0 : !pdl.value -> ^bb5, ^bb1
  ^bb5:
    %1 = pdl_interp.get_result 0 of %arg0
    pdl_interp.is_not_null %1 : !pdl.value -> ^bb6, ^bb1
  ^bb6:
    pdl_interp.record_match @rewriters::@rewriter(%0, %arg0 : !pdl.value, !pdl.operation) : benefit(1), loc([%arg0]), root("foo.op") -> ^bb1
  }
  module @rewriters {
    func @rewriter(%arg0: !pdl.value, %arg1: !pdl.operation) {
      pdl_interp.replace %arg1 with(%arg0)
      pdl_interp.return
    }
  }
}
```

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

4 years ago[llvm/Object] - Make dyn_cast<XCOFFObjectFile> work as it should.
Georgii Rymar [Tue, 25 Aug 2020 14:44:39 +0000 (17:44 +0300)]
[llvm/Object] - Make dyn_cast<XCOFFObjectFile> work as it should.

Currently, `dyn_cast<XCOFFObjectFile>` always does cast and returns a pointer,
even when we pass `ELF`/`Wasm`/`Mach-O` or `COFF` instead of `XCOFF`.

It happens because `XCOFFObjectFile` class does not implement `classof`.
I've fixed it and added a unit test.

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

4 years ago[ARM] Increase MVE gather/scatter cost by MVECostFactor.
David Green [Wed, 26 Aug 2020 12:03:46 +0000 (13:03 +0100)]
[ARM] Increase MVE gather/scatter cost by MVECostFactor.

MVE Gather scatter codegeneration is looking a lot better than it used
to, but still has some issues. The instructions we currently model as 1
cycle per element, which is a bit low for some cases. Increasing the
cost by the MVECostFactor brings them in-line with our other instruction
costs. This will have the effect of only generating then when the extra
benefit is more likely to overcome some of the issues. Notably in
running out of registers and vectorizing loops that could otherwise be
SLP vectorized.

In the short-term whilst we look at other ways of dealing with those
more directly, we can increase the costs of gathers to make them more
likely to be beneficial when created.

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

4 years ago[llvm-readobj][test] - Commit trivial.obj.elf-amdhsa-gfx803 binary back.
Georgii Rymar [Wed, 26 Aug 2020 11:56:40 +0000 (14:56 +0300)]
[llvm-readobj][test] - Commit trivial.obj.elf-amdhsa-gfx803 binary back.

It was removed in rGcbedbd12e9837e049f0a936636a82ff39b75692b by mistake.

4 years ago[llvm-readobj/elf][test] - Add testing for EM_* specific OS/ABI values.
Georgii Rymar [Fri, 21 Aug 2020 11:24:12 +0000 (14:24 +0300)]
[llvm-readobj/elf][test] - Add testing for EM_* specific OS/ABI values.

We have no tests for OS/ABI values specific to
EM_TI_C6000, ELFOSABI_AMDGPU_MESA3D and ELFOSABI_ARM machines.

Also, related arrays in the code are not grouped together.
(That is why such testing was missed I guess).

The patch fixes that all.

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

4 years ago[RDA] Don't visit the BB of the instruction in getReachingUniqueMIDef
Sam Tebbs [Wed, 26 Aug 2020 10:11:15 +0000 (11:11 +0100)]
[RDA] Don't visit the BB of the instruction in getReachingUniqueMIDef

If the basic block of the instruction passed to getUniqueReachingMIDef
is a transitive predecessor of itself and has a definition of the
register, the function will return that definition even if it is after
the instruction given to the function. This patch stops the function
from scanning the instruction's basic block to prevent this.

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

4 years ago[gn build] Port 357dc1ed125
LLVM GN Syncbot [Wed, 26 Aug 2020 11:33:42 +0000 (11:33 +0000)]
[gn build] Port 357dc1ed125

4 years ago[libunwind] Convert x86, x86_64, arm64 register restore functions to C calling conven...
Martin Storsjö [Sun, 16 Aug 2020 12:12:55 +0000 (15:12 +0300)]
[libunwind] Convert x86, x86_64, arm64 register restore functions to C calling convention and name mangling

Currently, the assembly functions for restoring register state have
been direct implementations of the Registers_*::jumpto() method
(contrary to the functions for saving register state, which are
implementations of the extern C function __unw_getcontext). This has
included having the assembly function name match the C++ mangling of
that method name (and having the function match the C++ member
function calling convention). To simplify the interface of the assembly
implementations, make the functions have C calling conventions and
name mangling.

This fixes building the library in with a MSVC C++ ABI with clang-cl,
which uses a significantly different method name mangling scheme.
(The library might not be of much use as C++ exception unwinder in such
an environment, but the libunwind.h interface for stepwise unwinding
still is usable, as is the _Unwind_Backtrace function.)

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

4 years agoCopy m_plan_is_for_signal_trap member.
Benjamin Kramer [Wed, 26 Aug 2020 11:25:41 +0000 (13:25 +0200)]
Copy m_plan_is_for_signal_trap member.

Otherwise it would stay uninitialized. Found by msan.

4 years ago[obj2yaml] - Cleanup error reporting (remove Error.cpp/.h files)
Georgii Rymar [Tue, 25 Aug 2020 11:55:25 +0000 (14:55 +0300)]
[obj2yaml] - Cleanup error reporting (remove Error.cpp/.h files)

This removes Error.cpp/.h files from obj2yaml.
These files are not needed because we are
using `Error`s instead of error codes widely and do
not need a logic related to obj2yaml specific
error codes anymore.

I had to adjust just a few lines of tool's code
to remove remaining dependencies.

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

4 years ago[lldb/DWARF] More DW_AT_const_value fixes
Pavel Labath [Fri, 21 Aug 2020 13:13:29 +0000 (15:13 +0200)]
[lldb/DWARF] More DW_AT_const_value fixes

This fixes several issues in handling of DW_AT_const_value attributes:
- the first is that the size of the data given by data forms does not
  need to match the size of the underlying variable. We already had the
  case to handle this for DW_FORM_(us)data -- this extends the handling
  to other data forms. The main reason this was not picked up is because
  clang uses leb forms in these cases while gcc prefers the fixed-size
  ones.
- The handling of DW_AT_strp form was completely broken -- we would end
  up using the pointer value as the result. I've reorganized this code
  so that it handles all string forms uniformly.
- In case of a completely bogus form we would crash due to
  strlen(nullptr).

Depends on D86311.

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

4 years ago[llvm-readobj] - Don`t crash when --section-symbols is requested for an object w...
Georgii Rymar [Tue, 25 Aug 2020 10:37:32 +0000 (13:37 +0300)]
[llvm-readobj] - Don`t crash when --section-symbols is requested for an object w/o .symtab.

llvm-readobj crashes when `-S --section-symbols` is used
on an object that has no symbol table.

The patch fixes it.

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

4 years ago[llvm-readelf][test] - Refine the sections-ext.test
Georgii Rymar [Mon, 24 Aug 2020 13:24:36 +0000 (16:24 +0300)]
[llvm-readelf][test] - Refine the sections-ext.test

The `sections-ext.test` is a test for ELF that is used
to test `--st`, `--sr` and `--sd` extension options for `-S`.

There are 2 problems with it:
1) It is broken, because for CHECK lines it contains there is
no corresponding `FileCheck` call.

2) It uses the precompiled object: `trivial.obj.elf-i386`.
This is the last ELF test where `trivial.obj.elf-i386` is used so we can get
rid of the binary and use an YAML description.

Also, there is a `Inputs/trivial.ll` file that describes how `trivial*` objects
in `Inputs` folders are created. I've removed it from `ELF`, because it is not
actual anymore (we have no more input binaries created with the use of trivial.ll there)
and copied the refined versions of it to `COFF`, `MachO` and `wasm` Input folders.

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

4 years ago[SystemZ/ZOS] Additions to the build system.
Kai Nacke [Thu, 9 Jul 2020 12:17:33 +0000 (14:17 +0200)]
[SystemZ/ZOS] Additions to the build system.

This change extend the CMake files with the necessary additions
to build LLVM for z/OS.

Reviewed By: hubert.reinterpretcast

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

4 years ago[lldb] Correct wording of EXP_MSG
David Spickett [Tue, 25 Aug 2020 15:50:03 +0000 (16:50 +0100)]
[lldb] Correct wording of EXP_MSG

EXP_MSG generates a message to show on assert
failure. Currently it looks like:
AssertionError: False is not True : '<cmd>'
returns expected result, got '<actual output>'

Which seems to say that the test failed but
also got the expected result.

It should say:
AssertionError: False is not True : '<cmd>'
returned unexpected result, got '<actual output>'

Reviewed By: teemperor, #lldb

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

4 years ago[X86] Make sure we do not clobber RBX with mwaitx when used as a base
Pierre Gousseau [Wed, 15 Jan 2020 18:33:28 +0000 (18:33 +0000)]
[X86] Make sure we do not clobber RBX with mwaitx when used as a base
pointer.

mwaitx uses EBX as one of its argument.
Using this instruction clobbers RBX as it is defined to hold one of the
input. When the backend uses dynamically allocated stack, RBX is used as
a reserved register for the base pointer.

This patch is adapted from @qcolombet patch for cmpxchg at r263325.

This fixes PR43528.

Reviewed By: craig.topper

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

4 years ago[GlobalISel] Fix and tidy up documentation for ValueMapping class (NFC)
Gabriel Hjort Åkerlund [Wed, 26 Aug 2020 08:53:02 +0000 (10:53 +0200)]
[GlobalISel] Fix and tidy up documentation for ValueMapping class (NFC)

The documentation was missing a '*/' in '/*<2x32-bit> vadd {0, 64, VPR}',
and the example code are now aligned to improve readability.

Reviewed By: arsenm

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