SuccessChanges

Summary

  1. [ARM][CostModel] CodeSize costs for i1 arith ops (details)
  2. [GlobalISel] Extend not_cmp_fold to work on conditional expressions (details)
  3. [SimplifyCFG] Consider cost of combining predicates. (details)
  4. [clang-format] Allow configuring list of macros that map to attributes (details)
  5. [clang-format] Handle typename macros inside cast expressions (details)
  6. [clang-format] Check that */& after typename macros are pointers/references (details)
  7. [clang-format] Fix formatting of _Atomic() qualifier (details)
  8. [clang-format] Parse __underlying_type(T) as a type (details)
  9. [clang-format] Correctly parse function declarations with TypenameMacros (details)
  10. [OpenMP][AMDGPU] Use DS_Max_Warp_Number instead of WARPSIZE (details)
  11. [mlir][Vector] Revisit VectorToSCF. (details)
  12. Extract infrastructure to ignore intermediate expressions into `clang/AST/IgnoreExpr.h` (details)
  13. [Ignore Expressions][NFC] Refactor to better use `IgnoreExpr.h` and nits (details)
  14. [X86] Use Register instead of unsigned. NFCI. (details)
  15. [X86] Use Register instead of unsigned. NFCI. (details)
  16. [NFC][PowerPC] Add tests for `mul` with big constants. (details)
  17. [X86] Use Register instead of unsigned. NFCI. (details)
  18. [X86][AVX] Add extra vperm2f128+vpermilvar combine coverage (details)
  19. [X86] getFauxShuffleMask - handle insert_subvector(zero, sub, C) (details)
  20. [X86] Unbreak the build after 22fa6b20d92e (details)
  21. [gn build] Port 81aa66f65f5 (details)
  22. [clang] Prevent that Decl::dump on a CXXRecordDecl deserialises further declarations. (details)
  23. [gn build] Port 0478720157f (details)
Commit 0af4147804aa0aa906a2ac913fe5639639afb9bb by sam.parker
[ARM][CostModel] CodeSize costs for i1 arith ops

When optimising for size, make the cost of i1 logical operations
relatively expensive so that optimisations don't try to combine
predicates.

Differential Revision: https://reviews.llvm.org/D86525
The file was modifiedllvm/test/Analysis/CostModel/ARM/arith.ll
The file was modifiedllvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
Commit 713c2ad60c137a88c0a64cc98f2db4be702a25e9 by jay.foad
[GlobalISel] Extend not_cmp_fold to work on conditional expressions

Differential Revision: https://reviews.llvm.org/D86709
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-invert-cmp.mir
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Commit 65f78e73ad574bb73bb625c787850acd261ba53a by sam.parker
[SimplifyCFG] Consider cost of combining predicates.

Modify FoldBranchToCommonDest to consider the cost of inserting
instructions when attempting to combine predicates to fold blocks.
The threshold can be controlled via a new option:
-simplifycfg-branch-fold-threshold which defaults to '2' to allow
the insertion of a not and another logical operator.

Differential Revision: https://reviews.llvm.org/D86526
The file was modifiedllvm/test/Transforms/SimplifyCFG/ARM/branch-fold-threshold.ll
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
The file was modifiedllvm/include/llvm/Transforms/Utils/Local.h
Commit e7bd058c7e2cb2c675a4b78ec770ea725bff8c64 by Alexander.Richardson
[clang-format] Allow configuring list of macros that map to attributes

This adds a `AttributeMacros` configuration option that causes certain
identifiers to be parsed like a __attribute__((foo)) annotation.
This is motivated by our CHERI C/C++ fork which adds a __capability
qualifier for pointer/reference. Without this change clang-format parses
many type declarations as multiplications/bitwise-and instead.
I initially considered adding "__capability" as a new clang-format keyword,
but having a list of macros that should be treated as attributes is more
flexible since it can be used e.g. for static analyzer annotations or other language
extensions.

Example: std::vector<foo * __capability> -> std::vector<foo *__capability>

Depends on D86775 (to apply cleanly)

Reviewed By: MyDeveloperDay, jrtc27

Differential Revision: https://reviews.llvm.org/D86782
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/include/clang/Format/Format.h
The file was modifiedclang/lib/Format/FormatTokenLexer.cpp
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
The file was modifiedclang/lib/Format/FormatToken.h
The file was modifiedclang/lib/Format/Format.cpp
The file was modifiedclang/docs/ClangFormatStyleOptions.rst
Commit 8aa3b8da5db2ae73bf536b630915eb9f0ddc15cb by Alexander.Richardson
[clang-format] Handle typename macros inside cast expressions

Before: x = (STACK_OF(uint64_t)) & a;
After:  x = (STACK_OF(uint64_t))&a;

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D86930
The file was modifiedclang/lib/Format/FormatToken.h
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
Commit cd01eec14bc045a8616604cadf94dba025090ba5 by Alexander.Richardson
[clang-format] Check that */& after typename macros are pointers/references

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D86950
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit 56fa7d1dc6a8d23111ff84171036f333cf9cddf2 by Alexander.Richardson
[clang-format] Fix formatting of _Atomic() qualifier

Before: _Atomic(uint64_t) * a;
After: _Atomic(uint64_t) *a;

This treats _Atomic the same as the the TypenameMacros and decltype. It
also allows some cleanup by removing checks whether the token before a
paren is kw_decltype and instead checking for TT_TypeDeclarationParen.
While touching this code also extend the decltype test cases to also check
for typeof() and _Atomic(T).

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D86959
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/lib/Format/FormatToken.h
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
The file was modifiedclang/lib/Format/FormatToken.cpp
Commit 9a22eba15091ea849fa78c09ac4c9f7260071790 by Alexander.Richardson
[clang-format] Parse __underlying_type(T) as a type

Before: MACRO(__underlying_type(A) * a);
After:  MACRO(__underlying_type(A) *a);

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D86960
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
The file was modifiedclang/lib/Format/FormatToken.h
Commit 05147d33091720e2df929d6fea3b0fd2a657ac61 by Alexander.Richardson
[clang-format] Correctly parse function declarations with TypenameMacros

When using the always break after return type setting:
Before:
SomeType funcdecl(LIST(uint64_t));
After:
SomeType
funcdecl(LIST(uint64_t));"

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D87007
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit 7634c64b6121ba61a6c72c6b45e3561ad8cf345e by Pushpinder.Singh
[OpenMP][AMDGPU] Use DS_Max_Warp_Number instead of WARPSIZE

The size of worker_rootS should have been DS_Max_Warp_Number.
This reduces memory usage by deviceRTL on AMDGPU from around 2.3GB
to around 770MB.

Reviewed By: JonChesterfield, jdoerfert

Differential Revision: https://reviews.llvm.org/D87084
The file was modifiedopenmp/libomptarget/deviceRTLs/common/src/data_sharing.cu
The file was modifiedopenmp/libomptarget/deviceRTLs/common/omptarget.h
Commit 8d64df9f139038b48344dd9f1f20a38b22aba8c9 by ntv
[mlir][Vector] Revisit VectorToSCF.

Vector to SCF conversion still had issues due to the interaction with the natural alignment derived by the LLVM data layout. One traditional workaround is to allocate aligned. However, this does not always work for vector sizes that are non-powers of 2.

This revision implements a more portable mechanism where the intermediate allocation is always a memref of elemental vector type. AllocOp is extended to use the natural LLVM DataLayout alignment for non-scalar types, when the alignment is not specified in the first place.

An integration test is added that exercises the transfer to scf.for + scalar lowering with a 5x5 transposition.

Differential Revision: https://reviews.llvm.org/D87150
The file was modifiedmlir/include/mlir/Dialect/Vector/VectorOps.td
The file was addedmlir/integration_test/Dialect/Vector/CPU/test-transfer-to-loops.mlir
The file was modifiedmlir/test/EDSC/builder-api-test.cpp
The file was modifiedmlir/include/mlir/Dialect/Vector/EDSC/Intrinsics.h
The file was modifiedmlir/lib/Dialect/Vector/VectorOps.cpp
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir
The file was modifiedmlir/test/Conversion/VectorToSCF/vector-to-loops.mlir
The file was modifiedmlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
The file was modifiedmlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
Commit 81aa66f65f504af18982baa078a5f3f7d2aa88fa by ecaldas
Extract infrastructure to ignore intermediate expressions into `clang/AST/IgnoreExpr.h`

Rationale:
This allows users to use `IgnoreExprNodes` and `Ignore*SingleStep` outside of
`clang/AST/Expr.cpp`.

Minor:
Rename `IgnoreImp...SingleStep`  into `IgnoreImplicit...SingleStep`.

Differential Revision: https://reviews.llvm.org/D86778
The file was modifiedclang/lib/AST/CMakeLists.txt
The file was modifiedclang/lib/AST/Expr.cpp
The file was addedclang/include/clang/AST/IgnoreExpr.h
The file was addedclang/lib/AST/IgnoreExpr.cpp
Commit 1a7a2cd7474e6d321120ffe7ca9c52163eb228f0 by ecaldas
[Ignore Expressions][NFC] Refactor to better use `IgnoreExpr.h` and nits

This change groups
* Rename: `ignoreParenBaseCasts` -> `IgnoreParenBaseCasts` for uniformity
* Rename: `IgnoreConversionOperator` -> `IgnoreConversionOperatorSingleStep` for uniformity
* Inline `IgnoreNoopCastsSingleStep` into a lambda inside `IgnoreNoopCasts`
* Refactor `IgnoreUnlessSpelledInSource` to make adequate use of `IgnoreExprNodes`

Differential Revision: https://reviews.llvm.org/D86880
The file was modifiedclang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
The file was modifiedclang/lib/AST/Expr.cpp
The file was modifiedclang/lib/CodeGen/CGExprCXX.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/CallEvent.cpp
The file was modifiedclang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
The file was modifiedclang/include/clang/AST/Expr.h
The file was modifiedclang/lib/Sema/SemaExpr.cpp
Commit 0dbe2504af81fc8ac7438d490b98370740442805 by llvm-dev
[X86] Use Register instead of unsigned. NFCI.

Fixes llvm-prefer-register-over-unsigned clang-tidy warning.
The file was modifiedllvm/lib/Target/X86/X86AsmPrinter.cpp
Commit 22fa6b20d92efe796ad881aafe6e689960fe6e7d by llvm-dev
[X86] Use Register instead of unsigned. NFCI.

Fixes llvm-prefer-register-over-unsigned clang-tidy warnings.
The file was modifiedllvm/lib/Target/X86/X86FrameLowering.cpp
Commit ee68b66d94b50d8c9ff14d3217a77c66b0e2c32f by esme.yi
[NFC][PowerPC] Add tests for `mul` with big constants.
The file was addedllvm/test/CodeGen/PowerPC/mulli.ll
Commit 9ad261540da6e66a666e48fed95455bc27fa995b by llvm-dev
[X86] Use Register instead of unsigned. NFCI.

Fixes llvm-prefer-register-over-unsigned clang-tidy warnings.
The file was modifiedllvm/lib/Target/X86/X86InstrInfo.cpp
Commit aa3fcb967110f2d448d241358cadc048954e6134 by llvm-dev
[X86][AVX] Add extra vperm2f128+vpermilvar combine coverage

The existing test /should/ reduce to a vmovaps (concat xmm with zero upper).
The file was modifiedllvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll
Commit 71dfdbe2c73afcc319bfd96c9e73407ea9245e3a by llvm-dev
[X86] getFauxShuffleMask - handle insert_subvector(zero, sub, C)

Directly use SM_SentinelZero elements if we're (widening)inserting into a zero vector.
The file was modifiedllvm/test/CodeGen/X86/vector-shuffle-combining-avx.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 7ba0f81934ca5f4baa1d81ac0032f2e4ff6614ec by benny.kra
[X86] Unbreak the build after 22fa6b20d92e
The file was modifiedllvm/lib/Target/X86/X86FrameLowering.cpp
Commit 56d1f3138b532f4e195a5aaba9ea65a8bcb8adb4 by llvmgnsyncbot
[gn build] Port 81aa66f65f5
The file was modifiedllvm/utils/gn/secondary/clang/lib/AST/BUILD.gn
Commit 0478720157f6413fad7595b8eff9c70d2d99b637 by Raphael Isemann
[clang] Prevent that Decl::dump on a CXXRecordDecl deserialises further declarations.

Decl::dump is primarily used for debugging to visualise the current state of a
declaration. Usually Decl::dump just displays the current state of the Decl and
doesn't actually change any of its state, however since commit
457226e02a6e8533eaaa864a3fd7c8eeccd2bf58 the method actually started loading
additional declarations from the ExternalASTSource. This causes that calling
Decl::dump during a debugging session now actually does permanent changes to the
AST and will cause the debugged program run to deviate from the original run.

The change that caused this behaviour is the addition of
`hasConstexprDestructor` (which is called from the TextNodeDumper) which
performs a lookup into the current CXXRecordDecl to find the destructor. All
other similar methods just return their respective bit in the DefinitionData
(which obviously doesn't have such side effects).

This just changes the node printer to emit "unknown_constexpr" in case a
CXXRecordDecl is dumped that could potentially call into the ExternalASTSource
instead of the usually empty string/"constexpr". For CXXRecordDecls that can
safely be dumped the old behaviour is preserved

Reviewed By: bruno

Differential Revision: https://reviews.llvm.org/D80878
The file was addedclang/unittests/AST/ASTDumpTest.cpp
The file was modifiedclang/lib/AST/TextNodeDumper.cpp
The file was modifiedclang/test/AST/ast-dump-records.cpp
The file was modifiedclang/test/AST/ast-dump-lambda.cpp
The file was modifiedclang/unittests/AST/CMakeLists.txt
Commit 9764eb9212c598f165e9d7dfeb273b74f7777a41 by llvmgnsyncbot
[gn build] Port 0478720157f
The file was modifiedllvm/utils/gn/secondary/clang/unittests/AST/BUILD.gn