summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[AMDGPU] Support disassembly for AMDGPU kernel descriptors"277873ce0f48Ronak Chauhan2020-09-0911-690/+50
| | | | | | This reverts commit 487a80531006add8102d50dbcce4b6fd729ab1f6. Tests fail on big endian machines.
* [KnownBits] Move SelectionDAG::computeKnownBits ISD::ABS handling to ↵Simon Pilgrim2020-09-093-15/+22
| | | | | | KnownBits::abs Move the ISD::ABS handling to a KnownBits::abs handler, to simplify future implementations in ValueTracking/GlobalISel.
* APInt.h - return directly from clearUnusedBits in single word cases. NFCI.Simon Pilgrim2020-09-091-10/+7
| | | | 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.
* [elf2yaml] Fix dumping a debug section whose name is not recognized.Xing GUO2020-09-092-0/+21
| | | | | | | | | 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
* [cmake] Use absolute paths for modules searchDiana Picus2020-09-091-2/+8
| | | | | | | | | | | | | | | | 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
* [mlir][Linalg] Integration tests for convolutions added.Jakub Lichman2020-09-099-0/+873
| | | | | | | This commit introduces end-to-end integration tests for convolutions that test multiple ways of ConvOps lowering. Differential Revision: https://reviews.llvm.org/D87277
* [UnifyFunctionExitNodes] Fix Modified status for unreachable blocksDavid Stenberg2020-09-093-30/+107
| | | | | | | | | | | | | | | 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
* [BuildLibCalls] Add more noundef to library functionsJuneyoung Lee2020-09-092-42/+75
| | | | | | | | | | | | | | | | | | | | 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
* [flang]Add Semantic Checks for OpenMP Allocate ClauseIrina Dobrescu2020-09-096-9/+164
| | | | | | Reviewed By: kiranchandramohan, clementval, kiranktp, raghavendhra Differential Revision: https://reviews.llvm.org/D86051
* [ValueTracking] Add UndefOrPoison/Poison-only version of relevant functionsJuneyoung Lee2020-09-096-39/+146
| | | | | | | | | | 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
* TrigramIndex.cpp - remove unnecessary includes. NFCI.Simon Pilgrim2020-09-092-6/+1
| | | | TrigramIndex.h already includes most of these.
* ARMTargetParser.cpp - use auto const references in for range loops. NFCI.Simon Pilgrim2020-09-091-10/+10
| | | | Fix static analysis warnings about unnecessary copies.
* [APFloat] Fix uninitialized variable in IEEEFloat constructorsSimon Pilgrim2020-09-092-35/+38
| | | | | | | | | | | | | 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
* [NFC][Asan] Fit ChunkHeader into redzoneVitaly Buka2020-09-091-11/+12
| | | | | | 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.
* [DomTree] Use SmallVector<DomTreeNodeBase *, 4> instead of std::vector.Florian Hahn2020-09-091-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ARM] Fixup of a few test cases. NFC.Sjoerd Meijer2020-09-094-44/+41
| | | | | 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.
* [AMDGPU] Workaround for LDS Misalignment bug on GFX10Mirko Brkusanin2020-09-094-10/+151
| | | | | | | 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.
* Rename MemRefDescriptor::getElementType() to ↵Christian Sigg2020-09-093-9/+12
| | | | | | | | MemRefDescriptor::getElementPtrType(). Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D87284
* Temporairly revert "Thread safety analysis: Consider global variables in ↵Roman Lebedev2020-09-094-47/+9
| | | | | | | | | | | 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.
* [mlir] Added support for loops to BufferPlacement transformation.Marcel Koester2020-09-092-54/+474
| | | | | | | | 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
* [lldb] Enable std::pair in CxxModuleHandlerRaphael Isemann2020-09-094-0/+35
| | | | | | | | | | | | | 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
* [Test] Add failing test for pr47457Max Kazantsev2020-09-091-0/+45
|
* [lldb] Fix a crash when the ASTImporter is giving us two Imported callbacks ↵Raphael Isemann2020-09-092-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [EarlyCSE] Explicitly require AAResultsWrapperPass.Florian Hahn2020-09-093-1/+9
| | | | | | | | | | | | | | | 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
* [lldb] Don't infinite loop in SemaSourceWithPriorities::CompleteType when ↵Raphael Isemann2020-09-097-9/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [MLIR][Shape] Lower `shape_of` to `dynamic_tensor_from_elements`Frederik Gossen2020-09-094-26/+37
| | | | | | | | 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
* [MLIR][Standard] Update `tensor_from_elements` assembly formatFrederik Gossen2020-09-096-25/+28
| | | | | | | Remove the redundant parenthesis that are used for none of the other operation formats. Differential Revision: https://reviews.llvm.org/D86287
* [gn build] Port c0e5e3fbfa5LLVM GN Syncbot2020-09-091-1/+0
|
* [Ignore Expressions] Fix performance regression by inlining `Ignore*SingleStep`Eduardo Caldas2020-09-093-139/+109
| | | | | | We also add a `const` versions of `IgnoreExprNodes` Differential Revision: https://reviews.llvm.org/D87278
* [lldb][doc] Mention python3-dev instead of python2.7-dev in build docsRaphael Isemann2020-09-091-1/+1
|
* [MLIR] Add debug support for ignored patternsFrederik Gossen2020-09-091-3/+24
| | | | | | | | 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
* [Statepoints] Properly handle const base pointer.Denis Antrushin2020-09-094-13/+57
| | | | | | | | | | | | | | | 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
* [ARM] Try to rematerialize VCTP instructionsSam Parker2020-09-095-29/+150
| | | | | | | | 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
* [Attributor][NFC] Improve check lines in depgraph.llJohannes Doerfert2020-09-091-82/+208
| | | | This adds the check lines with -NEXT so we see any change in the future.
* [Attributor] Cleanup `::initialize` of various AAsJohannes Doerfert2020-09-0916-100/+106
| | | | | | | | | | | | | | | 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.
* [llvm-cov gcov] Simply computation of line counts and exit block counterFangrui Song2020-09-081-24/+21
|
* [Attributor] Associate the callback callee with a call site argument (if any)Johannes Doerfert2020-09-092-7/+20
| | | | | | | | | | | | | | 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.
* [Attributor] Cleanup `IRPosition::getArgNo` usagesJohannes Doerfert2020-09-094-45/+82
| | | | | | | | | | | 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.
* [Attributor] Selectively look at the callee even when there are operand bundlesJohannes Doerfert2020-09-091-3/+10
| | | | | | | | | | | | 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.
* [Attributor] Re-enable a run line in noalias.llJohannes Doerfert2020-09-091-133/+127
| | | | | | | | | | | | 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
* [Attributor] Provide a command line option that limits recursion depthJohannes Doerfert2020-09-093-2/+51
| | | | | | 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.
* [flang][msvc] Avoid range-based for over initializer_list. NFC.Michael Kruse2020-09-091-2/+2
| | | | | | | | | | 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
* [NFC] Move functon from IndVarSimplify to SCEVMax Kazantsev2020-09-093-31/+31
| | | | | | | This function can be reused in other places. Differential Revision: https://reviews.llvm.org/D87274 Reviewed By: fhahn, lebedev.ri
* [libFuzzer] Add a command-line option for tracing mutation of corpus inputs ↵Dokyung Song2020-09-099-0/+85
| | | | | | | | | | | | | | | | | | 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
* [Hexagon] Fix order of operands in V6_vdealb4wKrzysztof Parzyszek2020-09-081-1/+1
|
* [llvm-cov gcov] Compute unmeasured arc counts by Kirchhoff's circuit lawFangrui Song2020-09-086-60/+91
| | | | | | | | | | | 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.
* [PowerPC] Set setMaxAtomicSizeInBitsSupported appropriately for 32-bit ↵Brad Smith2020-09-083-77/+503
| | | | | | | | PowerPC in PPCTargetLowering Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D86165
* [EarlyCSE] Add testcase for masked loads and stores, NFCKrzysztof Parzyszek2020-09-081-0/+45
|
* [obj2yaml][test] Test generating and dumping a broken debug_ranges section.Xing GUO2020-09-091-0/+24
| | | | | | | | This patch tests generating and dumping a broken debug_ranges section. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D87275
* [NFC][ThinLTO] EmbedBitcodeSection doesn't need the ConfigMircea Trofin2020-09-081-2/+2
| | | | | | | | 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