Changes

Summary

  1. [Test] Fix test to make the transform for which is was added legal (details)
  2. [clangd][QueryDriver] Dont check for existence of driver (details)
  3. AArch64: mark x22 livein if it's an async context that gets stored. (details)
  4. X86: support Swift Async context (details)
  5. [gn build] Add build file for msan runtime (details)
  6. [gn build] reformat all gn files (details)
  7. [clang][deps] Specify Python 3 in shebang (details)
  8. [PowerPC] Do not emit dssall on AIX (details)
  9. [OpenCL] Drop pragma handling for extension types/decls. (details)
  10. [Test] Auto-generate checks in a test (prepring to update) (details)
  11. Revert "[clang][deps] Support inferred modules" (details)
  12. [mlir] Add folder for complex.ReOp and complex.ImOp. (details)
  13. [PowerPC] Add patterns for vselect of v1i128 (details)
  14. [OpenCL] Fix reinterpret_cast of vectors (details)
  15. Clean up uses of gmock Invoke in an attempt to make it work with GCC 6.2. NFCI. (details)
  16. Revert "[mlir] Add folder for complex.ReOp and complex.ImOp." (details)
  17. [debuginfo-tests] Fix environment variable used to specify LLDB (details)
  18. [X86] Regenerate cmov.ll tests (details)
  19. [InstCombine] isFreeToInvert(): constant expressions aren't free to invert (PR50370) (details)
  20. Put back the trailing commas on TYPED_TEST_SUITE (details)
  21. [mlir][memref] Mark memref.buffer_cast as NoSideEffect (details)
  22. [DebugInfo] Fix DWARF expressions for __block vars that are not on the heap (details)
  23. [AArch64] Lower bitreverse in ISel (details)
  24. Silence "Undefined or garbage value returned to caller" static analysis warning. NFCI. (details)
  25. [mlir] fix misformatted documentation for memref convention (details)
  26. [mlir] Improve TransferOp verifier: broadcasts are in_bounds (details)
  27. [clang-tidy] Fix altera-struct-pack-align crash for struct fields with incomplete type (details)
Commit 557906d3be7b8825a6728e9ff4feaadc816aebce by mkazantsev
[Test] Fix test to make the transform for which is was added legal

%limit in these tests is supposed to be positive.
The file was modifiedllvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
Commit ec2f7376e39fa5d820d059b6e83e69690fe6315f by kadircet
[clangd][QueryDriver] Dont check for existence of driver

Execute implementations already checks for permissions and existence
and returns relevant errors as necessary, so instead of printing our own errors,
we just print theirs.

This also fixes a case in windows where the driver might be missing the `.exe`
suffix. Previously, clangd would reject such a driver because sys::fs::exists is
strict, whereas the underlying Execute implementation would check with `.exe`
suffix too.

Fixes https://github.com/clangd/clangd/issues/93

Differential Revision: https://reviews.llvm.org/D102431
The file was modifiedclang-tools-extra/clangd/QueryDriverDatabase.cpp
Commit 769ced3d576bef1098c1e5819d4afeb9eee4d6bd by Tim Northover
AArch64: mark x22 livein if it's an async context that gets stored.

This fixes a crash with expensive checks enabled (the verifier was not happy).
The file was modifiedllvm/lib/Target/AArch64/AArch64FrameLowering.cpp
Commit 747e5cfb9f5d944b47fe014925b0d5dc2fda74d7 by Tim Northover
X86: support Swift Async context

This adds support to the X86 backend for the newly committed swiftasync
function parameter. If such a (pointer) parameter is present it gets stored
into an augmented frame record (populated in IR, but generally containing
enhanced backtrace for coroutines using lots of tail calls back and forth).

The context frame is identical to AArch64 (primarily so that unwinders etc
don't get extra complexity). Specfically, the new frame record is [AsyncCtx,
%rbp, ReturnAddr], and its presence is signalled by bit 60 of the stored %rbp
being set to 1. %rbp still points to the frame pointer in memory for backwards
compatibility (only partial on x86, but OTOH the weird AsyncCtx before the rest
of the record is because of x86).
The file was addedllvm/test/CodeGen/X86/swift-async.ll
The file was modifiedllvm/lib/Target/X86/X86FrameLowering.cpp
The file was modifiedllvm/lib/Target/X86/X86MachineFunctionInfo.h
The file was modifiedllvm/lib/Target/X86/X86FastISel.cpp
The file was addedllvm/test/CodeGen/X86/swift-async-reg.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
Commit 452e035729a4544a8defda806c1010c7111d5231 by thakis
[gn build] Add build file for msan runtime

Works for the examples on
https://clang.llvm.org/docs/MemorySanitizer.html

Differential Revision: https://reviews.llvm.org/D102554
The file was modifiedllvm/utils/gn/TODO.txt
The file was modifiedllvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
The file was modifiedcompiler-rt/lib/msan/CMakeLists.txt
The file was addedllvm/utils/gn/secondary/compiler-rt/lib/msan/BUILD.gn
Commit 77fa9a9b15d48e30e6ae99fdbec86f7e170fd10c by thakis
[gn build] reformat all gn files

$ git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
The file was modifiedllvm/utils/gn/secondary/llvm/utils/unittest/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Target/X86/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/clang/lib/Interpreter/BUILD.gn
Commit e827d74a97dcf6623470baf3bda86b1c9544e3df by Jan Svoboda
[clang][deps] Specify Python 3 in shebang

Some build bots don't like plain `python` in the shebang: https://lab.llvm.org/buildbot/#/builders/139/builds/4147.
The file was modifiedclang/utils/module-deps-to-rsp.py
Commit 74ae778176ec4dc8303e7f0c7dbab973c4c2e97c by nemanja.i.ibm
[PowerPC] Do not emit dssall on AIX

This instruction is a nop on all server cores (certainly on all
cores that AIX supports) so it is fine to emit a nop instead of it.
In fact, that is exactly what XL emits. So we emit a nop on AIX
and we leave the codegen as is on other platforms since there may
indeed be cores out there for which this actually does some prefetching.
The file was addedllvm/test/CodeGen/PowerPC/dssall.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrAltivec.td
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.td
Commit 3549466ac05eda57c9ce13abd7cb6dd365f6d8d6 by anastasia.stulova
[OpenCL] Drop pragma handling for extension types/decls.

Drop non-conformant extension pragma implementation as
it does not properly disable anything and therefore
enabling non-disabled logic has no meaning.

This simplifies clang code and user interface to the extension
functionality. With this patch extension pragma 'begin'/'end'
and 'enable'/'disable' are only accepted for backward
compatibility and no longer have any default behavior.

Differential Revision: https://reviews.llvm.org/D101043
The file was modifiedclang/lib/Sema/SemaType.cpp
The file was modifiedclang/lib/Sema/SemaOverload.cpp
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was modifiedclang/lib/Sema/Sema.cpp
The file was removedclang/test/CodeGenOpenCL/extension-begin.cl
The file was modifiedclang/test/SemaOpenCL/extension-begin.cl
The file was modifiedclang/lib/Parse/Parser.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticParseKinds.td
The file was modifiedclang/include/clang/Sema/Overload.h
The file was modifiedclang/test/SemaOpenCL/extension-begin.h
The file was modifiedclang/include/clang/Serialization/ASTWriter.h
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/Parse/ParsePragma.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/lib/Serialization/ASTReader.cpp
Commit 26b1df8b72efe77354627cc9d316f2ee318a588a by mkazantsev
[Test] Auto-generate checks in a test (prepring to update)
The file was modifiedllvm/test/Transforms/LoopDeletion/unreachable-loops.ll
Commit ccd485e55424b78c07c2f9520faf00b805f78c9b by Jan Svoboda
Revert "[clang][deps] Support inferred modules"

This reverts commit 1d9e8e13

Something is off with handling Windows paths: http://45.33.8.238/win/38908/step_7.txt
Most likely introduced in https://reviews.llvm.org/D102491
The file was removedclang/test/ClangScanDeps/Inputs/frameworks/Inferred.framework/Headers/Inferred.h
The file was removedclang/test/ClangScanDeps/Inputs/frameworks/System.framework/Headers/System.h
The file was removedclang/test/ClangScanDeps/modules-inferred-explicit-build.m
The file was modifiedclang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
The file was modifiedclang/test/ClangScanDeps/modules-full.cpp
The file was removedclang/utils/module-deps-to-rsp.py
The file was removedclang/test/ClangScanDeps/Inputs/frameworks/module.modulemap
The file was removedclang/test/ClangScanDeps/Inputs/modules_inferred_cdb.json
The file was removedclang/test/ClangScanDeps/modules-inferred.m
The file was removedclang/test/ClangScanDeps/Inputs/frameworks/System.framework/Modules/module.modulemap
The file was removedclang/test/ClangScanDeps/Inputs/frameworks/Inferred.framework/Frameworks/Sub.framework/Headers/Sub.h
Commit 6b49834d652ba70fc24eaea1c37330639d697de5 by akuegel
[mlir] Add folder for complex.ReOp and complex.ImOp.

Now that complex constants are supported, we can also fold.

Differential Revision: https://reviews.llvm.org/D102609
The file was modifiedmlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
The file was modifiedmlir/lib/Dialect/Complex/IR/ComplexOps.cpp
The file was addedmlir/test/Dialect/Complex/canonicalize.mlir
Commit 511f4ae54ed498981723f597d94cbf41f60b8d78 by nemanja.i.ibm
[PowerPC] Add patterns for vselect of v1i128

These patterns are missing even though the underlying instruction
doesn't really care about the type. Added these patterns to resolve
https://bugs.llvm.org/show_bug.cgi?id=50084
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrVSX.td
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrAltivec.td
The file was modifiedllvm/test/CodeGen/PowerPC/sat-add.ll
Commit 66b112d624a549489fa0af131cf7b632c6181424 by olemarius.strohm
[OpenCL] Fix reinterpret_cast of vectors

Fixes issues with vectors in reinterpret_cast in C++ for OpenCL
and adds tests to make sure they both pass without errors and
generate the correct code.

Fixes: PR47977

Reviewed By: Anastasia

Differential Revision: https://reviews.llvm.org/D101519
The file was addedclang/test/SemaOpenCLCXX/reinterpret-cast.clcpp
The file was addedclang/test/CodeGenOpenCLCXX/reinterpret_cast.clcpp
The file was modifiedclang/lib/Sema/SemaCast.cpp
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
Commit 34fa3f87335fe87bbbc757e5932a1ace2f47efd0 by benny.kra
Clean up uses of gmock Invoke in an attempt to make it work with GCC 6.2. NFCI.
The file was modifiedllvm/unittests/IR/PassBuilderCallbacksTest.cpp
Commit 967f07f5476a8d7884c822a7d92d83f7f68d5dad by akuegel
Revert "[mlir] Add folder for complex.ReOp and complex.ImOp."

This reverts commit 6b49834d652ba70fc24eaea1c37330639d697de5.

Some tests fail.
The file was removedmlir/test/Dialect/Complex/canonicalize.mlir
The file was modifiedmlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
The file was modifiedmlir/lib/Dialect/Complex/IR/ComplexOps.cpp
Commit d05ae0fd1732507bcf5ad3dbd0ba2ca77f22f633 by james.henderson
[debuginfo-tests] Fix environment variable used to specify LLDB

Currently, if the user specifies the environment variable 'CLANG', tests
will attempt to use the value as a path to the clang executable.
Previously, lldb could also be specified via the CLANG environment
variable, but this was almost certainly a bug, because that meant both
clang and lldb would have the same path. This patch changes the
environment variable for lldb to 'LLDB'.

Reviewed by: thopre, teemperor

Differential Revision: https://reviews.llvm.org/D101982
The file was modifieddebuginfo-tests/lit.cfg.py
The file was modifiedllvm/utils/lit/lit/TestingConfig.py
Commit 0863d06050eb3bbf04a60aabed81e1712c7b7442 by llvm-dev
[X86] Regenerate cmov.ll tests
The file was modifiedllvm/test/CodeGen/X86/cmov.ll
Commit e35a9ecf3df8f26ce50f8429cbaaf5a0e0212e86 by lebedev.ri
[InstCombine] isFreeToInvert(): constant expressions aren't free to invert (PR50370)

This fixes https://bugs.llvm.org/show_bug.cgi?id=50370,
which reports a yet another endless combine loop,
this one regressed from 554b1bced325a8d860ad00bd59020d66d01c95f8,
which fixed yet another endless combine loop (PR50308)

This code had fallen into the very typical pitfall of forgetting
that constant expressions exist, and they aren't free to invert,
because the `not` won't be absorbed by the "constant",
but will remain a (constant) expression...
The file was modifiedllvm/test/Transforms/InstCombine/not-add.ll
The file was modifiedllvm/include/llvm/Transforms/InstCombine/InstCombiner.h
Commit 05de4b413930418b60c0dd1e72681b476b50e7fb by benny.kra
Put back the trailing commas on TYPED_TEST_SUITE

This avoids a -pedantic warning:
warning: ISO C++11 requires at least one argument for the "..." in a variadic macro

See also https://github.com/google/googletest/issues/2271
The file was modifiedllvm/unittests/ADT/IListBaseTest.cpp
The file was modifiedllvm/unittests/ADT/STLForwardCompatTest.cpp
The file was modifiedllvm/unittests/ADT/DenseSetTest.cpp
The file was modifiedllvm/unittests/ADT/SmallVectorTest.cpp
The file was modifiedflang/unittests/RuntimeGTest/CharacterTest.cpp
The file was modifiedllvm/unittests/IR/ValueMapTest.cpp
The file was modifiedllvm/unittests/ADT/MapVectorTest.cpp
The file was modifiedllvm/unittests/XRay/FDRProducerConsumerTest.cpp
The file was modifiedllvm/unittests/ADT/TinyPtrVectorTest.cpp
The file was modifiedllvm/unittests/IR/PatternMatch.cpp
The file was modifiedllvm/unittests/Support/MathExtrasTest.cpp
The file was modifiedllvm/unittests/ADT/DenseMapTest.cpp
The file was modifiedllvm/unittests/ADT/PriorityWorklistTest.cpp
The file was modifiedllvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp
The file was modifiedllvm/unittests/ADT/BitVectorTest.cpp
The file was modifiedllvm/unittests/XRay/GraphTest.cpp
The file was modifiedclang/unittests/StaticAnalyzer/RangeSetTest.cpp
The file was modifiedllvm/unittests/XRay/FDRRecordPrinterTest.cpp
The file was modifiedllvm/unittests/ADT/RangeAdapterTest.cpp
Commit db81e88f25f227a007c1202bd8a88aff722ddc6b by herhut
[mlir][memref] Mark memref.buffer_cast as NoSideEffect

This brings it in line with the bultin unrealized_conversion_cast,
which memref.buffer_cast is a specialized version of.

Differential Revision: https://reviews.llvm.org/D102608
The file was modifiedmlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
The file was modifiedmlir/test/Dialect/Linalg/bufferize.mlir
Commit 888ce70af288168136cf1ca658c3cf6d6759bb3f by Raphael Isemann
[DebugInfo] Fix DWARF expressions for __block vars that are not on the heap

`__block` variables used to be always stored on the head instead of stack.
D51564 allowed `__block` variables to the stored on the stack like normal
variablesif they not captured by any escaping block, but the debug-info
generation code wasn't made aware of it so we still unconditionally emit DWARF
expressions pointing to the heap.

This patch makes CGDebugInfo use the `EscapingByref` introduced in D51564 that
tracks whether the `__block` variable is actually on the heap. If it's stored on
the stack instead we just use the debug info we would generate for normal
variables instead.

Reviewed By: ahatanak, aprantl

Differential Revision: https://reviews.llvm.org/D99946
The file was modifiedclang/test/CodeGen/debug-info-block-expr.c
The file was modifiedclang/lib/CodeGen/CGDebugInfo.cpp
Commit 50511df32edf53238b75b0e9767120dc772dbf14 by irina.dobrescu
[AArch64] Lower bitreverse in ISel

Adding lowering support for bitreverse.

Previously, lowering bitreverse would expand it into a series of other instructions. This patch makes it so this produces a single rbit instruction instead.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D102397
The file was modifiedllvm/test/CodeGen/AArch64/bitreverse.ll
The file was modifiedclang/test/CodeGen/aarch64-neon-misc.c
The file was modifiedllvm/lib/IR/AutoUpgrade.cpp
The file was addedllvm/test/CodeGen/AArch64/neon_rbit.ll
The file was modifiedllvm/include/llvm/IR/IntrinsicsAArch64.td
The file was modifiedllvm/lib/Target/AArch64/AArch64InstrInfo.td
The file was modifiedllvm/test/CodeGen/AArch64/arm64-vbitwise.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp
Commit b89e09a19f9b60dfa9477b24a404a7ae5522f898 by llvm-dev
Silence "Undefined or garbage value returned to caller" static analysis warning. NFCI.
The file was modifiedclang/lib/Driver/Driver.cpp
Commit 9b7e5b63aa60b2df9e683b1acf3e855062da1773 by zinenko
[mlir] fix misformatted documentation for memref convention

The code-block ending marker was missing.
The file was modifiedmlir/docs/LLVMDialectMemRefConvention.md
Commit 2c9688d201a79383282c22dca2c2826688d5272c by springerm
[mlir] Improve TransferOp verifier: broadcasts are in_bounds

Broadcast dimensions of vector transfer ops are always in-bounds. This is consistent with the fact that the starting position of a transfer is always in-bounds.

Differential Revision: https://reviews.llvm.org/D102566
The file was modifiedmlir/lib/Dialect/Vector/VectorOps.cpp
The file was modifiedmlir/test/Dialect/Vector/invalid.mlir
The file was modifiedmlir/include/mlir/Interfaces/VectorInterfaces.td
The file was modifiedmlir/include/mlir/Dialect/Vector/VectorOps.td
Commit ab92a4c26f54170bf72706ad29c0fb151a177590 by jubnzv
[clang-tidy] Fix altera-struct-pack-align crash for struct fields with incomplete type

We can only use ASTContext::getTypeInfo for complete types.

This fixes bugzilla issue 50313.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D102569
The file was modifiedclang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp
The file was addedclang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-no-crash.cpp