AbortedChanges

Summary

  1. [Remarks] Add unit tests for YAML serialization Add tests for both the string table and non string table case.
  2. clang-format: Fix namespace end comments for namespaces with attributes and macros. Fixes PR39247. While here, also make C++20 `namespace A::inline B::inline C` nested inline namespaced definitions work. Before: #define DEPRECATE_WOOF [[deprecated("meow")]] namespace DEPRECATE_WOOF woof { void f() {} } // namespace DEPRECATE_WOOFwoof namespace [[deprecated("meow")]] woof { void f() {} } // namespace [[deprecated("meow")]]woof namespace woof::inline bark { void f() {} } // namespace woof::inlinebark Now: #define DEPRECATE_WOOF [[deprecated("meow")]] namespace DEPRECATE_WOOF woof { void f() {} } // namespace woof namespace [[deprecated("meow")]] woof { void f() {} } // namespace woof namespace woof::inline bark { void f() {} } // namespace woof::inline bark (In addition to the fixed namespace end comments, also note the correct indent of the namespace contents.) Differential Revision: https://reviews.llvm.org/D65125
  3. [IndVars] Fix a subtle bug in optimizeLoopExits The original code failed to account for the fact that one exit can have a pointer exit count without all of them having pointer exit counts. This could cause two separate bugs: 1) We might exit the loop early, and leave optimizations undone. This is what triggered the assertion failure in the reported test case. 2) We might optimize one exit, then exit without indicating a change. This could result in an analysis invalidaton bug if no other transform is done by the rest of indvars. Note that the pointer exit counts are a really fragile concept. They show up only when we have a pointer IV w/o a datalayout to provide their size. It's really questionable to me whether the complexity implied is worth it.
  4. Improve clang-format-diff help output The description in clang-format-diff.py is more useful than the one in `clang-format-diff -h`, so use the same description in both places. Differential Revision: https://reviews.llvm.org/D64998
  5. [IR][Verifier] Allow IntToPtrInst to be !dereferenceable Summary: Allow IntToPtrInst to carry !dereferenceable metadata tag. This is valid since !dereferenceable can be only be applied to pointer type values. Change-Id: If8a6e3c616f073d51eaff52ab74535c29ed497b4 Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64954
  6. [RISCV][NFC] Correct RUN in rvi-pseudos-invalid.s This test should test both riscv32 and riscv64.
  7. [clang][NFCI] Fix random typos
  8. [compiler-rt][builtins] Provide __clear_cache for SPARC While working on https://reviews.llvm.org/D40900, two tests were failing since __clear_cache aborted. While libgcc's __clear_cache is just empty, this only happens because gcc (in gcc/config/sparc/sparc.c (sparc32_initialize_trampoline, sparc64_initialize_trampoline)) emits flush insns directly. The following patch mimics that. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D64496
  9. [CMake] Add -z defs on Solaris Like other ELF targets, shared objects should be linked with -z defs on Solaris. Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D64484
  10. [clang, test] Fix Clang :: Headers/max_align.c on 64-bit SPARC Clang :: Headers/max_align.c currently FAILs on 64-bit SPARC: error: 'error' diagnostics seen but not expected: File /vol/llvm/src/clang/dist/test/Headers/max_align.c Line 12: static_assert failed due to requirement '8 == _Alignof(max_align_t)' "" 1 error generated. This happens because SuitableAlign isn't defined for SPARCv9 unlike SPARCv8 (which uses the default of 64 bits). gcc's sparc/sparc.h has #define BIGGEST_ALIGNMENT (TARGET_ARCH64 ? 128 : 64) This patch sets SuitableAlign to match and updates the corresponding testcase. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D64487
  11. [GlobalISel][AArch64] Teach GISel to handle shifts in load addressing modes When we select the XRO variants of loads, we can pull in very specific shifts (of the size of an element). E.g. ``` ldr x1, [x2, x3, lsl #3] ``` This teaches GISel to handle these when they're coming from shifts specifically. This adds a new addressing mode function, `selectAddrModeShiftedExtendXReg` which recognizes this pattern. This also packs this up with `selectAddrModeRegisterOffset` into `selectAddrModeXRO`. This is intended to be equivalent to `selectAddrModeXRO` in AArch64ISelDAGtoDAG. Also update load-addressing-modes to show that all of the cases here work. Differential Revision: https://reviews.llvm.org/D65119
  12. [ASTImporter] Fix inequivalence of ClassTemplateInstantiations Summary: We falsely state inequivalence if the template parameter is a qualified/nonquialified template in the first/second instantiation. Also, different kinds of TemplateName should be equal if the template decl (if available) is equal (even if the name kind is different). Reviewers: a_sidorin, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64241
Revision 366832 by thegameg:
[Remarks] Add unit tests for YAML serialization

Add tests for both the string table and non string table case.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Remarks/RemarkStringTable.cpp (diff)llvm.src/lib/Remarks/RemarkStringTable.cpp
The file was modified/llvm/trunk/unittests/Remarks/CMakeLists.txt (diff)llvm.src/unittests/Remarks/CMakeLists.txt
The file was added/llvm/trunk/unittests/Remarks/YAMLRemarksSerializerTest.cppllvm.src/unittests/Remarks/YAMLRemarksSerializerTest.cpp
Revision 366831 by nico:
clang-format: Fix namespace end comments for namespaces with attributes and macros.

Fixes PR39247.

While here, also make C++20 `namespace A::inline B::inline C` nested
inline namespaced definitions work.

Before:
    #define DEPRECATE_WOOF [[deprecated("meow")]]

    namespace DEPRECATE_WOOF woof {
    void f() {}
    } // namespace DEPRECATE_WOOFwoof

    namespace [[deprecated("meow")]] woof {
      void f() {}
    } // namespace [[deprecated("meow")]]woof

    namespace woof::inline bark {
      void f() {}
    } // namespace woof::inlinebark

Now:
    #define DEPRECATE_WOOF [[deprecated("meow")]]

    namespace DEPRECATE_WOOF woof {
    void f() {}
    } // namespace woof

    namespace [[deprecated("meow")]] woof {
    void f() {}
    } // namespace woof

    namespace woof::inline bark {
    void f() {}
    } // namespace woof::inline bark

(In addition to the fixed namespace end comments, also note the correct
indent of the namespace contents.)

Differential Revision: https://reviews.llvm.org/D65125
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Format/NamespaceEndCommentsFixer.cpp (diff)clang.src/lib/Format/NamespaceEndCommentsFixer.cpp
The file was modified/cfe/trunk/lib/Format/UnwrappedLineParser.cpp (diff)clang.src/lib/Format/UnwrappedLineParser.cpp
The file was modified/cfe/trunk/unittests/Format/FormatTest.cpp (diff)clang.src/unittests/Format/FormatTest.cpp
The file was modified/cfe/trunk/unittests/Format/NamespaceEndCommentsFixerTest.cpp (diff)clang.src/unittests/Format/NamespaceEndCommentsFixerTest.cpp
Revision 366829 by reames:
[IndVars] Fix a subtle bug in optimizeLoopExits

The original code failed to account for the fact that one exit can have a pointer exit count without all of them having pointer exit counts.  This could cause two separate bugs:
1) We might exit the loop early, and leave optimizations undone.  This is what triggered the assertion failure in the reported test case.
2) We might optimize one exit, then exit without indicating a change.  This could result in an analysis invalidaton bug if no other transform is done by the rest of indvars.

Note that the pointer exit counts are a really fragile concept.  They show up only when we have a pointer IV w/o a datalayout to provide their size.  It's really questionable to me whether the complexity implied is worth it.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (diff)llvm.src/lib/Transforms/Scalar/IndVarSimplify.cpp
The file was added/llvm/trunk/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.llllvm.src/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.ll
Revision 366828 by nico:
Improve clang-format-diff help output

The description in clang-format-diff.py is more useful than the one
in `clang-format-diff -h`, so use the same description in both places.

Differential Revision: https://reviews.llvm.org/D64998
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/tools/clang-format/clang-format-diff.py (diff)clang.src/tools/clang-format/clang-format-diff.py
Revision 366826 by rtayl:
[IR][Verifier] Allow IntToPtrInst to be !dereferenceable

Summary:
Allow IntToPtrInst to carry !dereferenceable metadata tag.
This is valid since !dereferenceable can be only be applied to
pointer type values.

Change-Id: If8a6e3c616f073d51eaff52ab74535c29ed497b4

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64954
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/docs/LangRef.rst (diff)llvm.src/docs/LangRef.rst
The file was modified/llvm/trunk/lib/IR/Value.cpp (diff)llvm.src/lib/IR/Value.cpp
The file was modified/llvm/trunk/lib/IR/Verifier.cpp (diff)llvm.src/lib/IR/Verifier.cpp
The file was modified/llvm/trunk/test/Analysis/ValueTracking/memory-dereferenceable.ll (diff)llvm.src/test/Analysis/ValueTracking/memory-dereferenceable.ll
The file was added/llvm/trunk/test/Verifier/dereferenceable-md-inttoptr.llllvm.src/test/Verifier/dereferenceable-md-inttoptr.ll
The file was modified/llvm/trunk/test/Verifier/dereferenceable-md.ll (diff)llvm.src/test/Verifier/dereferenceable-md.ll
Revision 366825 by lenary:
[RISCV][NFC] Correct RUN in rvi-pseudos-invalid.s

This test should test both riscv32 and riscv64.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/test/MC/RISCV/rvi-pseudos-invalid.s (diff)llvm.src/test/MC/RISCV/rvi-pseudos-invalid.s
Revision 366823 by Jan Korous:
[clang][NFCI] Fix random typos
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h (diff)clang.src/include/clang/ASTMatchers/ASTMatchersInternal.h
The file was modified/cfe/trunk/lib/Index/IndexSymbol.cpp (diff)clang.src/lib/Index/IndexSymbol.cpp
The file was modified/cfe/trunk/lib/Sema/SemaExprCXX.cpp (diff)clang.src/lib/Sema/SemaExprCXX.cpp
Revision 366822 by ro:
[compiler-rt][builtins] Provide __clear_cache for SPARC

While working on https://reviews.llvm.org/D40900, two tests were failing since __clear_cache
aborted.  While libgcc's __clear_cache is just empty, this only happens because
gcc (in gcc/config/sparc/sparc.c (sparc32_initialize_trampoline, sparc64_initialize_trampoline))
emits flush insns directly.

The following patch mimics that.

Tested on sparcv9-sun-solaris2.11.

Differential Revision: https://reviews.llvm.org/D64496
Change TypePath in RepositoryPath in Workspace
The file was modified/compiler-rt/trunk/lib/builtins/clear_cache.c (diff)compiler-rt.src/lib/builtins/clear_cache.c
Revision 366821 by ro:
[CMake] Add -z defs on Solaris

Like other ELF targets, shared objects should be linked with -z defs on Solaris.

Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.

Differential Revision: https://reviews.llvm.org/D64484
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (diff)llvm.src/cmake/modules/HandleLLVMOptions.cmake
Revision 366820 by ro:
[clang, test] Fix Clang :: Headers/max_align.c on 64-bit SPARC

Clang :: Headers/max_align.c currently FAILs on 64-bit SPARC:

  error: 'error' diagnostics seen but not expected:
    File /vol/llvm/src/clang/dist/test/Headers/max_align.c Line 12: static_assert failed due to requirement '8 == _Alignof(max_align_t)' ""
  1 error generated.

This happens because SuitableAlign isn't defined for SPARCv9 unlike SPARCv8
(which uses the default of 64 bits).  gcc's sparc/sparc.h has

  #define BIGGEST_ALIGNMENT (TARGET_ARCH64 ? 128 : 64)

This patch sets SuitableAlign to match and updates the corresponding testcase.

Tested on sparcv9-sun-solaris2.11.

Differential Revision: https://reviews.llvm.org/D64487
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Basic/Targets/Sparc.h (diff)clang.src/lib/Basic/Targets/Sparc.h
The file was modified/cfe/trunk/test/Preprocessor/init.c (diff)clang.src/test/Preprocessor/init.c
Revision 366819 by paquette:
[GlobalISel][AArch64] Teach GISel to handle shifts in load addressing modes

When we select the XRO variants of loads, we can pull in very specific shifts
(of the size of an element). E.g.

```
ldr x1, [x2, x3, lsl #3]
```

This teaches GISel to handle these when they're coming from shifts
specifically.

This adds a new addressing mode function, `selectAddrModeShiftedExtendXReg`
which recognizes this pattern.

This also packs this up with `selectAddrModeRegisterOffset` into
`selectAddrModeXRO`. This is intended to be equivalent to `selectAddrModeXRO`
in AArch64ISelDAGtoDAG.

Also update load-addressing-modes to show that all of the cases here work.

Differential Revision: https://reviews.llvm.org/D65119
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp (diff)llvm.src/lib/Target/AArch64/AArch64InstructionSelector.cpp
The file was modified/llvm/trunk/test/CodeGen/AArch64/GlobalISel/load-addressing-modes.mir (diff)llvm.src/test/CodeGen/AArch64/GlobalISel/load-addressing-modes.mir
Revision 366818 by martong:
[ASTImporter] Fix inequivalence of ClassTemplateInstantiations

Summary:
We falsely state inequivalence if the template parameter is a
qualified/nonquialified template in the first/second instantiation.
Also, different kinds of TemplateName should be equal if the template
decl (if available) is equal (even if the name kind is different).

Reviewers: a_sidorin, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64241
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/AST/ASTStructuralEquivalence.cpp (diff)clang.src/lib/AST/ASTStructuralEquivalence.cpp
The file was modified/cfe/trunk/unittests/AST/StructuralEquivalenceTest.cpp (diff)clang.src/unittests/AST/StructuralEquivalenceTest.cpp