SuccessChanges

Summary

  1. [lldb][doc] Mention python3-dev instead of python2.7-dev in build docs (details)
  2. [Ignore Expressions] Fix performance regression by inlining `Ignore*SingleStep` (details)
  3. [gn build] Port c0e5e3fbfa5 (details)
  4. [MLIR][Standard] Update `tensor_from_elements` assembly format (details)
  5. [MLIR][Shape] Lower `shape_of` to `dynamic_tensor_from_elements` (details)
  6. [lldb] Don't infinite loop in SemaSourceWithPriorities::CompleteType when trying to complete a forward decl (details)
  7. [EarlyCSE] Explicitly require AAResultsWrapperPass. (details)
  8. [lldb] Fix a crash when the ASTImporter is giving us two Imported callbacks for the same target decl (details)
  9. [Test] Add failing test for pr47457 (details)
  10. [lldb] Enable std::pair in CxxModuleHandler (details)
  11. [mlir] Added support for loops to BufferPlacement transformation. (details)
  12. Temporairly revert "Thread safety analysis: Consider global variables in scope" & followup (details)
  13. Rename MemRefDescriptor::getElementType() to MemRefDescriptor::getElementPtrType(). (details)
  14. [AMDGPU] Workaround for LDS Misalignment bug on GFX10 (details)
  15. [ARM] Fixup of a few test cases. NFC. (details)
  16. [DomTree] Use SmallVector<DomTreeNodeBase *, 4> instead of std::vector. (details)
Commit 4e4a3feecdb6bd56483b9c6ba9116609c20588aa by Raphael Isemann
[lldb][doc] Mention python3-dev instead of python2.7-dev in build docs
The file was modifiedlldb/docs/resources/build.rst
Commit c0e5e3fbfa504c3792023d0db9008b08caa6b6d7 by ecaldas
[Ignore Expressions] Fix performance regression by inlining `Ignore*SingleStep`

We also add a `const` versions of `IgnoreExprNodes`

Differential Revision: https://reviews.llvm.org/D87278
The file was removedclang/lib/AST/IgnoreExpr.cpp
The file was modifiedclang/include/clang/AST/IgnoreExpr.h
The file was modifiedclang/lib/AST/CMakeLists.txt
Commit fdc8a1aac293084ffb2d7f04b1225c8e2fb3b164 by llvmgnsyncbot
[gn build] Port c0e5e3fbfa5
The file was modifiedllvm/utils/gn/secondary/clang/lib/AST/BUILD.gn
Commit 133322d2e30877d5039643ab5c2ed02f75c29466 by frgossen
[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
The file was modifiedmlir/test/IR/core-ops.mlir
The file was modifiedmlir/test/IR/invalid-ops.mlir
The file was modifiedmlir/lib/Dialect/StandardOps/IR/Ops.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/IR/Ops.td
The file was modifiedmlir/test/Transforms/canonicalize.mlir
The file was modifiedmlir/test/Conversion/ShapeToStandard/shape-to-standard.mlir
Commit 5106a8b8f8d0d3dd6c3fc0554f05402d8d9177ef by frgossen
[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
The file was modifiedmlir/lib/Dialect/StandardOps/IR/Ops.cpp
The file was modifiedmlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/IR/Ops.td
The file was modifiedmlir/test/Conversion/ShapeToStandard/shape-to-standard.mlir
Commit 32c8da41dc0cb99651823a1a21130c2cbdf688e1 by Raphael Isemann
[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
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
The file was addedlldb/test/API/commands/expression/import-std-module/forward_decl_from_module/main.cpp
The file was addedlldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/vector
The file was addedlldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/c++/v1/module.modulemap
The file was addedlldb/test/API/commands/expression/import-std-module/forward_decl_from_module/root/usr/include/libc_header.h
The file was addedlldb/test/API/commands/expression/import-std-module/forward_decl_from_module/Makefile
The file was addedlldb/test/API/commands/expression/import-std-module/forward_decl_from_module/TestForwardDeclFromStdModule.py
Commit 2bcc4db761768f1b7431237920f26360549ca268 by flo
[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
The file was addedllvm/test/Transforms/EarlyCSE/reuse-preserved-memoryssa.ll
The file was modifiedllvm/lib/Transforms/Scalar/GVN.cpp
The file was modifiedllvm/lib/Transforms/Scalar/EarlyCSE.cpp
Commit 7866b91405693df5b4cf6ba770b3a92d48b0c508 by Raphael Isemann
[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
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
The file was addedlldb/test/API/lang/c/record_decl_in_expr/TestRecordDeclInExpr.py
Commit 37a7c0a00773f135d909eb9eba7f82547aee1e89 by mkazantsev
[Test] Add failing test for pr47457
The file was addedllvm/test/Transforms/LoopLoadElim/pr47457.ll
Commit b85222520f861a1812f991d6bd65950dda22f31b by Raphael Isemann
[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
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
The file was addedlldb/test/API/commands/expression/import-std-module/pair/Makefile
The file was addedlldb/test/API/commands/expression/import-std-module/pair/main.cpp
The file was addedlldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
Commit feb0b9c3bba7db6d547b552c3cdaa838559da664 by marcel.koester
[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
The file was modifiedmlir/lib/Transforms/BufferPlacement.cpp
The file was modifiedmlir/test/Transforms/buffer-placement.mlir
Commit 8427885e27813c457dccb011f65e8ded74444e31 by lebedev.ri
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.
The file was modifiedclang/test/SemaCXX/warn-thread-safety-analysis.cpp
The file was modifiedclang/lib/Analysis/ThreadSafety.cpp
The file was modifiedclang/test/SemaCXX/warn-thread-safety-negative.cpp
The file was modifiedclang/lib/Analysis/ThreadSafetyCommon.cpp
Commit 3a577f544618d9713aca5052e55143142d23f427 by csigg
Rename MemRefDescriptor::getElementType() to MemRefDescriptor::getElementPtrType().

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D87284
The file was modifiedmlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
Commit 43af2a6faa272565cde4e3eec7dfeac593d29701 by Mirko.Brkusanin
[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.
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/lds-misaligned-bug.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/lds-misaligned-bug.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPU.td
The file was modifiedllvm/lib/Target/AMDGPU/SIISelLowering.cpp
Commit 8cb8cea1bd7f03330fc310b8993a3be89da90c1d by sjoerd.meijer
[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.
The file was modifiedllvm/test/CodeGen/Thumb2/active_lane_mask.ll
The file was modifiedllvm/test/Verifier/get-active-lane-mask.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/reductions.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-intrinsic-sub-sat.ll
Commit 3a61bfb027a623807a30adb496ab62203c9b4ba5 by flo
[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
The file was modifiedllvm/include/llvm/Support/GenericDomTree.h