FailedChanges

Summary

  1. [ThinLTO] Make -lto-embed-bitcode an enum (details)
  2. [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle (details)
  3. [SyntaxTree][Synthesis] Add support for Tree. (details)
  4. Re-apply "[ORC] Make MaterializationResponsibility immovable..." with fixes. (details)
  5. Fix -gz=zlib options for linker (details)
  6. Sema: add support for `__attribute__((__swift_error__))` (details)
  7. [lld][WebAssembly] Convert a objyaml-using test to assembly (details)
  8. Fix test hip-gz-options.hip (details)
  9. CodeGen: Require SSA to run PeepholeOptimizer (details)
  10. RegAllocFast: Fix typo in comment (details)
  11. docs: add a newline to appease Sphinx (details)
  12. [MC] Allow .org directives in SHT_NOBITS sections (details)
  13. [NFC][Asan] Early return from GetBlockBegin (details)
  14. Fix clang Wrange-loop-analysis in BuildTree.cpp (details)
  15. [lldb] Add test for CFMutableDictionaryRef (details)
  16. [MS ABI] Add mangled type for auto template parameter whose argument kind is Integeral (details)
  17. [NFC][Asan] Add another lsan test (details)
  18. [NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen pipeline (details)
  19. [ConstantFold] Fold binary arithmetic on scalable vector splats. (details)
  20. [NFC] Remove unused static function (details)
  21. Fix a typo in 31ecf8d29d81d196374a562c6d2bd2c25a62861e (details)
  22. [gn build] Port 31ecf8d29d8 (details)
Commit 9a2bab5ea2f4aacbb267e634ff1189fa64143b76 by mtrofin
[ThinLTO] Make -lto-embed-bitcode an enum

The current behavior of -lto-embed-bitcode is not quite the same as that
of -fembed-bitcode. While both populate .llvmbc with bitcode, the latter
populates it with pre-optimized bitcode(*), while the former with
post-optimized. The scenarios driving them are different - the latter's
goal is to allow re-compilation, while the former, IIUC, is execution.

I plan to add a third mode for thinlto cases, closely-related to
-fembed-bitcode's scenario: adding the bitcode pre-optimization, but
post-merging. This would allow re-compilation without requiring the
other .bc files that were merged (akin to how -fembed-bitcode allows
recompilation without all the .h files)

The third mode can't co-exist with the current -lto-embed-bitcode mode,
because the latter would overwrite it. For clarity, we change
-lto-embed-bitcode to be an enum.

(*) That's the compiler semantics. The driver splits compilation in 2
phases, so if -fembed-bitcode is given to the driver, the .llvmbc is
optimized bitcode; if the option is passed to the compiler (after -cc1),
the section is pre-optimized.

Differential Revision: https://reviews.llvm.org/D87477
The file was modifiedllvm/test/LTO/X86/embed-bitcode.ll
The file was modifiedllvm/lib/LTO/LTOBackend.cpp
Commit df477db5f9e0ea2a4890040b65002d93e33209b0 by xun
[Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

In generating the code for symmetric transfer, a temporary object is created to store the returned handle from await_suspend() call of the awaiter. Previously this temp won't be cleaned up until very later, which ends up causing this temp to be spilled to the heap. However, we know that this temp will no longer be needed after the coro_resume call. We can clean it up right after.

Differential Revision: https://reviews.llvm.org/D87470
The file was addedclang/test/CodeGenCoroutines/coro-semmetric-transfer.cpp
The file was modifiedclang/lib/Sema/SemaCoroutine.cpp
The file was modifiedclang/test/CodeGenCoroutines/Inputs/coroutine.h
Commit 7c37b82f5ba5883b331608b0077c0b30bf301874 by ecaldas
[SyntaxTree][Synthesis] Add support for Tree.

In a future patch
* Implement helper function to generate Trees for tests
* and test Tree methods, namely `findFirstLeaf` and `findLastLeaf`

Differential Revision: https://reviews.llvm.org/D87533
The file was modifiedclang/include/clang/Tooling/Syntax/BuildTree.h
The file was modifiedclang/lib/Tooling/Syntax/Synthesis.cpp
The file was modifiedclang/unittests/Tooling/Syntax/SynthesisTest.cpp
Commit 7dcd0042e8b8581751bd9b915207058d2ab88e1d by Lang Hames
Re-apply "[ORC] Make MaterializationResponsibility immovable..." with fixes.

Re-applies c74900ca672 with fixes for the ThinLtoJIT example.
The file was modifiedllvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Core.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/LazyReexports.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Layer.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/IRTransformLayer.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/IRCompileLayer.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/Speculation.cpp
The file was modifiedllvm/examples/SpeculativeJIT/SpeculativeJIT.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/LLJIT.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Speculation.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/Core.cpp
The file was modifiedllvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
The file was modifiedllvm/examples/ThinLtoJIT/ThinLtoJIT.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
The file was modifiedllvm/examples/ThinLtoJIT/ThinLtoInstrumentationLayer.cpp
The file was modifiedllvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp
The file was modifiedllvm/examples/ThinLtoJIT/ThinLtoInstrumentationLayer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/ObjectTransformLayer.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
The file was modifiedllvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/Layer.cpp
Commit ccb4124a4172bf2cb2e1cd7c253f0f1654fce294 by Yaxun.Liu
Fix -gz=zlib options for linker

gcc translates -gz=zlib to --compress-debug-options=zlib for both assembler and linker
but clang only does this for assembler.

The linker needs --compress-debug-options=zlib option to compress the debug sections
in the generated executable or shared library.

Due to this bug, -gz=zlib has no effect on the generated executable or shared library.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D87321
The file was modifiedclang/lib/Driver/ToolChains/CommonArgs.h
The file was modifiedclang/lib/Driver/ToolChains/HIP.cpp
The file was addedclang/test/Driver/amdgcn-gz-options.cl
The file was modifiedclang/test/Driver/compress.c
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp
The file was modifiedclang/lib/Driver/ToolChains/AMDGPU.cpp
The file was modifiedclang/lib/Driver/ToolChains/CommonArgs.cpp
The file was addedclang/test/Driver/hip-gz-options.hip
Commit f5ab5b20fb2aae5567e6c50cc642ff63eb2146d4 by Saleem Abdulrasool
Sema: add support for `__attribute__((__swift_error__))`

Introduce a new attribute that is used to indicate the error handling
convention used by a function.  This is used to translate the error
semantics from the decorated interface to a compatible Swift interface.

The supported error convention is one of:
- none: no error handling
- nonnull_error: a non-null error parameter indicates an error signifier
- null_result: a return value of NULL is an error signifier
- zero_result: a return value of 0 is an error signifier
- nonzero_result: a non-zero return value is an error signifier

Since this is the first of the attributes needed to support the semantic
annotation for Swift, this change also includes the necessary supporting
infrastructure for a new category of attributes (Swift).

This is based on the work of the original changes in
https://github.com/llvm/llvm-project-staging/commit/8afaf3aad2af43cfedca7a24cd817848c4e95c0c

Differential Revision: https://reviews.llvm.org/D87331
Reviewed By: John McCall, Aaron Ballman, Dmitri Gribenko
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp
The file was addedclang/test/SemaObjC/attr-swift-error.m
The file was modifiedclang/include/clang/Basic/Attr.td
The file was modifiedclang/test/Misc/pragma-attribute-supported-attributes-list.test
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/include/clang/Basic/AttrDocs.td
Commit e3e3d6eecfa5003bf431d8223bcc968e2ce291c8 by sbc
[lld][WebAssembly] Convert a objyaml-using test to assembly

Differential Revision: https://reviews.llvm.org/D87536
The file was addedlld/test/wasm/gc-imports.s
The file was removedlld/test/wasm/gc-imports.ll
The file was addedlld/test/wasm/Inputs/undefined-globals.s
The file was removedlld/test/wasm/Inputs/undefined-globals.yaml
Commit ee13ae030e21d584c72d384ea463896400ccee1c by Yaxun.Liu
Fix test hip-gz-options.hip
The file was modifiedclang/test/Driver/hip-gz-options.hip
Commit e21bb31eb6c6fcff652ecfb338e8558362473150 by Matthew.Arsenault
CodeGen: Require SSA to run PeepholeOptimizer
The file was modifiedllvm/test/CodeGen/AMDGPU/fold_16bit_imm.mir
The file was modifiedllvm/lib/CodeGen/PeepholeOptimizer.cpp
Commit 382b2b1b5183cdcc4c57b0650e25f4f107619099 by Matthew.Arsenault
RegAllocFast: Fix typo in comment
The file was modifiedllvm/lib/CodeGen/RegAllocFast.cpp
Commit 43e6c59f1c1fc3c1b9cdcddfe9826b9abf2cfb73 by Saleem Abdulrasool
docs: add a newline to appease Sphinx

Sphinx expects an empty newline after the bulleted list.
The file was modifiedclang/include/clang/Basic/AttrDocs.td
Commit 45d0343900d3005d1d00cbb1a87c419c085dec71 by maskray
[MC] Allow .org directives in SHT_NOBITS sections

This is used by kvm-unit-tests and can be trivially supported.
The file was modifiedllvm/test/MC/ELF/org.s
The file was modifiedllvm/lib/MC/MCAssembler.cpp
Commit 658475897b14781070549f72483fd283e3fe50aa by Vitaly Buka
[NFC][Asan] Early return from GetBlockBegin
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
Commit e10df779f097e3a1fb02d901117ce71a5dd9dda2 by gribozavr
Fix clang Wrange-loop-analysis in BuildTree.cpp

Building on Mac OS with clang 12:

```
jhemphill@jhemphill-mbp build % clang --version
Apple clang version 12.0.0 (clang-1200.0.26.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
```

yields one warning:

```
/Users/jhemphill/oss/llvm-project/clang/lib/Tooling/Syntax/BuildTree.cpp:1126:22: warning: loop variable 'Arg' is always a copy because the range of type 'llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr *, clang::Stmt *> >' does not return a reference [-Wrange-loop-analysis]
    for (const auto &Arg : Args) {
                     ^
/Users/jhemphill/oss/llvm-project/clang/lib/Tooling/Syntax/BuildTree.cpp:1126:10: note: use non-reference type 'clang::Expr *'
    for (const auto &Arg : Args) {
```

It appears that `Arg` is an `Expr*`, passed by value rather than by const reference.

Reviewed By: eduucaldas, gribozavr2

Differential Revision: https://reviews.llvm.org/D87482
The file was modifiedclang/lib/Tooling/Syntax/BuildTree.cpp
Commit 76e3a27c16d2a8171454cf12a33e35e3ae6f9dc2 by Jonas Devlieghere
[lldb] Add test for CFMutableDictionaryRef

While writing a test for a change in Foundation I noticed we didn't yet
test CFMutableDictionaryRef.
The file was modifiedlldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
The file was modifiedlldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m
Commit 83286a1a8f059d1664b64341854676a36a85cecd by zequanwu
[MS ABI] Add mangled type for auto template parameter whose argument kind is Integeral
The file was modifiedclang/lib/AST/MicrosoftMangle.cpp
The file was modifiedclang/include/clang/Basic/LangOptions.h
The file was addedclang/test/CodeGenCXX/mangle-ms-auto-templates.cpp
Commit 12292c8b27aca8d173a3a2825f2e8aeb383cc695 by Vitaly Buka
[NFC][Asan] Add another lsan test
The file was addedcompiler-rt/test/asan/TestCases/leaks.cpp
Commit 31ecf8d29d81d196374a562c6d2bd2c25a62861e by Yuanfang Chen
[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen pipeline

Following up on D67687.
Please refer to the RFC here http://lists.llvm.org/pipermail/llvm-dev/2020-July/143309.html

`CodeGenPassBuilder` is the NPM counterpart of `TargetPassConfig` with below differences.
- Debugging features (MIR print/verify, disable pass, start/stop-before/after, etc.) living in `TargetPassConfig` are moved to use PassInstrument as much as possible. (Implementation also lives in `TargetPassConfig.cpp`)
- `TargetPassConfig` is a polymorphic base (virtual inheritance) to build the target-dependent pipeline whereas `CodeGenPassBuilder` is the CRTP base/helper to implement the target-dependent pipeline. The motivation is flexibility for targets to customize the pipeline, inlining opportunity, and fits the overall NPM value semantics design.
- `TargetPassConfig` is a legacy immutable pass to declare hooks for targets to customize some target-independent codegen layer behavior. This is partially ported to TargetMachine::options. The rest, such as `createMachineScheduler/createPostMachineScheduler`, are left out for now. They should be implemented in LLVMTargetMachine in the future.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D83608
The file was addedllvm/include/llvm/CodeGen/CGPassBuilderOption.h
The file was modifiedllvm/lib/CodeGen/TargetPassConfig.cpp
The file was addedllvm/include/llvm/CodeGen/CodeGenPassBuilder.h
The file was modifiedllvm/include/llvm/Target/TargetMachine.h
The file was modifiedllvm/include/llvm/Passes/StandardInstrumentations.h
The file was addedllvm/include/llvm/CodeGen/MachinePassRegistry.def
The file was modifiedllvm/lib/CodeGen/LLVMTargetMachine.cpp
The file was addedllvm/lib/CodeGen/CodeGenPassBuilder.cpp
The file was modifiedllvm/lib/CodeGen/CMakeLists.txt
Commit 37f2776d1af27a38ba4fabf3b356d71590f70d90 by efriedma
[ConstantFold] Fold binary arithmetic on scalable vector splats.

It's a nice simplification, and it confuses instcombine if we don't do
it.

Differential Revision: https://reviews.llvm.org/D87422
The file was modifiedllvm/test/Transforms/InstSimplify/ConstProp/vscale.ll
The file was modifiedllvm/lib/IR/ConstantFold.cpp
Commit a8503b87f739776cc9d5738f69aa0990db952340 by Vitaly Buka
[NFC] Remove unused static function
The file was modifiedclang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
Commit 3fdaa8602a086a3fca5f0fc8527536ac659079d0 by Yuanfang Chen
Fix a typo in 31ecf8d29d81d196374a562c6d2bd2c25a62861e
The file was modifiedllvm/include/llvm/CodeGen/CodeGenPassBuilder.h
Commit c931dc0bf596ed0a6c4531b0e1f05bd8bda566a6 by llvmgnsyncbot
[gn build] Port 31ecf8d29d8
The file was modifiedllvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn