platform/upstream/llvm.git
4 years ago[LTO] Replace hand-rolled endian conversion with support::endian. NFCI.
Benjamin Kramer [Mon, 6 Apr 2020 11:23:27 +0000 (13:23 +0200)]
[LTO] Replace hand-rolled endian conversion with support::endian. NFCI.

4 years ago[RuntimeDyld] Replace hand-rolled endian conversion with support::endian. NFCI.
Benjamin Kramer [Mon, 6 Apr 2020 11:22:53 +0000 (13:22 +0200)]
[RuntimeDyld] Replace hand-rolled endian conversion with support::endian. NFCI.

4 years ago[llvm-bcanalyzer] Simplify code. NFCI.
Benjamin Kramer [Mon, 6 Apr 2020 10:50:34 +0000 (12:50 +0200)]
[llvm-bcanalyzer] Simplify code. NFCI.

4 years ago[ARM] MVE vqmovn tests. NFC.
David Green [Mon, 6 Apr 2020 09:26:40 +0000 (10:26 +0100)]
[ARM] MVE vqmovn tests. NFC.

4 years ago[VE] Update lea/load/store instructions
Kazushi (Jam) Marukawa [Mon, 6 Apr 2020 07:17:20 +0000 (09:17 +0200)]
[VE] Update lea/load/store instructions

Summary:
Modify lea/load/store instructions to accept `disp(index, base)`
style addressing mode (called ASX format).  Also, uniform the
number of DAG nodes to have 3 operands for this ASX format
instructions, and update selectADDR functions to lower
appropriate MI.

Reviewers: arsenm, simoll, k-ishizaka

Reviewed By: simoll

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

4 years agoRevert "[IPRA][ARM] Spill extra registers at -Oz"
Oliver Stannard [Mon, 6 Apr 2020 09:33:55 +0000 (10:33 +0100)]
Revert "[IPRA][ARM] Spill extra registers at -Oz"

Reverting because this is causing failures on bots with expensive checks
enabled.

This reverts commit 73cea83a6f5ab521edf3cccfc603534776d691ec.

4 years ago[lldb] Add option to retry Fix-Its multiple times to failed expressions
Raphael Isemann [Mon, 6 Apr 2020 09:08:12 +0000 (11:08 +0200)]
[lldb] Add option to retry Fix-Its multiple times to failed expressions

Summary:
Usually when Clang emits an error Fix-It it does two things. It emits the diagnostic and then it fixes the
currently generated AST to reflect the applied Fix-It. While emitting the diagnostic is easy to implement,
fixing the currently generated AST is often tricky. That causes that some Fix-Its just keep the AST as-is or
abort the parsing process entirely. Once the parser stopped, any Fix-Its for the rest of the expression are
not detected and when the user manually applies the Fix-It, the next expression will just produce a new
Fix-It.

This is often occurring with quickly made Fix-Its that are just used to bridge temporary API changes
and that often are not worth implementing a proper API fixup in addition to the diagnostic. To still
give some kind of reasonable user-experience for users that have these Fix-Its and rely on them to
fix their expressions, this patch adds the ability to retry parsing with applied Fix-Its multiple time to
give the normal Fix-It experience where things Clang knows how to fix are not causing actual expression
error (at least when automatically applying Fix-Its is activated).

The way this is implemented is just by having another setting in the expression options that specify how
often we should try applying Fix-Its and then reparse the expression. The default setting is still 1 for everyone
so this should not affect the speed in which we fail to parse expressions.

Reviewers: jingham, JDevlieghere, friss, shafik

Reviewed By: shafik

Subscribers: shafik, abidh

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

4 years ago[AArch64][SVE] Add SVE intrinsics for saturating add & subtract
Kerry McLaughlin [Mon, 6 Apr 2020 08:35:05 +0000 (09:35 +0100)]
[AArch64][SVE] Add SVE intrinsics for saturating add & subtract

Summary:
Adds the following intrinsics:
  - @llvm.aarch64.sve.[s|u]qadd.x
  - @llvm.aarch64.sve.[s|u]qsub.x

Reviewers: sdesmalen, c-rhodes, dancgr, efriedma, cameron.mcinally, rengolin

Reviewed By: efriedma

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

Tags: #llvm

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

4 years ago[Matrix] Add option to use row-major matrix layout as default.
Florian Hahn [Mon, 6 Apr 2020 08:43:41 +0000 (09:43 +0100)]
[Matrix] Add option to use row-major matrix layout as default.

This patch adds a -matrix-default-layout option which can be used to
set the default matrix layout to row-major or column-major (default).

The initial patch updates codegen for loads, stores, binary operators
and matrix multiply.

Reviewers: anemet, Gerolf, andrew.w.kaylor, LuoYuanke

Reviewed By: anemet

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

4 years ago[clang] fix undefined behaviour in RawComment::getFormattedText()
Oliver Bruns [Mon, 6 Apr 2020 08:38:30 +0000 (10:38 +0200)]
[clang] fix undefined behaviour in RawComment::getFormattedText()

Summary:
Calling `back()` and `pop_back()` on the empty string is undefined
behavior [1,2].

The issue manifested itself as an uncaught `std::out_of_range` exception
when running `clangd` compiled on RHEL7 using devtoolset-9.

[1] https://en.cppreference.com/w/cpp/string/basic_string/back
[2] https://en.cppreference.com/w/cpp/string/basic_string/pop_back

Fixes: 1ff7c32fc91c607b690d4bb9cf42f406be8dde68

Reviewers: teemperor, ioeric, cfe-commits

Reviewed By: teemperor

Subscribers: ilya-biryukov, kadircet, usaxena95

Tags: #clang

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

4 years ago[lldb] Also apply Fix-Its in "note:" diagnostics that belong to an error diagnostic
Raphael Isemann [Mon, 6 Apr 2020 07:44:04 +0000 (09:44 +0200)]
[lldb] Also apply Fix-Its in "note:" diagnostics that belong to an error diagnostic

Summary:
LLDB currently applies Fix-Its if they are attached to a Clang diagnostic that has the
severity "error". Fix-Its connected to warnings and other severities are supposed to
be ignored as LLDB doesn't seem to trust Clang Fix-Its in these situations.

However, LLDB also ignores all Fix-Its coming from "note:" diagnostics. These diagnostics
are usually emitted alongside other diagnostics (both warnings and errors), either to keep
a single diagnostic message shorter or because the Fix-It is in a different source line. As they
are technically their own (non-error) diagnostics, we currently are ignoring all Fix-Its associated with them.

For example, this is a possible Clang diagnostic with a Fix-It that is currently ignored:
```
error: <user expression 1>:2:10: too many arguments provided to function-like macro invocation
ToStr(0, {,})
         ^
<user expression 1>:1:9: macro 'ToStr' defined here
#define ToStr(x) #x
        ^
<user expression 1>:2:1: cannot use initializer list at the beginning of a macro argument
ToStr(0, {,})
^        ~~~~
```

We also don't store "note:" diagnostics at all, as LLDB's abstraction around the whole diagnostic
concept doesn't have such a concept. The text of "note:" diagnostics is instead
appended to the last non-note diagnostic (which is causing that there is no "note:" text in the
diagnostic above, as all the "note:" diagnostics have been appended to the first "error: ..." text).

This patch fixes the ignored Fix-Its in note-diagnostics by appending them to the last non-note
diagnostic, similar to the way we handle the text in these diagnostics.

Reviewers: JDevlieghere, jingham

Reviewed By: JDevlieghere

Subscribers: abidh

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

4 years ago[lldb] XFAIL TestThreadPlanCommands _only_ on aarch64
Pavel Labath [Mon, 6 Apr 2020 08:29:19 +0000 (10:29 +0200)]
[lldb] XFAIL TestThreadPlanCommands _only_ on aarch64

The test works fine on x86-linux.

4 years ago[Matrix] Add initial tiling for load/multiply/store chains.
Florian Hahn [Mon, 6 Apr 2020 08:24:03 +0000 (09:24 +0100)]
[Matrix] Add initial tiling for load/multiply/store chains.

This patch adds initial fusion for load/multiply/store chains of matrix
operations.

The patch contains roughly two parts:

1. Code generation for a fused load/multiply/store chain (LowerMatrixMultiplyFused).
First, we ensure that both loads of the multiply operands do not alias the store.
If they do, we create new non-aliasing copies of the operands. Note that this
may introduce new basic block. Finally we process TileSize x TileSize blocks.
That is: load tiles from the input operands, multiply and store them.

2. Identify fusion candidates & matrix instructions.
As a first step, collect all instructions with shape info and fusion candidates
(currently @llvm.matrix.multiply calls). Next, try to fuse candidates and
collect instructions eliminated by fusion. Finally iterate over all matrix
instructions, skip the ones eliminated by fusion and lower the rest as usual.

Reviewers: anemet, Gerolf, hfinkel, andrew.w.kaylor, LuoYuanke

Reviewed By: anemet

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

4 years ago[MLIR] Change return type of ParallelOp::getInductionVars to ValueRange.
Alexander Belyaev [Mon, 6 Apr 2020 07:06:21 +0000 (09:06 +0200)]
[MLIR] Change return type of ParallelOp::getInductionVars to ValueRange.

The current return type sometimes leads to code like
to_vector<2>(ValueRange(loop.getInductionIvs())). It would be nice to
shorten it. Users who need access to Block::BlockArgListType (if there
are any), can always call getBody()->getArguments(); if needed.

Also remove getNumInductionVars(), since there is getNumLoops().

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

4 years agoRevert "[Alignment][NFC] Add DebugStr and operator*"
Guillaume Chatelet [Mon, 6 Apr 2020 07:55:25 +0000 (07:55 +0000)]
Revert "[Alignment][NFC] Add DebugStr and operator*"

This reverts commit 1e34ab98fc6f5ea7e264c0cd19d96b87cbd9c8a5.

4 years ago[lldb][NFC] Modernize lang/cpp/scope test
Raphael Isemann [Mon, 6 Apr 2020 07:02:49 +0000 (09:02 +0200)]
[lldb][NFC] Modernize lang/cpp/scope test

4 years ago[llvm-dwp] Fix a possible out of bound access.
Igor Kudrin [Fri, 20 Mar 2020 16:10:05 +0000 (23:10 +0700)]
[llvm-dwp] Fix a possible out of bound access.

llvm-dwp did not check section identifiers read from input files.
In the case of an unexpected identifier, the calculated index for
Contributions[] pointed outside the array. This fix avoids the issue
by skipping unsupported identifiers.

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

4 years ago[libc] NFC: Fix trivial typo in comments, documents, and messages
Kazuaki Ishizaki [Mon, 6 Apr 2020 07:18:55 +0000 (16:18 +0900)]
[libc] NFC: Fix trivial typo in comments, documents, and messages

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

4 years ago[Alignment][NFC] Add DebugStr and operator*
Guillaume Chatelet [Fri, 3 Apr 2020 13:55:17 +0000 (13:55 +0000)]
[Alignment][NFC] Add DebugStr and operator*

Summary:
Also updates files to use them.

This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: sdardis, hiraditya, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

4 years ago[DebugInfo] Fix reading range lists of v5 units in DWP.
Igor Kudrin [Wed, 1 Apr 2020 14:54:12 +0000 (21:54 +0700)]
[DebugInfo] Fix reading range lists of v5 units in DWP.

In package files, the base offset provided by index sections should be
used to find the contribution of a unit. The patch adds that base
offset when reading range list tables.

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

4 years ago[DebugInfo] Fix reading location tables headers of v5 units in DWP.
Igor Kudrin [Fri, 20 Mar 2020 16:33:19 +0000 (23:33 +0700)]
[DebugInfo] Fix reading location tables headers of v5 units in DWP.

This fixes the reading of location lists headers for compilation units
in package files by adjusting the reading offset according to the
corresponding record in the unit index. This is required for
DW_FORM_loclistx to work.

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

4 years ago[DebugInfo] Fix reading location tables of v5 units in DWP.
Igor Kudrin [Fri, 20 Mar 2020 16:33:19 +0000 (23:33 +0700)]
[DebugInfo] Fix reading location tables of v5 units in DWP.

Without the patch, all version 5 compile units in a DWP file read
location tables from the beginning of a .debug_loclists.dwo section.
The patch fixes that by adjusting the reading offset the same way as
for pre-v5 units. The section identifier to find the contribution
entry corresponds to the version of the unit.

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

4 years ago[DebugInfo] Support DWARFv5 index sections.
Igor Kudrin [Fri, 20 Mar 2020 16:26:56 +0000 (23:26 +0700)]
[DebugInfo] Support DWARFv5 index sections.

DWARFv5 defines index sections in package files in a slightly different
way than the pre-standard GNU proposal, see Section 7.3.5 in the DWARF
standard and https://gcc.gnu.org/wiki/DebugFissionDWP for GNU proposal.
The main concern here is values for section identifiers, which are
partially overlapped with changed meanings. The patch adds support for
v5 index sections and resolves that difficulty by defining a set of
identifiers for internal use which can represent and distinct values
of both standards.

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

4 years ago[DebugInfo] Rename section identifiers which are deprecated in DWARFv5. NFC.
Igor Kudrin [Fri, 20 Mar 2020 10:28:59 +0000 (17:28 +0700)]
[DebugInfo] Rename section identifiers which are deprecated in DWARFv5. NFC.

This is a preparation for an upcoming patch which adds support for
DWARFv5 unit index sections. The patch adds tag "_EXT_" to identifiers
which reference sections that are deprecated in the DWARFv5 standard.
See D75929 for the discussion.

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

4 years ago[llvm-dwp] Refactor handling of section identifiers. NFCI.
Igor Kudrin [Wed, 11 Mar 2020 14:54:51 +0000 (21:54 +0700)]
[llvm-dwp] Refactor handling of section identifiers. NFCI.

There is a number of places in llvm-dwp.cpp where a section identifier
is translated into an index of an internal array of section
contributions, and another place where the index is converted to an
on-disk value. All these places use direct expressions like
"<id> - DW_SECT_INFO" or "<index> + DW_SECT_INFO", exploiting the fact
that DW_SECT_INFO is the minimum valid value of that kind.

The patch adds distinct functions for that translation. The goal is to
make the code more readable and to prepare it to support index sections
of new versions, where the numeric scheme of section indexes is changed.

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

4 years agoPR45239: Don't deallocate TemplateIdAnnotations if they might still be
Richard Smith [Mon, 6 Apr 2020 06:10:08 +0000 (23:10 -0700)]
PR45239: Don't deallocate TemplateIdAnnotations if they might still be
in the token stream.

Previously we deleted all template-id annotations at the end of each
top-level declaration. That doesn't work: we can do some lookahead and
form a template-id annotation, and then roll back that lookahead, parse,
and decide that we're missing a semicolon at the end of a top-level
declaration, before we reach the annotation token. In that situation,
we'd end up parsing the annotation token after deleting its associated
data, leading to various forms of badness.

We now only delete template-id annotations if the preprocessor can
assure us that there are no annotation tokens left in the token stream
(or if we're already at EOF). This lets us delete the annotation tokens
earlier in a lot of cases; we now clean them up at the end of each
statement and class member, not just after each top-level declaration.
This also permitted some simplification of the delay-parsed templates
cleanup code.

4 years ago[DAGCombiner] Use getAnyExtOrTrunc instead of getSExtOrTrunc in the zext(setcc) combine.
Craig Topper [Mon, 6 Apr 2020 05:35:01 +0000 (22:35 -0700)]
[DAGCombiner] Use getAnyExtOrTrunc instead of getSExtOrTrunc in the zext(setcc) combine.

We're ANDing with 1 right after which will cause the SIGN_EXTEND to
be combined to ANY_EXTEND later. Might as well just start with an
ANY_EXTEND.

While there replace create the AND using the getZeroExtendInReg
helper to remove the need to explicitly create the VecOnes constant.

4 years ago[OpenMP][NFC] Move and simplify directive -> allowed clause mapping
Johannes Doerfert [Mon, 30 Mar 2020 05:57:28 +0000 (00:57 -0500)]
[OpenMP][NFC] Move and simplify directive -> allowed clause mapping

Move the listing of allowed clauses per OpenMP directive to the new
macro file in `llvm/Frontend/OpenMP`. Also, use a single generic macro
that specifies the directive and one allowed clause explicitly instead
of a dedicated macro per directive.

We save 800 loc and boilerplate for all new directives/clauses with no
functional change. We also need to include the macro file only once and
not once per directive.

Depends on D77112.

Reviewed By: JonChesterfield

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

4 years ago[OpenMP] Add extra qualification to OpenMP clause id
Johannes Doerfert [Mon, 6 Apr 2020 04:09:36 +0000 (23:09 -0500)]
[OpenMP] Add extra qualification to OpenMP clause id

Forgot to adjust this use in 419a559c5a73f13578d891feb1299cada08d581e.

4 years ago[DAGCombiner] Replace a hardcoded constant in visitZERO_EXTEND with a proper check...
Craig Topper [Mon, 6 Apr 2020 02:26:15 +0000 (19:26 -0700)]
[DAGCombiner] Replace a hardcoded constant in visitZERO_EXTEND with a proper check for the condition its trying to protect.

This code is replacing a shift with a new shift on an extended type.
If the shift amount type can't represent the maximum shift amount
for the new type, the amount needs to be extended to a type that
can.

Previously, the code just hardcoded a check for 256 bits which
seems to have been an assumption that the original shift amount
was MVT::i8. But that seems more catered to a specific target
like X86 that uses i8 as its legal shift amount type. Other
targets may use different types.

This commit changes the code to look at the real type of the shift
amount and makes sure it has enough bits for the Log2 of the
new type. There are similar checks to this in SelectionDAGBuilder
and LegalizeIntegerTypes.

4 years ago[clang] Persist Attr::IsPackExpansion into the PCH
Nathan Ridge [Wed, 1 Apr 2020 05:29:58 +0000 (01:29 -0400)]
[clang] Persist Attr::IsPackExpansion into the PCH

Summary: Fixes https://github.com/clangd/clangd/issues/309

Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[OpenMP][NFCI] Move OpenMP clause information to `lib/Frontend/OpenMP`
Johannes Doerfert [Tue, 31 Mar 2020 00:58:40 +0000 (19:58 -0500)]
[OpenMP][NFCI] Move OpenMP clause information to `lib/Frontend/OpenMP`

This is a cleanup and normalization patch that also enables reuse with
Flang later on. A follow up will clean up and move the directive ->
clauses mapping.

Reviewed By: fghanim

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

4 years agoExpose `attributor-disable` to the new and old pass managers
Tarindu Jayatilaka [Sun, 5 Apr 2020 16:45:19 +0000 (11:45 -0500)]
Expose `attributor-disable` to the new and old pass managers

The new and old pass managers (PassManagerBuilder.cpp and
PassBuilder.cpp) are exposed to an `extern` declaration of
`attributor-disable` option which will guard the addition of the
attributor passes to the pass pipelines.

Reviewed By: jdoerfert

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

4 years ago[ORC] Add MachO universal binary support to StaticLibraryDefinitionGenerator.
Lang Hames [Sat, 4 Apr 2020 16:50:56 +0000 (09:50 -0700)]
[ORC] Add MachO universal binary support to StaticLibraryDefinitionGenerator.

Add a new overload of StaticLibraryDefinitionGenerator::Load that takes a triple
argument and supports loading archives from MachO universal binaries in addition
to regular archives.

The LLI tool is updated to use this overload.

4 years ago[mlir][spirv] NFC: remove uncessary return after llvm_unreachable
Lei Zhang [Mon, 6 Apr 2020 00:00:56 +0000 (20:00 -0400)]
[mlir][spirv] NFC: remove uncessary return after llvm_unreachable

4 years agoDebugInfo: Fix default template parameter computation for dependent non-type template...
David Blaikie [Sun, 5 Apr 2020 19:49:02 +0000 (12:49 -0700)]
DebugInfo: Fix default template parameter computation for dependent non-type template parameters

This addresses the immediate bug, though in theory we could still
produce a default parameter for the DWARF in this test case - but other
cases will be definitely unachievable (you could have a default
parameter that cannot be evaluated - so long as the user overrode it
with another value rather than relying on that default)

4 years ago[mlir] Refactor and cleanup the translation facilities.
River Riddle [Sun, 5 Apr 2020 23:21:07 +0000 (16:21 -0700)]
[mlir] Refactor and cleanup the translation facilities.

Summary:
This revision performs several cleanups on the translation infra:
* Removes the TranslateCLParser library and consolidates into Translation
  - This was a weird library that existed in Support, and didn't really justify being a standalone library.
* Cleans up the internal registration and consolidates all of the translation functions within one registry.

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

4 years ago[mlir] Only number the parent operation in Block::printAsOperand
River Riddle [Sun, 5 Apr 2020 23:16:54 +0000 (16:16 -0700)]
[mlir] Only number the parent operation in Block::printAsOperand

Summary: Blocks are numbered locally within a region, so numbering above the parent region is unnecessary.

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

4 years agoPermit constant evaluation of mixed __builtin_memcmp between char and
Richard Smith [Sun, 5 Apr 2020 22:35:32 +0000 (15:35 -0700)]
Permit constant evaluation of mixed __builtin_memcmp between char and
char8_t.

4 years agoAdd documentation and testing for
Richard Smith [Sun, 5 Apr 2020 22:23:53 +0000 (15:23 -0700)]
Add documentation and testing for
2c88a485c71155c19e512f22c54e63ee337282a3.

Also extend it to cover memchr for consistency.

4 years agoRemove unused function 'isInRange'. NFCI.
Simon Pilgrim [Sun, 5 Apr 2020 22:11:24 +0000 (23:11 +0100)]
Remove unused function 'isInRange'. NFCI.

4 years ago[X86][SSE] Combine unary shuffle(HORIZOP,HORIZOP) -> HORIZOP
Simon Pilgrim [Sun, 5 Apr 2020 21:13:53 +0000 (22:13 +0100)]
[X86][SSE] Combine unary shuffle(HORIZOP,HORIZOP) -> HORIZOP

We had previously limited the shuffle(HORIZOP,HORIZOP) combine to binary shuffles, but we can often merge unary shuffles just as well, folding in UNDEF/ZERO values into the 64-bit half lanes.

For the (P)HADD/HSUB cases this is limited to fast-horizontal cases but PACKSS/PACKUS combines under all cases.

4 years ago[MLIR][NFC] Make AsmPrinter messages on null structures consistent
Uday Bondhugula [Sun, 5 Apr 2020 19:13:07 +0000 (00:43 +0530)]
[MLIR][NFC] Make AsmPrinter messages on null structures consistent

Make AsmPrinter messages on null structures consistent: use <<NULL ...>>.

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

4 years ago[mlir] Update the documentation on Canonicalization
River Riddle [Sun, 5 Apr 2020 19:11:51 +0000 (12:11 -0700)]
[mlir] Update the documentation on Canonicalization

Summary: This updates the canonicalization documentation, and properly documents the different ways of canonicalizing operations.

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

4 years ago[mlir][Pass] Add documentation for the declarative pass specification
River Riddle [Sun, 5 Apr 2020 18:50:05 +0000 (11:50 -0700)]
[mlir][Pass] Add documentation for the declarative pass specification

Summary:
This revision adds a section to WritingAPass to document the declarative specification, and how to use it.

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

4 years ago[InlineFunction] Update metadata on loads that are return values
Anna Thomas [Thu, 2 Apr 2020 21:05:35 +0000 (17:05 -0400)]
[InlineFunction] Update metadata on loads that are return values

This patch builds upon D76140 by updating metadata on pointer typed
loads in inlined functions, when the load is the return value, and the
callsite contains return attributes which can be updated as metadata on
the load.
Added test cases show this for nonnull, dereferenceable,
dereferenceable_or_null

Reviewed-By: jdoerfert
Differential Revision: https://reviews.llvm.org/D76792

4 years ago[DebugInfo]: Allow DwarfCompileUnit to have line table symbol
Sourabh Singh Tomar [Sat, 4 Apr 2020 19:29:11 +0000 (00:59 +0530)]
[DebugInfo]: Allow DwarfCompileUnit to have line table symbol

Previously line table symbol was represented as `DIE::value_iterator`
inside `DwarfCompileUnit` and subsequent function `intStmtList`
was used to create a local `MCSymbol` to initialize it.

This patch removes `DIE::value_iterator` from `DwarfCompileUnit`
and intoduce `MCSymbol` for representing this units symbol for
`debug_line` section. As a result `applyStmtList` is also modified
 to utilize this. Further more a helper function `getLineTableStartSym`
is also introduced to get this symbol, this would be used by clients
which need to access this line table, i.e `debug_macro`.

Reviewed By: dblaikie

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

4 years agoMake the AsmPrinter print "<<NULL TYPE>>" instead of crashing on null types
Mehdi Amini [Sun, 5 Apr 2020 03:01:21 +0000 (03:01 +0000)]
Make the AsmPrinter print "<<NULL TYPE>>" instead of crashing on null types

Even if this indicates in general a problem at call sites, the printer
is used for debugging and avoiding crashing is friendlier for example
when used in diagnostics or other printer.

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

4 years ago[ELF][test] Reorganize warn-backrefs.s
Fangrui Song [Sun, 5 Apr 2020 16:25:00 +0000 (09:25 -0700)]
[ELF][test] Reorganize warn-backrefs.s

4 years agomake ccabe93298 more robust
Nico Weber [Sun, 5 Apr 2020 17:07:50 +0000 (13:07 -0400)]
make ccabe93298 more robust

4 years agoclang: Make tests using symlinks more consistent.
Nico Weber [Sun, 5 Apr 2020 16:54:27 +0000 (12:54 -0400)]
clang: Make tests using symlinks more consistent.

Instead of checking if each symlink exists before removing it,
remove the whole temp dir housing the symlinks before recreating it.
This is a bit shorter, conceptually simpler (in that the first
and consecutive test runs have more similar behavior), it's what we're
already doing in almost all places where we do it, and it works if the
symlink exists but is a dead link (e.g. when it points into the build
dir but the build dir is renamed).

No intended behavior change.

4 years agoRemove the additional constant which requires an extra register for statepoint lowering.
Zuojian Lin [Sun, 5 Apr 2020 15:21:37 +0000 (11:21 -0400)]
Remove the additional constant which requires an extra register for statepoint lowering.

The newly-created constant zero will need an extra register to hold it
in the current statepoint lowering implementation. Remove it if there
exists one.

4 years ago[scan-build] fix dead store warnings emitted on LLVM AMDGPU code base
Apelete Seketeli [Sun, 5 Apr 2020 15:09:19 +0000 (11:09 -0400)]
[scan-build] fix dead store warnings emitted on LLVM AMDGPU code base

This fixes dead store warnings of the type "dead assignment" reported
by Clang Static Analyzer.

4 years agoFix typo in xfail decorator for lldb thread plan list tests
Muhammad Omair Javaid [Sun, 5 Apr 2020 15:16:43 +0000 (20:16 +0500)]
Fix typo in xfail decorator for lldb thread plan list tests

4 years agoAMDGPU/GlobalISel: Add some G_INSERT/G_EXTRACT select tests
Matt Arsenault [Sun, 5 Apr 2020 14:53:47 +0000 (10:53 -0400)]
AMDGPU/GlobalISel: Add some G_INSERT/G_EXTRACT select tests

4 years ago[ARM] Add data gathering hint instruction
Oliver Stannard [Sun, 5 Apr 2020 14:21:00 +0000 (15:21 +0100)]
[ARM] Add data gathering hint instruction

Summary:
This patch upstreams support the optional ARMv8.0 Data Gathering Hint (DGH)
extension, which adds the Data Gathering Hint instruction to the hint
space.

See ARMv8.0-DGH in the Arm Architecture Reference Manual Armv8 for more
information.

Reviewers: t.p.northover, rengolin, SjoerdMeijer, ab, danielkiss, samparker

Reviewed By: SjoerdMeijer

Subscribers: LukeGeeson, ostannard, kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

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

4 years ago[ARM] Add enhanced counter virtualization system registers
Oliver Stannard [Sun, 5 Apr 2020 13:49:49 +0000 (14:49 +0100)]
[ARM] Add enhanced counter virtualization system registers

Summary:
This patch upstreams support for the ARMv8.6A Enhanced Counter Virtualization
(ECV) extension, which adds 6 new system registers.

See ARMv8.6-ECV in the Arm Architecture Reference Manual Armv8 for more
information.

Reviewers: t.p.northover, rengolin, SjoerdMeijer, pcc, ab, chill

Reviewed By: SjoerdMeijer

Subscribers: LukeGeeson, ostannard, kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

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

4 years ago[MLIR] Add pattern rewriter util to erase block; remove dead else
Uday Bondhugula [Mon, 30 Mar 2020 19:45:40 +0000 (01:15 +0530)]
[MLIR] Add pattern rewriter util to erase block; remove dead else

Add a pattern rewriter utility to erase blocks (while notifying the
pattern rewriting driver of the erased ops). Use this to remove trivial
else blocks in affine.if ops.

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

4 years ago[InstCombine] convert bitcast-shuffle to vector trunc
Sanjay Patel [Sun, 5 Apr 2020 13:46:22 +0000 (09:46 -0400)]
[InstCombine] convert bitcast-shuffle to vector trunc

As discussed in D76983, that patch can turn a chain of insert/extract
with scalar trunc ops into bitcast+extract and existing instcombine
vector transforms end up creating a shuffle out of that (see the
PhaseOrdering test for an example). Currently, that process requires
at least this sequence: -instcombine -early-cse -instcombine.

Before D76983, the sequence of insert/extract would reach the SLP
vectorizer and become a vector trunc there.

Based on a small sampling of public targets/types, converting the
shuffle to a trunc is better for codegen in most cases (and a
regression of that form is the reason this was noticed). The trunc is
clearly better for IR-level analysis as well.

This means that we can induce "spontaneous vectorization" without
invoking any explicit vectorizer passes (at least a vector cast op
may be created out of scalar casts), but that seems to be the right
choice given that we started with a chain of insert/extract, and the
backend would expand back to that chain if a target does not support
the op.

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

4 years ago[MLIR][NFC] fix name operand -> userOp
Uday Bondhugula [Sun, 5 Apr 2020 05:07:08 +0000 (10:37 +0530)]
[MLIR][NFC] fix name operand -> userOp

The wrong name was confusing to read. value.getUsers() yields
Operation *s.

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

4 years ago[MLIR] fix greedy pattern rewrite driver iteration on change
Uday Bondhugula [Sun, 5 Apr 2020 02:59:52 +0000 (08:29 +0530)]
[MLIR] fix greedy pattern rewrite driver iteration on change

Removing dead ops should make the outer loop of the pattern rewriting
driver run again. Although its operands are added to the worklist, if no
changes happenned to them or remaining ops in the worklist, the driver
wouldn't run once again - but it should be.

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

4 years ago[ARM] Add ARMv8.6 Fine Grain Traps system registers
Oliver Stannard [Sun, 5 Apr 2020 12:58:00 +0000 (13:58 +0100)]
[ARM] Add ARMv8.6 Fine Grain Traps system registers

Summary:
This patch upstreams support for the ARMv8.6A Fine Grain Traps (FGT)
extension, which adds 5 new system registers.

See ARMv8.6-FGT in the Arm Architecture Reference Manual Armv8 for more
information.

Reviewers: t.p.northover, rengolin, SjoerdMeijer, ab, momchil.velikov

Reviewed By: SjoerdMeijer

Subscribers: LukeGeeson, ostannard, kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

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

4 years ago[InstCombine] enhance freelyNegateValue() by handling 'not'
Sanjay Patel [Sun, 5 Apr 2020 13:16:19 +0000 (09:16 -0400)]
[InstCombine] enhance freelyNegateValue() by handling 'not'

This patch extends D77230. If we have a 'not' instruction inside a
negated expression, we can ignore extra uses of that op because the
negation has a one-to-one replacement: negate becomes increment.

Alive2 examples of the test cases:
http://volta.cs.utah.edu:8080/z/T5-u9P
http://volta.cs.utah.edu:8080/z/eT89L6

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

4 years ago[ValueTracking] enhance matching of smin/smax with 'not' operands
Sanjay Patel [Sun, 5 Apr 2020 12:51:29 +0000 (08:51 -0400)]
[ValueTracking] enhance matching of smin/smax with 'not' operands

The cmyk tests are based on the known regression that resulted from:
rGf2fbdf76d8d0

So this improvement in analysis might be enough to restore that commit.

4 years ago[ARM] add ARMv8.6-A Activity monitors virtualization extension
Diogo Sampaio [Sun, 5 Apr 2020 11:39:59 +0000 (12:39 +0100)]
[ARM] add ARMv8.6-A Activity monitors virtualization extension

Summary:
This patch upstreams v8.6A activity monitors virtualization
assembler support, which consists of 32 new system
registers (two groups, each with 16 numbered registers).

See ARMv8.6-AMU in the Arm Architecture Reference Manual Armv8 for more
information.

Reviewers: t.p.northover, rengolin, SjoerdMeijer, ab, john.brawn, ostannard

Reviewed By: ostannard

Subscribers: LukeGeeson, dnsampaio, ostannard, kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

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

4 years ago[X86] Roll some loops. NFCI.
Benjamin Kramer [Sun, 5 Apr 2020 11:59:33 +0000 (13:59 +0200)]
[X86] Roll some loops. NFCI.

4 years ago[ValueTracking] Use Inst::comesBefore in isValidAssumeForCtx (NFC).
Florian Hahn [Sun, 5 Apr 2020 11:12:33 +0000 (12:12 +0100)]
[ValueTracking] Use Inst::comesBefore in isValidAssumeForCtx (NFC).

D51664 added Instruction::comesBefore which should provide better
performance than the manual check.

Reviewers: rnk, nikic, spatel

Reviewed By: nikic

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

4 years agoRevert "[libc++] Enable the new libc++ testing format by default"
David Zarzycki [Sun, 5 Apr 2020 10:58:29 +0000 (06:58 -0400)]
Revert "[libc++] Enable the new libc++ testing format by default"

This reverts commit 1580c76c4a08e24adc34ae0a4ff4f97969188268.

This causes libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp to
fail with a linker error on Fedora 31 (x86-64) release (no assert)
builds.

4 years ago[clang] Make libcxx test suite pass again after memcmp changes
David Zarzycki [Sun, 5 Apr 2020 10:15:18 +0000 (06:15 -0400)]
[clang] Make libcxx test suite pass again after memcmp changes

4 years agoRevert "Test had incorrect check for nonzero count"
David Zarzycki [Sat, 4 Apr 2020 12:13:54 +0000 (08:13 -0400)]
Revert "Test had incorrect check for nonzero count"

This reverts commit 210f40fe9a30212396311d265904b2d73859c53d.

4 years ago[X86][SSE] Generalize shuffle(HORIZOP,HORIZOP) -> HORIZOP combine
Simon Pilgrim [Sun, 5 Apr 2020 11:09:19 +0000 (12:09 +0100)]
[X86][SSE] Generalize shuffle(HORIZOP,HORIZOP) -> HORIZOP combine

Our existing combine allows to merge the shuffle of 2 similar 64-bit wide 'horizontal ops' (HADD/PACK/etc.) if the shuffle was a UNPCK/MOVSD.

This patch generalizes this to decode any target shuffle mask that can be widened to a 128-bit repeating v2*64 mask, which helps us catch PBLENDW/PBLENDD cases.

4 years ago[X86][SSE] truncateVectorWithPACK - upper undef for 128->64 packing
Simon Pilgrim [Sun, 5 Apr 2020 10:47:15 +0000 (11:47 +0100)]
[X86][SSE] truncateVectorWithPACK - upper undef for 128->64 packing

If we're packing from 128-bits to 64-bits then we don't need the RHS argument. This helps with register allocation, especially as we avoid repeating a use of the input value.

4 years ago[MLIR] Don't insert YieldOp for non-void loop.for by default.
Alexander Belyaev [Fri, 3 Apr 2020 15:57:41 +0000 (17:57 +0200)]
[MLIR] Don't insert YieldOp for non-void loop.for by default.

The ForOp::build ensures that there is a block terminator which is great for
the default use case when there are no iter_args and loop.for returns no
results.  In non-zero results case we always need to call replaceOpWithNewOp
which is not the nicest thing in the world. We can stop inserting YieldOp when
iter_args is non-empty. IfOp::build already behaves similarly.

4 years ago[mlir][ODS] Add support for variadic regions.
River Riddle [Sun, 5 Apr 2020 08:03:24 +0000 (01:03 -0700)]
[mlir][ODS] Add support for variadic regions.

Summary: This revision adds support for marking the last region as variadic in the ODS region list with the VariadicRegion directive.

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

4 years ago[clang-tools-extra] NFC: Fix trivial typo in documents and comments
Kazuaki Ishizaki [Sun, 5 Apr 2020 06:28:11 +0000 (15:28 +0900)]
[clang-tools-extra] NFC: Fix trivial typo in documents and comments

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

4 years ago[llvm-objdump] Simplify conditional statements (isa<...>(Obj) => Obj->isSomeFile())
vgxbj [Sun, 5 Apr 2020 04:31:22 +0000 (12:31 +0800)]
[llvm-objdump] Simplify conditional statements (isa<...>(Obj) => Obj->isSomeFile())

Summary: Simplify some conditional statements.

Reviewers: jhenderson, MaskRay, rupprecht

Reviewed By: MaskRay, rupprecht

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

4 years ago[llvm-nm] Add test for `--debug-syms --dynamic`
vgxbj [Sun, 5 Apr 2020 04:15:06 +0000 (12:15 +0800)]
[llvm-nm] Add test for `--debug-syms --dynamic`

Summary: This test ensures that `llvm-nm` will omit NULL symbol.

Reviewers: jhenderson, MaskRay, grimar

Reviewed By: jhenderson, grimar

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

4 years ago[llvm-objdump][test] Recommit unimplemented-features.test
vgxbj [Sun, 5 Apr 2020 03:47:27 +0000 (11:47 +0800)]
[llvm-objdump][test] Recommit unimplemented-features.test

Recommit test case that removed by rG685bf42e9e0cc79cff6d26cf44749db98f148270

4 years ago[llvm-objdump][test] Remove unimplemented-features.test
vgxbj [Sun, 5 Apr 2020 03:03:34 +0000 (11:03 +0800)]
[llvm-objdump][test] Remove unimplemented-features.test

Seems that this test breaks build bots.
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/41418

Commit it later.

4 years ago[llvm-objdump] Teach `llvm-objdump` dump dynamic symbols.
vgxbj [Sun, 5 Apr 2020 01:58:53 +0000 (09:58 +0800)]
[llvm-objdump] Teach `llvm-objdump` dump dynamic symbols.

Summary:
This patch is to teach `llvm-objdump` dump dynamic symbols (`-T` and `--dynamic-syms`). Currently, this patch is not fully compatible with `gnu-objdump`, but I would like to continue working on this in next few patches. It has two issues.

1. Some symbols shouldn't be marked as global(g). (`-t/--syms` has same issue as well) (Fixed by D75659)
2. `gnu-objdump` can dump version information and *dynamically* insert before symbol name field.

`objdump -T a.out` gives:

```
DYNAMIC SYMBOL TABLE:
0000000000000000  w   D  *UND*  0000000000000000              _ITM_deregisterTMCloneTable
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 printf
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 __libc_start_main
0000000000000000  w   D  *UND*  0000000000000000              __gmon_start__
0000000000000000  w   D  *UND*  0000000000000000              _ITM_registerTMCloneTable
0000000000000000  w   DF *UND*  0000000000000000  GLIBC_2.2.5 __cxa_finalize
```

`llvm-objdump -T a.out` gives:

```
DYNAMIC SYMBOL TABLE:
0000000000000000  w   D  *UND*  0000000000000000 _ITM_deregisterTMCloneTable
0000000000000000 g    DF *UND*  0000000000000000 printf
0000000000000000 g    DF *UND*  0000000000000000 __libc_start_main
0000000000000000  w   D  *UND*  0000000000000000 __gmon_start__
0000000000000000  w   D  *UND*  0000000000000000 _ITM_registerTMCloneTable
0000000000000000  w   DF *UND*  0000000000000000 __cxa_finalize
```

Reviewers: jhenderson, grimar, MaskRay, espindola

Reviewed By: jhenderson, grimar

Subscribers: emaste, rupprecht, llvm-commits

Tags: #llvm

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

4 years ago[mlir] NFC: Fix trivial typo
Kazuaki Ishizaki [Sun, 5 Apr 2020 02:30:01 +0000 (11:30 +0900)]
[mlir] NFC: Fix trivial typo

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

4 years ago[clang-tools-extra] NFC: Fix trivial typo in documents and comments
Kazuaki Ishizaki [Sun, 5 Apr 2020 02:25:24 +0000 (11:25 +0900)]
[clang-tools-extra] NFC: Fix trivial typo in documents and comments

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

4 years agoAMDGPU: Fix annotate kernel features through casted calls
Matt Arsenault [Tue, 11 Sep 2018 04:32:54 +0000 (11:32 +0700)]
AMDGPU: Fix annotate kernel features through casted calls

I thought I was testing this before, but the workitem id x
case isn't great since it's mandatory in the parent kernel.

4 years ago[Attributor] AAReachability : use isPotentiallyReachable in isKnownReachable
Shinji Okumura [Sun, 5 Apr 2020 00:15:26 +0000 (19:15 -0500)]
[Attributor] AAReachability : use isPotentiallyReachable in isKnownReachable

`isKnownReachable` had only interface (always returns true).
 Changed it to call `isPotentiallyReachable`.
This change enables deductions of other Abstract Attributes depending on
AAReachability to use reachability information obtained from CFG, and it
can make them stronger.

Reviewed By: jdoerfert

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

4 years ago[Attributor] Make use of analysis in the MustBeExecutedExplorer
Shinji Okumura [Sat, 4 Apr 2020 16:38:09 +0000 (11:38 -0500)]
[Attributor] Make use of analysis in the MustBeExecutedExplorer

This commit was made to settle [[ https://github.com/llvm/llvm-project/issues/175 | this issue on GitHub ]].
I added analysis getters for LoopInfo, DominatorTree, and
PostDominatorTree. And I added a test to show an improvement of the
deduction of `dereferenceable` attribute.

Reviewed By: jdoerfert, uenoku

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

4 years agoAMDGPU: Add feature for fast f32 denormals
Matt Arsenault [Wed, 15 Aug 2018 19:45:04 +0000 (22:45 +0300)]
AMDGPU: Add feature for fast f32 denormals

4 years ago[Attributor] AAUndefinedBehavior: Use AAValueSimplify in memory accessing instructions.
Stefanos Baziotis [Sat, 4 Apr 2020 23:46:26 +0000 (02:46 +0300)]
[Attributor] AAUndefinedBehavior: Use AAValueSimplify in memory accessing instructions.

Query AAValueSimplify on pointers in memory accessing instructions to take
advantage of the constant propagation (or any other value simplification) of such values.

4 years ago[compiler-rt] Fix build on NetBSD 9.99.52+
Kamil Rytarowski [Sat, 4 Apr 2020 22:54:55 +0000 (00:54 +0200)]
[compiler-rt] Fix build on NetBSD 9.99.52+

Add a fallback definition of the netsmb device driver that
was removed.

4 years ago[CostModel][X86] Add some insert subvector cost tests for vXf32/vXi32/vXi16/vXi8...
Simon Pilgrim [Sat, 4 Apr 2020 21:46:36 +0000 (22:46 +0100)]
[CostModel][X86] Add some insert subvector cost tests for vXf32/vXi32/vXi16/vXi8 types

4 years ago[X86] Cleanup vectorcall test checks
Simon Pilgrim [Sat, 4 Apr 2020 19:13:54 +0000 (20:13 +0100)]
[X86] Cleanup vectorcall test checks

PR32397 still needs to be fixed for the update script to process this

4 years ago[libc++] Enable the new libc++ testing format by default
Louis Dionne [Sat, 4 Apr 2020 20:53:35 +0000 (16:53 -0400)]
[libc++] Enable the new libc++ testing format by default

Both test formats are equivalent, so this *should* not be a problem.
However, I'm taking advantage of the week-end to test this and see if
there are any failures. If so, it should be fine to revert this until
the failures have been addressed.

For the time being, it is still possible to use the old format by passing
`--param=use_old_format=True` when running Lit.

4 years agolibcxx 'LLVM_USE_SANITIZER=Address;Undefined'
Brian Gesiak [Sat, 4 Apr 2020 17:01:32 +0000 (13:01 -0400)]
libcxx 'LLVM_USE_SANITIZER=Address;Undefined'

Summary:
Allow users to simultaneously enable address and undefined behavior
sanitizers, in the same manner that LLVM's 'HandleLLVMOptions.cmake'
allows.

Prior to this patch, `cmake -DLLVM_USE_SANITIZER="Address;Undefined"`
would succeed and the build would build most of the LLVM project with
`-fsanitize=address,undefined`, but a warning would be printed by
libcxx's CMake, and the build would use neither sanitizer. This
patch results in no warning being printed, and both sanitizers are used
in building libcxx.

Reviewers: jroelofs, EricWF, ldionne, #libc!

Subscribers: mgorny, dexonsmith, llvm-commits, libcxx-commits

Tags: #libc

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

4 years agoRevert "[DAG] Fix PR45049: LegalizeTypes crash"
Jonathan Roelofs [Sat, 4 Apr 2020 19:47:22 +0000 (13:47 -0600)]
Revert "[DAG] Fix PR45049: LegalizeTypes crash"

This reverts commit 17673ae0b2cbf8d48973b673d413fb8591d8aae7.

4 years ago[DAG] Fix PR45049: LegalizeTypes crash
Jonathan Roelofs [Sat, 28 Mar 2020 18:55:51 +0000 (12:55 -0600)]
[DAG] Fix PR45049: LegalizeTypes crash

Sometimes LegalizeTypes knows about common subexpressions before SelectionDAG
does, leading to accidental SDValue removal before its reference count was
truly zero.

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

https://reviews.llvm.org/D76994

4 years ago[ELF][PPC64] Enable R_PPC64_REL14 trunks
Fangrui Song [Fri, 27 Mar 2020 04:20:13 +0000 (21:20 -0700)]
[ELF][PPC64] Enable R_PPC64_REL14 trunks

The thunk implementation is available but an assertion disallows it.
Linux kernel has such a use case: in arch/powerpc/kernel/exceptions-64s.S:handle_page_fault,
beq+ ret_from_except_lite may get out of range.

Link: https://github.com/ClangBuiltLinux/linux/issues/951
Differential Revision: https://reviews.llvm.org/D76904

4 years ago[ELF][test] Test that thunks are processed before finalizeSynthetic(in.symTab)
Fangrui Song [Sat, 4 Apr 2020 17:24:48 +0000 (10:24 -0700)]
[ELF][test] Test that thunks are processed before finalizeSynthetic(in.symTab)

finalizeSynthetic(in.symTab) calls sortSymTabSymbols() to order local
symbols before non-local symbols.

The newly added tests ensure that thunk symbols are added before
finalizeSynthetic(in.symTab), otherwise .symtab would be out of order.

4 years ago[ValueTracking] add tests for smin/smax; NFC
Sanjay Patel [Sat, 4 Apr 2020 17:43:27 +0000 (13:43 -0400)]
[ValueTracking] add tests for smin/smax; NFC

4 years ago[InstCombine] add more tests for min/max folding; NFC
Sanjay Patel [Sat, 4 Apr 2020 15:36:12 +0000 (11:36 -0400)]
[InstCombine] add more tests for min/max folding; NFC

4 years ago[LV] Simplify tryToWiden as recipes are not re-used (NFC).
Florian Hahn [Sat, 4 Apr 2020 14:19:20 +0000 (15:19 +0100)]
[LV] Simplify tryToWiden as recipes are not re-used (NFC).

After 49d00824bbbb, VPWidenRecipe only stores a single instruction.
tryToWiden can simply return the widen recipe, like other helpers in
VPRecipeBuilder.

4 years ago[mlir] Add an out-of-tree dialect example
Jean-Michel Gorius [Sat, 4 Apr 2020 17:15:44 +0000 (17:15 +0000)]
[mlir] Add an out-of-tree dialect example

This adds a minimal out-of-tree dialect template which can be used to start work on a standalone dialect implementation without having to integrate it in the main LLVM tree.

It mostly sets up the directory structure and provides CMakeLists.txt files to build a dialect library, an opt-like tool to operate on that dialect as well as tests. It could be expanded in the future to add examples of more user-defined operations, types, attributes, generated enums, transforms, etc. and linked to a tutorial.

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