SuccessChanges

Summary

  1. [ELF] Reorganize "is only supported on" tests and fix some diagnostics (details)
  2. PR48434: Work around crashes due to deserialization cycles via typedefs. (details)
  3. Add new 'preferred_name' attribute. (details)
  4. Add another test for PR48434. (details)
  5. [ASTImporter] Support CXXDeductionGuideDecl with local typedef (details)
  6. [OpenMP] Fix too long name for shm segment on macOS (details)
  7. [OpenMP] Fix norespect affinity bug for Windows (details)
  8. [mlir][Affine] Fix vectorizability check for multiple load/stores (details)
  9. [clangd] NFC: Add client-side logging for remote index requests (details)
  10. [NFC] Removed unused prefixes in llvm/test/CodeGen/AArch64 (details)
  11. [WebAssembly] Add support for named data sections in wasm binaries (details)
  12. [DFSan] Add custom wrapper for recvmsg. (details)
  13. [AMDGPU][MC] Restore old error position for "too few operands" (details)
  14. [NFCI] Add missing triple to several LTO tests (details)
  15. Frontend: Migrate to FileEntryRef in CompilerInstance::InitializeSourceManager, NFC (details)
  16. [LLD][gold] Add -plugin-opt=no-new-pass-manager (details)
  17. [mlir] Allow RegionBranchOps in dependence analysis (details)
  18. Avoid a possible one-byte OOB read off of .drectve sections (details)
  19. [X86] Use APInt::isSignedIntN instead of isIntN for 64-bit ANDs in X86DAGToDAGISel::IsProfitableToFold (details)
  20. [MC][AMDGPU] Consume EndOfStatement in asm parser (details)
Commit baef18dffba1a2f91b47b484ac2233dfcf923f9b by i
[ELF] Reorganize "is only supported on" tests and fix some diagnostics
The file was addedlld/test/ELF/target-specific-options.s
The file was removedlld/test/ELF/aarch64-cortex-a53-843419-cli.s
The file was modifiedlld/ELF/Driver.cpp
The file was removedlld/test/ELF/ppc64-tocopt-option.s
Commit 997a719d5a70100fcbbec1e51ce44cd66041bddc by richard
PR48434: Work around crashes due to deserialization cycles via typedefs.

Ensure that we can deserialize a TypedefType even while in the middle of
deserializing its TypedefDecl, by removing the need to look at the
TypedefDecl while constructing the TypedefType.

This fixes all the currently-known failures for PR48434, but it's not a
complete fix, because we can still trigger deserialization cycles, which
are not supposed to happen.
The file was modifiedclang/include/clang/AST/Type.h
The file was modifiedclang/lib/AST/ASTContext.cpp
The file was modifiedclang/test/PCH/cxx-templates.h
The file was modifiedclang/lib/AST/Type.cpp
The file was modifiedclang/include/clang/AST/TypeProperties.td
The file was modifiedclang/test/PCH/cxx-templates.cpp
The file was modifiedclang/include/clang/AST/ASTContext.h
Commit 2a2c228c7ada0a5d77c48b4d445ab0013ca0ae19 by richard
Add new 'preferred_name' attribute.

This attribute permits a typedef to be associated with a class template
specialization as a preferred way of naming that class template
specialization. This permits us to specify that (for example) the
preferred way to express 'std::basic_string<char>' is as 'std::string'.

The attribute is applied to the various class templates in libc++ that have
corresponding well-known typedef names.

This is a re-commit. The previous commit was reverted because it exposed
a pre-existing bug that has since been fixed / worked around; see
PR48434.

Differential Revision: https://reviews.llvm.org/D91311
The file was modifiedlibcxx/include/regex
The file was modifiedlibcxx/include/string_view
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp
The file was modifiedclang/lib/Sema/SemaTemplate.cpp
The file was addedclang/test/PCH/decl-attrs.cpp
The file was modifiedclang/include/clang/Basic/AttrDocs.td
The file was modifiedlibcxx/include/iosfwd
The file was modifiedclang/include/clang/Basic/Attr.td
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp
The file was modifiedlibcxx/include/string
The file was modifiedclang/test/SemaTemplate/attributes.cpp
The file was modifiedclang/utils/TableGen/ClangAttrEmitter.cpp
The file was modifiedlibcxx/include/__config
The file was modifiedclang/lib/AST/TypePrinter.cpp
Commit 4ae8651c59241bca0c1ea5adaf8f06b292696b6f by richard
Add another test for PR48434.
The file was modifiedclang/test/PCH/decl-attrs.cpp
Commit a5e6590b15b17793d7a82f8b39998381acb73109 by gabor.marton
[ASTImporter] Support CXXDeductionGuideDecl with local typedef

CXXDeductionGuideDecl with a local typedef has its own copy of the
TypedefDecl with the CXXDeductionGuideDecl as the DeclContext of that
TypedefDecl.
```
      template <typename T> struct A {
        typedef T U;
        A(U, T);
      };
      A a{(int)0, (int)0};
```
Related discussion on cfe-dev:
http://lists.llvm.org/pipermail/cfe-dev/2020-November/067252.html

Without this fix, when we import the CXXDeductionGuideDecl (via
VisitFunctionDecl) then before creating the Decl we must import the
FunctionType. However, the first parameter's type is the afore mentioned
local typedef. So, we then start importing the TypedefDecl whose
DeclContext is the CXXDeductionGuideDecl itself. The infinite loop is
formed.
```
#0 clang::ASTNodeImporter::VisitCXXDeductionGuideDecl(clang::CXXDeductionGuideDecl*) clang/lib/AST/ASTImporter.cpp:3543:0
#1 clang::declvisitor::Base<std::add_pointer, clang::ASTNodeImporter, llvm::Expected<clang::Decl*> >::Visit(clang::Decl*) /home/egbomrt/WORK/llvm5/build/debug/tools/clang/include/clang/AST/DeclNodes.inc:405:0
#2 clang::ASTImporter::ImportImpl(clang::Decl*) clang/lib/AST/ASTImporter.cpp:8038:0
#3 clang::ASTImporter::Import(clang::Decl*) clang/lib/AST/ASTImporter.cpp:8200:0
#4 clang::ASTImporter::ImportContext(clang::DeclContext*) clang/lib/AST/ASTImporter.cpp:8297:0
#5 clang::ASTNodeImporter::ImportDeclContext(clang::Decl*, clang::DeclContext*&, clang::DeclContext*&) clang/lib/AST/ASTImporter.cpp:1852:0
#6 clang::ASTNodeImporter::ImportDeclParts(clang::NamedDecl*, clang::DeclContext*&, clang::DeclContext*&, clang::DeclarationName&, clang::NamedDecl*&, clang::SourceLocation&) clang/lib/AST/ASTImporter.cpp:1628:0
#7 clang::ASTNodeImporter::VisitTypedefNameDecl(clang::TypedefNameDecl*, bool) clang/lib/AST/ASTImporter.cpp:2419:0
#8 clang::ASTNodeImporter::VisitTypedefDecl(clang::TypedefDecl*) clang/lib/AST/ASTImporter.cpp:2500:0
#9 clang::declvisitor::Base<std::add_pointer, clang::ASTNodeImporter, llvm::Expected<clang::Decl*> >::Visit(clang::Decl*) /home/egbomrt/WORK/llvm5/build/debug/tools/clang/include/clang/AST/DeclNodes.inc:315:0
#10 clang::ASTImporter::ImportImpl(clang::Decl*) clang/lib/AST/ASTImporter.cpp:8038:0
#11 clang::ASTImporter::Import(clang::Decl*) clang/lib/AST/ASTImporter.cpp:8200:0
#12 llvm::Expected<clang::TypedefNameDecl*> clang::ASTNodeImporter::import<clang::TypedefNameDecl>(clang::TypedefNameDecl*) clang/lib/AST/ASTImporter.cpp:165:0
#13 clang::ASTNodeImporter::VisitTypedefType(clang::TypedefType const*) clang/lib/AST/ASTImporter.cpp:1304:0
#14 clang::TypeVisitor<clang::ASTNodeImporter, llvm::Expected<clang::QualType> >::Visit(clang::Type const*) /home/egbomrt/WORK/llvm5/build/debug/tools/clang/include/clang/AST/TypeNodes.inc:74:0
#15 clang::ASTImporter::Import(clang::QualType) clang/lib/AST/ASTImporter.cpp:8071:0
#16 llvm::Expected<clang::QualType> clang::ASTNodeImporter::import<clang::QualType>(clang::QualType const&) clang/lib/AST/ASTImporter.cpp:179:0
#17 clang::ASTNodeImporter::VisitFunctionProtoType(clang::FunctionProtoType const*) clang/lib/AST/ASTImporter.cpp:1244:0
#18 clang::TypeVisitor<clang::ASTNodeImporter, llvm::Expected<clang::QualType> >::Visit(clang::Type const*) /home/egbomrt/WORK/llvm5/build/debug/tools/clang/include/clang/AST/TypeNodes.inc:47:0
#19 clang::ASTImporter::Import(clang::QualType) clang/lib/AST/ASTImporter.cpp:8071:0
#20 llvm::Expected<clang::QualType> clang::ASTNodeImporter::import<clang::QualType>(clang::QualType const&) clang/lib/AST/ASTImporter.cpp:179:0
#21 clang::QualType clang::ASTNodeImporter::importChecked<clang::QualType>(llvm::Error&, clang::QualType const&) clang/lib/AST/ASTImporter.cpp:198:0
#22 clang::ASTNodeImporter::VisitFunctionDecl(clang::FunctionDecl*) clang/lib/AST/ASTImporter.cpp:3313:0
#23 clang::ASTNodeImporter::VisitCXXDeductionGuideDecl(clang::CXXDeductionGuideDecl*) clang/lib/AST/ASTImporter.cpp:3543:0
```

The fix is to first create the TypedefDecl and only then start to import
the DeclContext.
Basically, we could do this during the import of all other Decls (not
just for typedefs). But it seems, there is only one another AST
construct that has a similar cycle: a struct defined as a function
parameter:
```
int struct_in_proto(struct data_t{int a;int b;} *d);

```
In that case, however, we had decided to return simply with an error
back then because that seemed to be a very rare construct.

Differential Revision: https://reviews.llvm.org/D92209
The file was modifiedclang/lib/AST/ASTImporter.cpp
The file was modifiedclang/unittests/AST/ASTImporterTest.cpp
Commit 9b7d6a6bffce14c766eaa90c7a3d3b8d192cdfb0 by jonathan.l.peyton
[OpenMP] Fix too long name for shm segment on macOS

Remove the user id component to the shm segment name and just use
the pid like before.

Differential Revision: https://reviews.llvm.org/D92660
The file was modifiedopenmp/runtime/src/kmp_runtime.cpp
Commit fe3b244ef7c2656c5876ff3f91232406f9854c42 by jonathan.l.peyton
[OpenMP] Fix norespect affinity bug for Windows

KMP_AFFINITY=norespect was triggering an error because the underlying
process affinity mask was not updated to include the entire machine.
The Windows documentation states that the thread affinities must be
subsets of the process affinity. This patch also moves the printing
(for KMP_AFFINITY=verbose) of whether the initial mask was respected
out of each topology detection function and to one location where the
initial affinity mask is read.

Differential Revision: https://reviews.llvm.org/D92587
The file was modifiedopenmp/runtime/src/kmp_affinity.cpp
The file was modifiedopenmp/runtime/src/kmp_affinity.h
The file was modifiedopenmp/runtime/src/kmp.h
Commit 2d3b9fdc193fa835313f09f526b51bf6de3a54ef by diego.caballero
[mlir][Affine] Fix vectorizability check for multiple load/stores

This patch fixes a bug that allowed vectorizing of loops with loads and
stores having indexing functions varying along different memory
dimensions.

Reviewed By: aartbik, dcaballe

Differential Revision: https://reviews.llvm.org/D92702
The file was modifiedmlir/lib/Analysis/LoopAnalysis.cpp
The file was modifiedmlir/test/Dialect/Affine/SuperVectorize/vectorize_1d.mlir
Commit 5a1bc69f811059b8f62d381e3526d92fffa7d91a by kbobyrev
[clangd] NFC: Add client-side logging for remote index requests

Figuring out whether the server is responding and debugging issues with remote
index setup is no easy task: add verbose logging for client side RPC requests
to relieve some pain.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D92181
The file was modifiedclang-tools-extra/clangd/index/remote/Client.cpp
Commit 55ea639d3c576f713041c3d1832e71d92f732ee3 by mtrofin
[NFC] Removed unused prefixes in llvm/test/CodeGen/AArch64

Differential Revision: https://reviews.llvm.org/D92943
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-int-div.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-fp-arith.ll
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-fp-converts.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-fp-select.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-int-select.ll
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call-weak.ll
Commit 9a72d3e3e456ffa9cfb4e0b2c2e81da78bb15dd3 by sbc
[WebAssembly] Add support for named data sections in wasm binaries

Followup to https://reviews.llvm.org/D91769 which added support
for names globals.

Differential Revision: https://reviews.llvm.org/D92909
The file was modifiedlld/wasm/SyntheticSections.cpp
The file was modifiedllvm/include/llvm/ObjectYAML/WasmYAML.h
The file was modifiedlld/test/wasm/signature-mismatch.ll
The file was modifiedllvm/include/llvm/BinaryFormat/Wasm.h
The file was modifiedlld/test/wasm/gc-sections.ll
The file was modifiedlld/test/wasm/local-symbols.ll
The file was modifiedlld/test/wasm/map-file.s
The file was modifiedllvm/tools/obj2yaml/wasm2yaml.cpp
The file was modifiedllvm/lib/ObjectYAML/WasmYAML.cpp
The file was modifiedlld/wasm/Writer.cpp
The file was modifiedlld/test/wasm/weak-symbols.s
The file was modifiedlld/test/wasm/call-indirect.ll
The file was modifiedllvm/lib/Object/WasmObjectFile.cpp
The file was modifiedlld/test/wasm/locals-duplicate.test
The file was modifiedlld/wasm/SyntheticSections.h
The file was modifiedllvm/lib/ObjectYAML/WasmEmitter.cpp
The file was modifiedlld/test/wasm/data-segment-merging.ll
Commit a3eb2fb247686af0216337687e921118710b56f3 by mascasa
[DFSan] Add custom wrapper for recvmsg.

The wrapper clears shadow for anything written by recvmsg.

Reviewed By: stephan.yichao.zhao

Differential Revision: https://reviews.llvm.org/D92949
The file was modifiedcompiler-rt/test/dfsan/custom.cpp
The file was modifiedcompiler-rt/lib/dfsan/dfsan_custom.cpp
The file was modifiedcompiler-rt/lib/dfsan/done_abilist.txt
Commit f5f4b8b60fc0931440c4f2549fbff0965c868d2c by scott.linder
[AMDGPU][MC] Restore old error position for "too few operands"

Revert part of https://reviews.llvm.org/D92084 to make it simpler to
start consuming the EndOfStatement token within AMDGPU's
ParseInstruction in a future patch. This also brings us back to what
every other target currently does.

A future change to move the position back to the end of the statement
would likely need to audit all of the AMDGPUOperand SMLoc ranges, and
determine the SMLoc for the last character of the last operand.

Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D92960
The file was modifiedllvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
The file was modifiedllvm/test/MC/AMDGPU/gfx10_err_pos.s
The file was modifiedllvm/test/MC/AMDGPU/exp-err.s
Commit 8b23b3ab3aea28b91e5aa48f29fe9eb1828515a3 by Yuanfang Chen
[NFCI] Add missing triple to several LTO tests

Also remove the module triple of clang/test/CodeGenObjC/arc.ll, the
commandline tripe is all it needs.
The file was modifiedclang/test/CodeGenObjC/arc.ll
The file was modifiedllvm/test/tools/gold/X86/Inputs/type-merge2.ll
The file was modifiedllvm/test/tools/gold/X86/Inputs/visibility.ll
The file was modifiedllvm/test/ThinLTO/X86/Inputs/distributed_import.ll
The file was modifiedllvm/test/tools/gold/X86/Inputs/comdat.ll
Commit a5c89bb02195a97aa71a4033336d9864098c764f by Duncan P. N. Exon Smith
Frontend: Migrate to FileEntryRef in CompilerInstance::InitializeSourceManager, NFC

Use `FileManager::getVirtualFileRef` to get the virtual file for stdin,
and add an overload of `SourceManager::overrideFileContents` that takes
a `FileEntryRef`, migrating `CompilerInstance::InitializeSourceManager`.

Differential Revision: https://reviews.llvm.org/D92680
The file was modifiedclang/include/clang/Basic/SourceManager.h
The file was modifiedclang/lib/Frontend/CompilerInstance.cpp
Commit 68ff3b3376f4242307a36ac035a512ec4e256628 by i
[LLD][gold] Add -plugin-opt=no-new-pass-manager

-DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=on configured LLD and LLVMgold.so
will use the new pass manager by default. Add an option to
use the legacy pass manager. This will also be used by the Clang driver
when -fno-new-pass-manager (D92915) / -fno-experimental-new-pass-manager is set.

Reviewed By: aeubanks, tejohnson

Differential Revision: https://reviews.llvm.org/D92916
The file was modifiedlld/test/ELF/lto/new-pass-manager.ll
The file was modifiedlld/ELF/Options.td
The file was modifiedllvm/test/tools/gold/X86/new-pm.ll
The file was modifiedllvm/tools/gold/gold-plugin.cpp
Commit 7ea94922fa0d8ac6b041c0dc4cd9f8135f0e60bb by tpopp
[mlir] Allow RegionBranchOps in dependence analysis

This is to prevent assertion failures on scf.if and shape.assuming
operations where this is not enough information currently to handle any
aliasing information.

Differential Revision: https://reviews.llvm.org/D92963
The file was modifiedmlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp
Commit c8466a57310a0f10563e4a5a511e8c6386599cfe by rnk
Avoid a possible one-byte OOB read off of .drectve sections

Pointed out by Ryan Prichard
The file was modifiedlld/COFF/DriverUtils.cpp
Commit 5ff5cf8e057782e3e648ecf5ccf1d9990b53ee90 by craig.topper
[X86] Use APInt::isSignedIntN instead of isIntN for 64-bit ANDs in X86DAGToDAGISel::IsProfitableToFold

Pretty sure we meant to be checking signed 32 immediates here
rather than unsigned 32 bit. I suspect I messed this up because
in MathExtras.h we have isIntN and isUIntN so isIntN differs in
signedness depending on whether you're using APInt or plain integers.

This fixes a case where we didn't fold a constant created
by shrinkAndImmediate. Since shrinkAndImmediate doesn't topologically
sort constants it creates, we can fail to convert the Constant
to a TargetConstant. This leads to very strange behavior later.

Fixes PR48458.
The file was modifiedllvm/lib/Target/X86/X86ISelDAGToDAG.cpp
The file was addedllvm/test/CodeGen/X86/pr48458.ll
Commit 9260a999990cd8ee877e1cb9b517166579eca4f3 by scott.linder
[MC][AMDGPU] Consume EndOfStatement in asm parser

Avoids spurious newlines showing up in the output when emitting assembly
via MC.

Reviewed By: MaskRay, arsenm

Differential Revision: https://reviews.llvm.org/D92690
The file was addedllvm/test/MC/AMDGPU/round-trip.s
The file was modifiedllvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp