Sanjay Patel [Tue, 8 Sep 2020 21:00:40 +0000 (17:00 -0400)]
[InstCombine] add tests for add/sub-of-shl; NFC
Fangrui Song [Wed, 9 Sep 2020 19:06:39 +0000 (12:06 -0700)]
[gcov] Don't split entry block; add a synthetic entry block instead
The entry block is split at the first instruction where `shouldKeepInEntry`
returns false. The created basic block has a br jumping to the original entry
block. The new basic block causes the function label line and the other entry
block lines to be covered by different basic blocks, which can affect line
counts with special control flows (fork/exec in the entry block requires
heuristics in llvm-cov gcov to get consistent line counts).
int main() { // BB0
return 0; // BB2 (due to entry block splitting)
}
// BB1 is the exit block (since gcov 4.8)
This patch adds a synthetic entry block (like PGOInstrumentation and GCC) and
inserts an edge from the synthetic entry block to the original entry block. We
can thus remove the tricky `shouldKeepInEntry` and entry block splitting. The
number of basic blocks does not change, but the emitted .gcno files will be
smaller because we can save one GCOV_TAG_LINES tag.
// BB0 is the synthetic entry block with a single edge to BB2
int main() { // BB2
return 0; // BB2
}
// BB1 is the exit block (since gcov 4.8)
Olivier Giroux [Wed, 9 Sep 2020 19:14:53 +0000 (12:14 -0700)]
Revert a test using padding bits in atomics
Guillaume Chatelet [Wed, 9 Sep 2020 19:10:30 +0000 (19:10 +0000)]
[NFC] Separate bitcode reading for FUNC_CODE_INST_CMPXCHG(_OLD)
This is preparatory work to unable storing alignment for AtomicCmpXchgInst.
See D83136 for context and bug: https://bugs.llvm.org/show_bug.cgi?id=27168
This is the fixed version of D83375, which was submitted and reverted.
Differential Revision: https://reviews.llvm.org/D87373
Mark de Wever [Wed, 9 Sep 2020 17:12:32 +0000 (19:12 +0200)]
Implements [[likely]] and [[unlikely]] in IfStmt.
This is the initial part of the implementation of the C++20 likelihood
attributes. It handles the attributes in an if statement.
Differential Revision: https://reviews.llvm.org/D85091
Krzysztof Parzyszek [Wed, 9 Sep 2020 18:44:29 +0000 (13:44 -0500)]
[DSE] Explicitly not use MSSA in testcase for now
It fails for some reason, but it shouldn't stop switching to MSSA in DSE.
Dave Lee [Tue, 8 Sep 2020 20:43:15 +0000 (13:43 -0700)]
[debugserver] Extract function for default launch flavor
Extract a function for turning `eLaunchFlavorDefault` into a concreate `eLaunchFlavor` value.
This new function encapsulates the few compile time variables involved, and also prevents clang unused code diagnostics.
Differential Revision: https://reviews.llvm.org/D87327
Krzysztof Parzyszek [Wed, 2 Sep 2020 19:06:58 +0000 (14:06 -0500)]
[DSE] Handle masked stores
Johannes Doerfert [Wed, 9 Sep 2020 15:09:30 +0000 (10:09 -0500)]
Revert "[Attributor] Re-enable a run line in noalias.ll"
The underlying issue is still there, just hides on most systems, even
some Windows builds :(
See:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/25479/steps/test-check-all/logs/FAIL%3A%20LLVM%3A%3Anoalias.ll
This reverts commit
2600c9e2efce1dc4c64870b00a45ae0082c685fc.
Eric Fiselier [Wed, 9 Sep 2020 18:25:17 +0000 (14:25 -0400)]
[libc++] Fix variant benchmark build for some configurations.
The benchmarks expect to be built in C++17 or newer, but this
isn't always how CMake configures the C++ dialect. Instead
we need to explicitly set the CXX_STANDARD target property.
Dave Lee [Wed, 9 Sep 2020 05:53:08 +0000 (22:53 -0700)]
[lldb/Docs] Correct LLDB_ENABLE_TESTS to LLDB_INCLUDE_TESTS
Fix references to LLDB_ENABLE_TESTS.
Differential Revision: https://reviews.llvm.org/D87345
Siva Chandra Reddy [Wed, 9 Sep 2020 17:19:37 +0000 (10:19 -0700)]
[libc][NFC] Add spec files as dependencies of integration test.
Ulrich Weigand [Wed, 9 Sep 2020 17:09:52 +0000 (19:09 +0200)]
[DAGCombine] Skip re-visiting EntryToken to avoid compile time explosion
During the main DAGCombine loop, whenever a node gets replaced, the new
node and all its users are pushed onto the worklist. Omit this if the
new node is the EntryToken (e.g. if a store managed to get optimized
out), because re-visiting the EntryToken and its users will not uncover
any additional opportunities, but there may be a large number of such
users, potentially causing compile time explosion.
This compile time explosion showed up in particular when building the
SingleSource/UnitTests/matrix-types-spec.cpp test-suite case on any
platform without SIMD vector support.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D86963
Olivier Giroux [Wed, 9 Sep 2020 17:00:09 +0000 (10:00 -0700)]
Update atomic feature macros, synopsis, signatures to match C++20. Improve test coverage for non-lock-free atomics.
Mircea Trofin [Wed, 9 Sep 2020 16:55:06 +0000 (09:55 -0700)]
[NFC][MLInliner] Don't initialize in an assert.
Since the build bots have assertions enabled, this flew under the radar.
Siva Chandra Reddy [Wed, 9 Sep 2020 15:32:51 +0000 (08:32 -0700)]
[libc][obvious] Fix strtok_r signature in the spec.
Joseph Huber [Fri, 4 Sep 2020 19:03:49 +0000 (15:03 -0400)]
[OpenMP] Begin Printing Information Dumps In Libomptarget and Plugins
Summary:
This patch starts adding support for adding information dumps to libomptarget
and rtl plugins. The information printing is controlled by the
LIBOMPTARGET_INFO environment variable introduced in D86483. The goal of this
patch is to provide the user with additional information about the device
during kernel execution and providing the user with information dumps in the
case of failure. This patch added the ability to dump the pointer mapping table
as well as printing the number of blocks and threads in the cuda RTL.
Reviewers: jdoerfort gkistanova ye-luo
Subscribers: guansong openmp-commits sstefan1 yaxunl ye-luo
Tags: #OpenMP
Differential Revision: https://reviews.llvm.org/D87165
Simon Pilgrim [Wed, 9 Sep 2020 15:33:19 +0000 (16:33 +0100)]
X86CallFrameOptimization.cpp - use const references where possible. NFCI.
Krzysztof Parzyszek [Wed, 9 Sep 2020 15:23:00 +0000 (10:23 -0500)]
[DSE] Add testcase that uses masked loads and stores
Jakub Lichman [Tue, 8 Sep 2020 15:04:35 +0000 (15:04 +0000)]
[mlir][Linalg] Reduction dimensions specified in TC definition of ConvOps.
This commit specifies reduction dimensions for ConvOps. This prevents
running reduction loops in parallel and enables easier detection of kernel dimensions
which we will need later on.
Differential Revision: https://reviews.llvm.org/D87288
Simon Pilgrim [Wed, 9 Sep 2020 15:13:55 +0000 (16:13 +0100)]
X86FrameLowering::adjustStackWithPops - cleanup auto usage. NFCI.
Don't use auto for non-obvious types, and use const references.
Qiu Chaofan [Wed, 9 Sep 2020 14:38:58 +0000 (22:38 +0800)]
[PowerPC] Fix STRICT_FRINT/STRICT_FNEARBYINT lowering
In standard C library, both rint and nearbyint returns rounding result
in current rounding mode. But nearbyint never raises inexact exception.
On PowerPC, x(v|s)r(d|s)pic may modify FPSCR XX, raising inexact
exception. So we can't select constrained fnearbyint into xvrdpic.
One exception here is xsrqpi, which will not raise inexact exception, so
fnearbyint f128 is okay here.
Reviewed By: uweigand
Differential Revision: https://reviews.llvm.org/D87220
Jay Foad [Wed, 9 Sep 2020 13:55:48 +0000 (14:55 +0100)]
[AMDGPU] Simplify S_SETREG_B32 case in EmitInstrWithCustomInserter
NFC.
compinder [Wed, 9 Sep 2020 13:32:51 +0000 (19:02 +0530)]
[FLANG] Generate error for invalid selector.
Fix of PR47339
Differential Revision: https://reviews.llvm.org/D87073/new/
Dmitry Preobrazhensky [Wed, 9 Sep 2020 12:58:12 +0000 (15:58 +0300)]
[AMDGPU][MC] Improved diagnostic messages for invalid registers
Corrected parser to issue meaningful error messages for invalid and malformed registers.
See bug 41303: https://bugs.llvm.org/show_bug.cgi?id=41303
Reviewers: arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D87234
Alon Kom [Wed, 9 Sep 2020 13:17:53 +0000 (13:17 +0000)]
[MachinePipeliner] Fix II_setByPragma initialization
II_setByPragma was not reset between 2 calls of the MachinePipleiner pass
Reviewed By: bcahoon
Differential Revision: https://reviews.llvm.org/D87088
Denis Antrushin [Mon, 7 Sep 2020 15:04:07 +0000 (22:04 +0700)]
[Statepoints] Update DAG root after emitting statepoint.
Since we always generate CopyToRegs for statepoint results,
we must update DAG root after emitting statepoint, so that
these copies are scheduled before any possible local uses.
Note: getControlRoot() flushes all PendingExports, not only
those we generates for relocates. If that'll become a problem,
we can change it to flushing relocate exports only.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D87251
Simon Pilgrim [Wed, 9 Sep 2020 13:20:41 +0000 (14:20 +0100)]
CommandLine.h - use auto const reference in ValuesClass::apply for range loop. NFCI.
Ronak Chauhan [Wed, 9 Sep 2020 12:31:28 +0000 (18:01 +0530)]
Revert "[AMDGPU] Support disassembly for AMDGPU kernel descriptors"
This reverts commit
487a80531006add8102d50dbcce4b6fd729ab1f6.
Tests fail on big endian machines.
Simon Pilgrim [Wed, 9 Sep 2020 12:22:39 +0000 (13:22 +0100)]
[KnownBits] Move SelectionDAG::computeKnownBits ISD::ABS handling to KnownBits::abs
Move the ISD::ABS handling to a KnownBits::abs handler, to simplify future implementations in ValueTracking/GlobalISel.
Simon Pilgrim [Wed, 9 Sep 2020 11:21:55 +0000 (12:21 +0100)]
APInt.h - return directly from clearUnusedBits in single word cases. NFCI.
Consistently use the same pattern of returning *this from the clearUnusedBits() call to allow us to early out from the isSingleWord() path and avoid an else statement.
Xing GUO [Wed, 9 Sep 2020 12:06:00 +0000 (20:06 +0800)]
[elf2yaml] Fix dumping a debug section whose name is not recognized.
If the debug section's name isn't recognized, it should be
dumped as a raw content section.
Reviewed By: jhenderson, grimar
Differential Revision: https://reviews.llvm.org/D87346
Diana Picus [Thu, 3 Sep 2020 11:39:29 +0000 (13:39 +0200)]
[cmake] Use absolute paths for modules search
For out of tree builds, the user generally needs to specify LLVM_DIR and
MLIR_DIR on the command line so that the correct LLVM and MLIR
installations are picked up.
If the provided paths are absolute, everything works fine, however for
buildbots it is customary to work with relative paths, and that makes it
difficult for CMake to find the right modules to include.
This patch changes CMakeLists.txt to convert LLVM_DIR and MLIR_DIR to
absolute paths before adding them to CMAKE_MODULE_PATH. The inputs are
assumed to be relative to the source directory (llvm-project/flang).
Differential Revision: https://reviews.llvm.org/D87083
Jakub Lichman [Tue, 8 Sep 2020 11:26:15 +0000 (11:26 +0000)]
[mlir][Linalg] Integration tests for convolutions added.
This commit introduces end-to-end integration tests for
convolutions that test multiple ways of ConvOps lowering.
Differential Revision: https://reviews.llvm.org/D87277
David Stenberg [Wed, 9 Sep 2020 08:59:41 +0000 (10:59 +0200)]
[UnifyFunctionExitNodes] Fix Modified status for unreachable blocks
If a function had at most one return block, the pass would return false
regardless if an unified unreachable block was created.
This patch fixes that by refactoring runOnFunction into two separate
helper functions for handling the unreachable blocks respectively the
return blocks, as suggested by @bjope in a review comment.
This was caught using the check introduced by D80916.
Reviewed By: serge-sans-paille
Differential Revision: https://reviews.llvm.org/D85818
Juneyoung Lee [Wed, 9 Sep 2020 11:31:51 +0000 (20:31 +0900)]
[BuildLibCalls] Add more noundef to library functions
This patch follows D85345 and adds more noundef attributes to return values/arguments of library functions
that are mostly about accessing the file system or processes.
A few functions like `chmod` or `times` use typedef `mode_t` and `clock_t`.
They are neither struct nor union, so they cannot contain undef even if they're lowered to iN in IR. So, it is fine to add noundef to them.
- clock_t's actual type is size_t (C17, 7.27.1.3), so it isn't struct or union.
- For mode_t, either int or long is used in practice because programmers use bit manipulation. So, I think it is okay that it's never aggregate in practice.
After this patch, the remaining library functions are those that eagerly participate in optimizations: they can be removed, reordered, or
introduced by a transformation from primitive IR operations.
For them, a few testings is needed, since it may not be valid to add noundef anymore even if C standard says it's okay.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D85894
Irina Dobrescu [Wed, 9 Sep 2020 10:50:13 +0000 (11:50 +0100)]
[flang]Add Semantic Checks for OpenMP Allocate Clause
Reviewed By: kiranchandramohan, clementval, kiranktp, raghavendhra
Differential Revision: https://reviews.llvm.org/D86051
Juneyoung Lee [Tue, 8 Sep 2020 02:41:19 +0000 (11:41 +0900)]
[ValueTracking] Add UndefOrPoison/Poison-only version of relevant functions
This patch adds isGuaranteedNotToBePoison and programUndefinedIfUndefOrPoison.
isGuaranteedNotToBePoison will be used at D75808. The latter function is used at isGuaranteedNotToBePoison.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D84242
Simon Pilgrim [Wed, 9 Sep 2020 10:26:21 +0000 (11:26 +0100)]
TrigramIndex.cpp - remove unnecessary includes. NFCI.
TrigramIndex.h already includes most of these.
Simon Pilgrim [Wed, 9 Sep 2020 10:17:49 +0000 (11:17 +0100)]
ARMTargetParser.cpp - use auto const references in for range loops. NFCI.
Fix static analysis warnings about unnecessary copies.
Simon Pilgrim [Wed, 9 Sep 2020 09:58:59 +0000 (10:58 +0100)]
[APFloat] Fix uninitialized variable in IEEEFloat constructors
Some constructors of IEEEFloat do not initialize member variable exponent.
Fix it by initializing exponent with the following values:
For NaNs, the `exponent` is `maxExponent+1`.
For Infinities, the `exponent` is `maxExponent+1`.
For Zeroes, the `exponent` is `maxExponent-1`.
Patch by: @nullptr.cpp (Yang Fan)
Differential Revision: https://reviews.llvm.org/D86997
Vitaly Buka [Wed, 9 Sep 2020 10:06:46 +0000 (03:06 -0700)]
[NFC][Asan] Fit ChunkHeader into redzone
In code as-is min redzone and ChunkHeader are 16 byte.
This patch just makes sure that redzone is calculated correctly if we
extend ChunkHeader.
Florian Hahn [Wed, 9 Sep 2020 09:24:49 +0000 (10:24 +0100)]
[DomTree] Use SmallVector<DomTreeNodeBase *, 4> instead of std::vector.
Currentl DomTreeNodeBase is using std::vectot to store it's children.
Using SmallVector should be more efficient in terms of compile-time.
A size of 4 seems to be the sweet-spot in terms of compile-time,
according to
http://llvm-compile-time-tracker.com/compare.php?from=
9933188c90615c9c264ebb69117f09726e909a25&to=
d7a801d027648877b20f0e00e822a7a64c58d976&stat=instructions
This results in the following geomean improvements
```
geomean insts max rss
O3 -0.31 % +0.02 %
ReleaseThinLTO -0.35 % -0.12 %
ReleaseLTO -0.28 % -0.12 %
O0 -0.06 % -0.02 %
NewPM O3 -0.36 % +0.05 %
ReleaseThinLTO (link only) -0.44 % -0.10 %
ReleaseLTO-g (link only): -0.32 % -0.03 %
```
I am not sure if there's any other benefits of using std::vector over
SmallVector.
Reviewed By: kuhar, asbirlea
Differential Revision: https://reviews.llvm.org/D87319
Sjoerd Meijer [Wed, 9 Sep 2020 09:40:23 +0000 (10:40 +0100)]
[ARM] Fixup of a few test cases. NFC.
After changing the semantics of get.active.lane.mask, I missed a few tests
that should use now the tripcount instead of the backedge taken count.
Mirko Brkusanin [Wed, 9 Sep 2020 09:28:36 +0000 (11:28 +0200)]
[AMDGPU] Workaround for LDS Misalignment bug on GFX10
Add subtarget feature check to avoid using ds_read/write_b96/128 with too
low alignment if a bug is present on that specific hardware.
Add this "feature" to GFX 10.1.1 as it is also affected.
Add global-isel test.
Christian Sigg [Wed, 9 Sep 2020 05:41:56 +0000 (07:41 +0200)]
Rename MemRefDescriptor::getElementType() to MemRefDescriptor::getElementPtrType().
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D87284
Roman Lebedev [Wed, 9 Sep 2020 09:08:46 +0000 (12:08 +0300)]
Temporairly revert "Thread safety analysis: Consider global variables in scope" & followup
This appears to cause false-positives because it started to warn on local non-global variables.
Repro posted to https://reviews.llvm.org/D84604#2262745
This reverts commit
9dcc82f34ea9b623d82d2577b93aaf67d36dabd2.
This reverts commit
b2ce79ef66157dd752e3864ece57915e23a73f5d.
Marcel Koester [Fri, 7 Aug 2020 10:22:45 +0000 (12:22 +0200)]
[mlir] Added support for loops to BufferPlacement transformation.
The current BufferPlacement transformation cannot handle loops properly. Buffers
passed via backedges will not be freed automatically introducing memory leaks.
This CL adds support for loops to overcome these limitations.
Differential Revision: https://reviews.llvm.org/D85513
Raphael Isemann [Wed, 9 Sep 2020 08:35:56 +0000 (10:35 +0200)]
[lldb] Enable std::pair in CxxModuleHandler
This adds support for substituting std::pair instantiations with enabled
import-std-module.
With the fixes in parent revisions we can currently substitute a single pair
(however, a result that returns a second pair currently causes LLDB to crash
while importing the second template instantiation).
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D85141
Max Kazantsev [Wed, 9 Sep 2020 08:44:25 +0000 (15:44 +0700)]
[Test] Add failing test for pr47457
Raphael Isemann [Wed, 9 Sep 2020 08:16:56 +0000 (10:16 +0200)]
[lldb] Fix a crash when the ASTImporter is giving us two Imported callbacks for the same target decl
The ASTImporter has an `Imported(From, To)` callback that notifies subclasses
that a declaration has been imported in some way. LLDB uses this in the
`CompleteTagDeclsScope` to see which records have been imported into the scratch
context. If the record was declared inside the expression, then the
`CompleteTagDeclsScope` will forcibly import the full definition of that record
to the scratch context so that the expression AST can safely be disposed later
(otherwise we might end up going back to the deleted AST to complete the
minimally imported record). The way this is implemented is that there is a list
of decls that need to be imported (`m_decls_to_complete`) and we keep completing
the declarations inside that list until the list is empty. Every `To` Decl we
get via the `Imported` callback will be added to the list of Decls to be
completed.
There are some situations where the ASTImporter will actually give us two
`Imported` calls with the same `To` Decl. One way where this happens is if the
ASTImporter decides to merge an imported definition into an already imported
one. Another way is that the ASTImporter just happens to get two calls to
`ASTImporter::Import` for the same Decl. This for example happens when importing
the DeclContext of a Decl requires importing the Decl itself, such as when
importing a RecordDecl that was declared inside a function.
The bug addressed in this patch is that when we end up getting two `Imported`
calls for the same `To` Decl, then we would crash in the
`CompleteTagDeclsScope`. That's because the first time we complete the Decl we
remove the Origin tracking information (that maps the Decl back to from where it
came from). The next time we try to complete the same `To` Decl the Origin
tracking information is gone and we hit the `to_context_md->getOrigin(decl).ctx
== m_src_ctx` assert (`getOrigin(decl).ctx` is a nullptr the second time as the
Origin was deleted).
This is actually a regression coming from D72495. Before D72495
`m_decls_to_complete` was actually a set so every declaration in there could
only be queued once to be completed. The set was changed to a vector to make the
iteration over it deterministic, but that also causes that we now potentially
end up trying to complete a Decl twice.
This patch essentially just reverts D72495 and makes the `CompleteTagDeclsScope`
use a SetVector for the list of declarations to be completed. The SetVector
should filter out the duplicates (as the original `set` did) and also ensure that
the completion order is deterministic. I actually couldn't find any way to cause
LLDB to reproduce this bug by merging declarations (this would require that we
for example declare two namespaces in a non-top-level expression which isn't
possible). But the bug reproduces very easily by just declaring a class in an
expression, so that's what the test is doing.
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D85648
Florian Hahn [Wed, 9 Sep 2020 08:00:41 +0000 (09:00 +0100)]
[EarlyCSE] Explicitly require AAResultsWrapperPass.
The MemorySSAWrapperPass depends on AAResultsWrapperPass and if
MemorySSA is preserved but AAResultsWrapperPass is not, this could lead
to a crash when updating the last user of the MemorySSAWrapperPass.
Alternatively AAResultsWrapperPass could be marked preserved by GVN, but
I am not sure if that would be safe. I am not sure what is required in
order to preserve AAResultsWrapperPass. At the moment, it seems like a
couple of passes that do similar transforms to GVN are preserving it.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D87137
Raphael Isemann [Wed, 9 Sep 2020 07:54:47 +0000 (09:54 +0200)]
[lldb] Don't infinite loop in SemaSourceWithPriorities::CompleteType when trying to complete a forward decl
SemaSourceWithPriorities is a special SemaSource that wraps our normal LLDB
ExternalASTSource and the ASTReader (which is used for the C++ module loading).
It's only active when the `import-std-module` setting is turned on.
The `CompleteType` function there in `SemaSourceWithPriorities` is looping over
all ExternalASTSources and asks each to complete the type. However, that loop is
in another loop that keeps doing that until the type is complete. If that
function is ever called on a type that is a forward decl then that causes LLDB
to go into an infinite loop.
I remember I added that second loop and the comment because I thought I saw a
similar pattern in some other Clang code, but after some grepping I can't find
that code anywhere and it seems the rest of the code base only calls
CompleteType once (It would also be kinda silly to have calling it multiple
times). So it seems that's just a silly mistake.
The is implicitly tested by importing `std::pair`, but I also added a simpler
dedicated test that creates a dummy libc++ module with some forward declarations
and then imports them into the scratch AST context. At some point the
ASTImporter will check if one of the forward decls could be completed by the
ExternalASTSource, which will cause the `SemaSourceWithPriorities` to go into an
infinite loop once it receives the `CompleteType` call.
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D87289
Frederik Gossen [Wed, 9 Sep 2020 07:53:13 +0000 (07:53 +0000)]
[MLIR][Shape] Lower `shape_of` to `dynamic_tensor_from_elements`
Take advantage of the new `dynamic_tensor_from_elements` operation in `std`.
Instead of stack-allocated memory, we can now lower directly to a single `std`
operation.
Differential Revision: https://reviews.llvm.org/D86935
Frederik Gossen [Wed, 9 Sep 2020 07:44:38 +0000 (07:44 +0000)]
[MLIR][Standard] Update `tensor_from_elements` assembly format
Remove the redundant parenthesis that are used for none of the other operation
formats.
Differential Revision: https://reviews.llvm.org/D86287
LLVM GN Syncbot [Wed, 9 Sep 2020 07:32:57 +0000 (07:32 +0000)]
[gn build] Port
c0e5e3fbfa5
Eduardo Caldas [Tue, 8 Sep 2020 11:32:02 +0000 (11:32 +0000)]
[Ignore Expressions] Fix performance regression by inlining `Ignore*SingleStep`
We also add a `const` versions of `IgnoreExprNodes`
Differential Revision: https://reviews.llvm.org/D87278
Raphael Isemann [Wed, 9 Sep 2020 07:29:51 +0000 (09:29 +0200)]
[lldb][doc] Mention python3-dev instead of python2.7-dev in build docs
Frederik Gossen [Wed, 9 Sep 2020 07:16:45 +0000 (07:16 +0000)]
[MLIR] Add debug support for ignored patterns
The rewrite engine's cost model may determine some patterns to be irrelevant
ahead of their application. These patterns were silently ignored previously and
now cause a message in `--debug` mode.
Differential Revision: https://reviews.llvm.org/D87290
Denis Antrushin [Mon, 7 Sep 2020 15:04:07 +0000 (22:04 +0700)]
[Statepoints] Properly handle const base pointer.
Current code in InstEmitter assumes all GC pointers are either
VRegs or stack slots - hence, taking only one operand.
But it is possible to have constant base, in which case it
occupies two machine operands.
Add a convinience function to StackMaps to get index of next
meta argument and use it in InsrEmitter to properly advance to
the next statepoint meta operand.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D87252
Sam Parker [Wed, 9 Sep 2020 06:32:30 +0000 (07:32 +0100)]
[ARM] Try to rematerialize VCTP instructions
We really want to try and avoid spilling P0, which can be difficult
since there's only one register, so try to rematerialize any VCTP
instructions.
Differential Revision: https://reviews.llvm.org/D87280
Johannes Doerfert [Tue, 8 Sep 2020 20:58:58 +0000 (15:58 -0500)]
[Attributor][NFC] Improve check lines in depgraph.ll
This adds the check lines with -NEXT so we see any change in the future.
Johannes Doerfert [Sun, 30 Aug 2020 19:14:33 +0000 (14:14 -0500)]
[Attributor] Cleanup `::initialize` of various AAs
This commit cleans up the ::initialize method of various AAs in the
following ways:
- If an associated function is required, give up on declarations.
This was discovered as a real problem when lots of llvm.dbg.XXX
call sites were assumed `noreturn` until proven otherwise. That
does not make any sense and caused huge regressions and missed
deductions.
- Require more associated declarations for function interface AAs.
- Use the IRAttribute::initialize to determine if function interface
AAs can be used in IPO, don't replicate the checks (especially
isFunctionIPOAmendable) all over the place. Arguably the function
declaration check should be moved to some central place to.
Fangrui Song [Wed, 9 Sep 2020 06:15:37 +0000 (23:15 -0700)]
[llvm-cov gcov] Simply computation of line counts and exit block counter
Johannes Doerfert [Fri, 4 Sep 2020 16:20:28 +0000 (11:20 -0500)]
[Attributor] Associate the callback callee with a call site argument (if any)
If we have a callback, call site arguments were already associated with
the callback callee. Now we also associate the function with the
callback callee, thus we know ensure that the following holds true (if
all return nonnull):
`getAssociatedArgument()->getParent() == getAssociatedFunction()`
To test this an early exit from
`AAMemoryBehaviorCallSiteArgument::initialize``
is included as well. Without the change to getAssociatedFunction() this
kind of early exit for declarations would cause callback call site
arguments to miss out.
Johannes Doerfert [Sat, 5 Sep 2020 18:20:31 +0000 (13:20 -0500)]
[Attributor] Cleanup `IRPosition::getArgNo` usages
As we handle callback calls we need to disambiguate the call site
argument number from the callee argument number. While always equal in
non-callback calls, a callback comes with a partial parameter-argument
mapping so there is no implicit correspondence. Here we split
`IRPosition::getArgNo()` into two public functions, `getCallSiteArgNo()`
and `getCalleeArgNo()`. Usages are adjusted to pick the right one for
their purpose. This fixed some problems that would have been exposed as
we more aggressively optimize callbacks.
Johannes Doerfert [Fri, 4 Sep 2020 16:14:33 +0000 (11:14 -0500)]
[Attributor] Selectively look at the callee even when there are operand bundles
While operand bundles carry unpredictable semantics, we know some of
them and can therefore "ignore" them. In this case we allow to look at
the declaration of `llvm.assume` when asked for the attributes at a call
site. The assume operand bundles we have do not invalidate the
declaration attributes.
We cannot test this in isolation because the llvm.assume attributes are
determined by the parser. However, a follow up patch will provide test
coverage.
Johannes Doerfert [Fri, 4 Sep 2020 16:41:58 +0000 (11:41 -0500)]
[Attributor] Re-enable a run line in noalias.ll
This was disabled as we were looking for a weird CGSCC problem. I
think/hope we fixed it as there were a lot of updates recently. I could
never reproduce this locally so I'll use the pre-commit phab builds to
confirm this suspicion and if they seem to be happy I'll assume this is
fixed.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D87266
Johannes Doerfert [Tue, 18 Aug 2020 20:27:41 +0000 (15:27 -0500)]
[Attributor] Provide a command line option that limits recursion depth
In `MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4.cpp` we initialized
attributes until stack frame ~35k caused space to run out. The initial
size 1024 is pretty much random.
Michael Kruse [Wed, 9 Sep 2020 02:52:23 +0000 (21:52 -0500)]
[flang][msvc] Avoid range-based for over initializer_list. NFC.
Msvc crashes with "INTERNAL COMPILER ERROR" when iterating over an `std::initializer_list` in a constexpr constructor. Explicitly use the iterator instead.
This patch is part of the series to [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].
Reviewed By: isuruf
Differential Revision: https://reviews.llvm.org/D86425
Max Kazantsev [Wed, 9 Sep 2020 04:20:59 +0000 (11:20 +0700)]
[NFC] Move functon from IndVarSimplify to SCEV
This function can be reused in other places.
Differential Revision: https://reviews.llvm.org/D87274
Reviewed By: fhahn, lebedev.ri
Dokyung Song [Wed, 8 Jul 2020 19:30:53 +0000 (19:30 +0000)]
[libFuzzer] Add a command-line option for tracing mutation of corpus inputs in the dot graph format.
This patch adds a new command-line option -mutation_graph_file=FILE for
debugging purposes, which traces how corpus inputs evolve during a fuzzing
run. For each new input that is added to the corpus, a new vertex corresponding
to the added input, as well as a new edge that connects its base input to itself
are written to the given file. Each vertex is labeled with the filename of the
input, and each edge is labeled with the mutation sequence that led to the input
w.r.t. its base input.
The format of the mutation graph file is the dot file format. Once prepended and
appended with "graph {" and "}", respectively, the graph becomes a valid dot
file and can be visualized.
Differential Revision: https://reviews.llvm.org/D86560
Krzysztof Parzyszek [Wed, 9 Sep 2020 03:09:28 +0000 (22:09 -0500)]
[Hexagon] Fix order of operands in V6_vdealb4w
Fangrui Song [Wed, 9 Sep 2020 01:45:11 +0000 (18:45 -0700)]
[llvm-cov gcov] Compute unmeasured arc counts by Kirchhoff's circuit law
For a CFG G=(V,E), Knuth describes that by Kirchoff's circuit law, the minimum
number of counters necessary is |E|-(|V|-1). The emitted edges form a spanning
tree. libgcov emitted .gcda files leverages this optimization while clang
--coverage's doesn't.
Propagate counts by Kirchhoff's circuit law so that llvm-cov gcov can
correctly print line counts of gcc --coverage emitted files and enable
the future improvement of clang --coverage.
Brad Smith [Wed, 9 Sep 2020 01:21:14 +0000 (21:21 -0400)]
[PowerPC] Set setMaxAtomicSizeInBitsSupported appropriately for 32-bit PowerPC in PPCTargetLowering
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D86165
Krzysztof Parzyszek [Wed, 9 Sep 2020 00:27:37 +0000 (19:27 -0500)]
[EarlyCSE] Add testcase for masked loads and stores, NFC
Xing GUO [Wed, 9 Sep 2020 00:48:04 +0000 (08:48 +0800)]
[obj2yaml][test] Test generating and dumping a broken debug_ranges section.
This patch tests generating and dumping a broken debug_ranges section.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D87275
Mircea Trofin [Tue, 8 Sep 2020 23:42:16 +0000 (16:42 -0700)]
[NFC][ThinLTO] EmbedBitcodeSection doesn't need the Config
Instead, passing in the command line options, initialized to nullptr. In
an upcoming patch, we can then use the parameter to pass actual command
line options.
Differential Revision: https://reviews.llvm.org/D87336
Krzysztof Parzyszek [Wed, 2 Sep 2020 19:05:41 +0000 (14:05 -0500)]
Handle masked loads and stores in MemoryLocation/Dependence
Differential Revision: https://reviews.llvm.org/D87061
David Blaikie [Tue, 8 Sep 2020 23:12:46 +0000 (16:12 -0700)]
Remove unused variable(s)
Puyan Lotfi [Tue, 8 Sep 2020 23:42:38 +0000 (19:42 -0400)]
[NFC] Fixing a gcc compiler warning.
warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
Differential Revision: https://reviews.llvm.org/D86952
Sergej Jaskiewicz [Tue, 8 Sep 2020 22:53:01 +0000 (01:53 +0300)]
[llvm] [unittest] Allow getting a C string from the TempDir helper class
The TempDir.path() member function returns a StringRef. We've been
calling the data() method on that StringRef, which does not guarantee
to return a null-terminated string (required by chdir and other POSIX
functions).
Introduce the c_str() method in the TempDir class, which returns the
proper string without the need to create a copy of the path at use site.
Craig Topper [Tue, 8 Sep 2020 22:48:47 +0000 (15:48 -0700)]
[SelectionDAGBuilder] Remove Unnecessary FastMathFlags temporary. Use SDNodeFlags instead. NFCI
This was a missed simplication in D87200
Ryan Prichard [Fri, 28 Aug 2020 06:46:49 +0000 (23:46 -0700)]
[libunwind] Replace chain-of-ifdefs for dl_iterate_phdr
Define a _LIBUNWIND_USE_DL_ITERATE_PHDR macro in config.h when there is
no other unwind info lookup method. Also define a
_LIBUNWIND_USE_DL_UNWIND_FIND_EXIDX macro to factor out
(__BIONIC__ and _LIBUNWIND_ARM_EHABI).
Differential Revision: https://reviews.llvm.org/D86768
David Blaikie [Tue, 8 Sep 2020 21:05:20 +0000 (14:05 -0700)]
llvm-symbolizer: Add optional "start file" to match "start line"
Since a function might have portions of its code coming from multiple
different files, "start line" is ambiguous (it can't just be resolved
relative to the file/line specified). Add start file to disambiguate it.
Craig Topper [Tue, 8 Sep 2020 22:09:35 +0000 (15:09 -0700)]
[SelectionDAGBuilder] Pass fast math flags to getNode calls rather than trying to set them after the fact.:
This removes the after the fact FMF handling from D46854 in favor of passing fast math flags to getNode. This should be a superset of D87130.
This required adding a SDNodeFlags to SelectionDAG::getSetCC.
Now we manage to contant fold some stuff undefs during the
initial getNode that we don't do in later DAG combines.
Differential Revision: https://reviews.llvm.org/D87200
Nate Voorhies [Tue, 8 Sep 2020 21:19:00 +0000 (14:19 -0700)]
Insert missing bracket in docs.
Body of unrolled loop was missing opening bracket.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D87329
Rahul Joshi [Wed, 2 Sep 2020 22:33:19 +0000 (15:33 -0700)]
[MLIR] Change Operation::create() methods to use Value/Type/Block ranges.
- Introduce a new BlockRange class to represent range of blocks (constructible from
an ArrayRef<Block *> or a SuccessorRange);
- Change Operation::create() methods to use TypeRange for result types, ValueRange for
operands and BlockRange for successors.
Differential Revision: https://reviews.llvm.org/D86985
Krzysztof Parzyszek [Tue, 8 Sep 2020 19:20:41 +0000 (14:20 -0500)]
[Hexagon] Handle widening of truncation's operand with legal result
Failing example: v8i8 = truncate v8i32. v8i8 is legal, but v8i32 was
widened to HVX. Make sure that v8i8 does not get altered (even if it's
changed to another legal type).
Vitaly Buka [Tue, 1 Sep 2020 12:26:53 +0000 (05:26 -0700)]
[NFC][Asan] Remove Debug code
Used for https://github.com/google/sanitizers/issues/1193
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D86933
Vitaly Buka [Tue, 1 Sep 2020 11:49:49 +0000 (04:49 -0700)]
[Asan] Don't crash if metadata is not initialized
Fixes https://github.com/google/sanitizers/issues/1193.
AsanChunk can be uninitialized yet just after return from the secondary
allocator. If lsan starts scan just before metadata assignment it can
fail to find corresponding AsanChunk.
It should be safe to ignore this and let lsan to assume that
AsanChunk is in the beginning of the block. This block is from the
secondary allocator and created with mmap, so it should not contain
any pointers and will make lsan to miss some leaks.
Similar already happens for primary allocator. If it can't find real
AsanChunk it falls back and assume that block starts with AsanChunk.
Then if the block is already returned to allocator we have garbage in
AsanChunk and may scan dead memory hiding some leaks.
I'll fix this in D87135.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D86931
Walter Erquinigo [Tue, 8 Sep 2020 20:40:42 +0000 (13:40 -0700)]
Revert "Retry of D84974"
This reverts commit
5b2b4f331d78f326e5e29166bec5ad92c864343d.
This caused a link error in
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/18794/steps/build/logs/stdio
Yaxun (Sam) Liu [Tue, 8 Sep 2020 20:01:30 +0000 (16:01 -0400)]
[HIP] Add gfx1031 and gfx1030
Differential Revision: https://reviews.llvm.org/D87324
Saleem Abdulrasool [Tue, 8 Sep 2020 20:06:07 +0000 (20:06 +0000)]
Sema: extract a check for `isCFError` (NFC)
Extract a simple check to check if a `RecordDecl` is a `CFError` Decl.
This is a simple refactoring to prepare for an upcoming change. NFC.
Patch is extracted from
https://github.com/llvm/llvm-project-staging/commit/
8afaf3aad2af43cfedca7a24cd817848c4e95c0c.
Paul C. Anagnostopoulos [Sun, 30 Aug 2020 18:00:25 +0000 (14:00 -0400)]
fix typos; improve a couple of descriptions;
add release note
Nikita Popov [Tue, 8 Sep 2020 19:06:59 +0000 (21:06 +0200)]
[ValueTracking] Compute known bits of min/max intrinsics
Implement known bits for the min/max intrinsics based on the
recently added KnownBits primitives.
Nikita Popov [Tue, 8 Sep 2020 18:57:40 +0000 (20:57 +0200)]
[InstCombine] Add tests for known bits for min/max intrinsics (NFC)
We already have test coverage for the underlying calculation,
this just checked that the folding is wired up...
Walter Erquinigo [Wed, 2 Sep 2020 01:52:14 +0000 (18:52 -0700)]
Retry of D84974
The test is being disabled on Linux, as lldb-vscode has a bug with
--wait-for on LInux.
I'm also fixing some compilation warnings.
David Stenberg [Tue, 8 Sep 2020 16:54:30 +0000 (18:54 +0200)]
[UnifyFunctionExitNodes] Remove unused getters, NFC
The get{Return,Unwind,Unreachable}Block functions in
UnifyFunctionExitNodes have not been used for many years,
so just remove them.
Reviewed By: bjope
Differential Revision: https://reviews.llvm.org/D87078
Andrew Ng [Mon, 7 Sep 2020 16:36:14 +0000 (17:36 +0100)]
[LLD][ELF] Fix performance of MarkLive::scanEhFrameSection
MarkLive::scanEhFrameSection is used to retain personality/LSDA
functions when --gc-sections is enabled.
Improve its performance by only iterating over the .eh_frame relocations
that need to be resolved for an EhSectionPiece. This optimization makes
the same assumption as elsewhere in LLD that the .eh_frame relocations
are sorted by r_offset.
This appears to be a performance regression introduced in commit
e6c24299d237 (https://reviews.llvm.org/D59800).
This change has been seen to reduce link time by up to ~50%.
Differential Revision: https://reviews.llvm.org/D87245