SuccessChanges

Summary

  1. [PowerPC] Allow wa inline asm to also accept floating point arguments (details)
  2. [mlir] Provide minimal Python bindings for the math dialect (details)
  3. precommit tests for D104042 (details)
  4. [Test] One more elaborate test with selects for loop deletion (details)
  5. [clangd] don't rename if the triggering loc is not actually being renamed. (details)
  6. [VP][NFC] Format comment to 80 columns (details)
  7. [ADT] Remove APInt/APSInt toString() std::string variants (details)
  8. [AST] Include the TranslationUnitDecl when traversing with TraversalScope (details)
  9. APInt.h - add missing <utility> header. (details)
  10. [lldb] DumpDataExtractor.cpp - replace APInt::toString() with llvm::toString(APInt) (details)
  11. [Polly][Isl] Removing explicit operator bool() from isl C++ bindings. NFC. (details)
  12. [mlir][[linalg] Remove deprecated structured op interface methods. (details)
  13. Revert "[lldb] Add support for evaluating expressions in static member functions" (details)
  14. [mlir][linalg] Prepare drop unit dims for scalar operands. (details)
  15. Fix Wdocumentation missing parameter warnings. NFCI. (details)
  16. StringExtrasTest.cpp - add missing newline at the end of file. NFCI. (details)
  17. [SimplifyCFG] avoid crash on degenerate loop (details)
  18. Fix extraneous ')' error. (details)
  19. [mlir][linalg] Prepare pad to static bounding box for scalar operands. (details)
  20. Fix for error "'Run' overrides a member function but is not marked (details)
  21. Referencing a static function defined in an opnemp clause, is (details)
  22. Move Function Specialization to its correct location. NFC. (details)
  23. [gn build] Port 9907746f5db7 (details)
  24. [lldb] Unmark TestInlines as XFAIL for gcc (details)
  25. [lldb] Fix compilation after removal of APInt::toString (details)
  26. [lldb] Remove GCC XFAIL for TestTypedefArray (details)
Commit c1bb75febe9d1176748f524324b5528347342166 by zarko
[PowerPC] Allow wa inline asm to also accept floating point arguments

GCC documentation for the `wa` constraint states that:
```
wa

    A VSX register (VSR), vs0…vs63. This is either an FPR (vs0…vs31 are f0…f31)
    or a VR (vs32…vs63 are v0…v31).
```
This technically means that we could accept floating point parameters. In fact,
gcc itself does. The following testcase compiles and runs on all PPC platforms with GCC,
whereas clang/llc will assert:
```
#include <stdio.h>
double foo ( vector double a ) {
  double b, c;
  asm("xvabsdp  %x0, %x2        \n"
             "xxsldwi  %x1, %x0, %x0, 2 \n"
      :  "+wa"    (b),
         "=wa"    (c)
      :  "wa"    (a)
      );
  return b+c;
}
int main(void) {
  vector double a = {-3., -4.};
  double t = foo( a );
  printf("%g\n", t);
}
```
This patch allows clang/llc to build and run this testcase.

Reviewed By: nemanjai, #powerpc

Differential Revision: https://reviews.llvm.org/D103409
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
The file was addedllvm/test/CodeGen/PowerPC/wa-asm-fpr.ll
Commit ad381e39a52604ba07e1e027e7bdec1c287d9089 by zinenko
[mlir] Provide minimal Python bindings for the math dialect

Reviewed By: ulysseB

Differential Revision: https://reviews.llvm.org/D104045
The file was modifiedmlir/python/mlir/dialects/CMakeLists.txt
The file was addedmlir/test/python/dialects/math.py
The file was addedmlir/python/mlir/dialects/math.py
The file was addedmlir/python/mlir/dialects/MathOps.td
Commit 9eedde705fab24200be47b2769a3cd12d24bb230 by jingu.kang
precommit tests for D104042
The file was addedllvm/test/CodeGen/AArch64/neon-sad.ll
Commit 8840c94a338097d8e5ac4556256040baf23b0526 by mkazantsev
[Test] One more elaborate test with selects for loop deletion
The file was modifiedllvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
Commit d30c202d276db86d741734954d1957e7dbbf123c by hokein.wu
[clangd] don't rename if the triggering loc is not actually being renamed.

See context: https://github.com/clangd/clangd/issues/765

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D101816
The file was modifiedclang-tools-extra/clangd/refactor/Rename.cpp
The file was modifiedclang-tools-extra/clangd/unittests/RenameTests.cpp
Commit 71a02ddda10583b7f51611e8aefcbecc47352683 by fraser
[VP][NFC] Format comment to 80 columns
The file was modifiedllvm/include/llvm/IR/VPIntrinsics.def
Commit 61cdaf66fe22be2b5942ddee4f46a998b4f3ee29 by llvm-dev
[ADT] Remove APInt/APSInt toString() std::string variants

<string> is currently the highest impact header in a clang+llvm build:

https://commondatastorage.googleapis.com/chromium-browser-clang/llvm-include-analysis.html

One of the most common places this is being included is the APInt.h header, which needs it for an old toString() implementation that returns std::string - an inefficient method compared to the SmallString versions that it actually wraps.

This patch replaces these APInt/APSInt methods with a pair of llvm::toString() helpers inside StringExtras.h, adjusts users accordingly and removes the <string> from APInt.h - I was hoping that more of these users could be converted to use the SmallString methods, but it appears that most end up creating a std::string anyhow. I avoided trying to use the raw_ostream << operators as well as I didn't want to lose having the integer radix explicit in the code.

Differential Revision: https://reviews.llvm.org/D103888
The file was modifiedclang/lib/Lex/PPExpressions.cpp
The file was modifiedclang/lib/Sema/SemaInit.cpp
The file was modifiedclang/lib/Sema/SemaDeclCXX.cpp
The file was modifiedllvm/unittests/ADT/StringExtrasTest.cpp
The file was modifiedllvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
The file was modifiedclang/lib/Sema/SemaType.cpp
The file was modifiedclang/lib/Sema/SemaStmtAsm.cpp
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
The file was modifiedllvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang-tools-extra/clangd/Hover.cpp
The file was modifiedclang/lib/AST/ASTStructuralEquivalence.cpp
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was modifiedclang/lib/Sema/SemaCast.cpp
The file was modifiedclang/unittests/StaticAnalyzer/RangeSetTest.cpp
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/lib/AST/StmtPrinter.cpp
The file was modifiedclang/lib/AST/ASTDiagnostic.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/lib/AST/ExprConstant.cpp
The file was modifiedclang/lib/Sema/SemaChecking.cpp
The file was modifiedclang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksCommon.h
The file was modifiedclang/lib/AST/TemplateBase.cpp
The file was modifiedclang/lib/Sema/SemaConcept.cpp
The file was modifiedclang-tools-extra/clangd/DumpAST.cpp
The file was modifiedllvm/tools/llvm-pdbutil/MinimalTypeDumper.cpp
The file was modifiedclang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
The file was modifiedclang/unittests/Tooling/RecursiveASTVisitorTestPostOrderVisitor.cpp
The file was modifiedllvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
The file was modifiedllvm/include/llvm/ADT/APInt.h
The file was modifiedclang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedllvm/lib/Support/APInt.cpp
The file was modifiedllvm/include/llvm/ADT/APSInt.h
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/lib/Analysis/ThreadSafetyCommon.cpp
The file was modifiedclang/lib/Sema/SemaTemplate.cpp
The file was modifiedllvm/include/llvm/ADT/StringExtras.h
The file was modifiedclang/lib/Sema/SemaStmt.cpp
The file was modifiedclang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
The file was modifiedclang/lib/AST/TextNodeDumper.cpp
The file was modifiedllvm/unittests/ADT/APIntTest.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp
The file was modifiedllvm/lib/Target/X86/X86MCInstLower.cpp
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchers.h
The file was modifiedclang/lib/Frontend/InitPreprocessor.cpp
Commit 6aca6032c5b62b5d26999da5f55779a1b08ec6a2 by sam.mccall
[AST] Include the TranslationUnitDecl when traversing with TraversalScope

Given `int foo, bar;`, TraverseAST reveals this tree:
  TranslationUnitDecl
   - foo
   - bar

Before this patch, with the TraversalScope set to {foo}, TraverseAST yields:
  foo

After this patch it yields:
  TranslationUnitDecl
  - foo

Also, TraverseDecl(TranslationUnitDecl) now respects the traversal scope.

---

The main effect of this today is that clang-tidy checks that match the
translationUnitDecl(), either in order to traverse it or check
parentage, should work.

Differential Revision: https://reviews.llvm.org/D104071
The file was modifiedclang/unittests/Tooling/RecursiveASTVisitorTests/TraversalScope.cpp
The file was modifiedclang/include/clang/AST/RecursiveASTVisitor.h
The file was modifiedclang-tools-extra/clangd/DumpAST.cpp
The file was modifiedclang-tools-extra/clangd/unittests/TestTU.cpp
The file was modifiedclang/include/clang/AST/ASTContext.h
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
The file was modifiedclang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
The file was modifiedclang/unittests/AST/ASTContextParentMapTest.cpp
Commit 0fc4016d913d3ca2f490b1f1b132798ec0a13e00 by llvm-dev
APInt.h - add missing <utility> header.

Some buildbots are complaining about std::move() after rG61cdaf66fe22be2b5942ddee4f46a998b4f3ee29
The file was modifiedllvm/include/llvm/ADT/APInt.h
Commit cd2e500e555e134ffc19d07f26b17d0b0c71efd9 by llvm-dev
[lldb] DumpDataExtractor.cpp - replace APInt::toString() with llvm::toString(APInt)

APInt::toString() was removed rG61cdaf66fe22be2b5942ddee4f46a998b4f3ee29
The file was modifiedlldb/source/Core/DumpDataExtractor.cpp
Commit 7c7978a122fdd6eb1bc6300b3a2582108f13ff89 by patacca
[Polly][Isl] Removing explicit operator bool() from isl C++ bindings. NFC.

This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
- Removing explicit operator bool() from all the classes in the isl C++ bindings.
- Replace each call to operator bool() to method `is_null()`.
- isl-noexceptions.h has been generated by this https://github.com/patacca/isl/commit/27396daac5a5ee8228d25511a12f4a814c92ba8f

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D103976
The file was modifiedpolly/lib/CodeGen/PPCGCodeGeneration.cpp
The file was modifiedpolly/lib/Exchange/JSONExporter.cpp
The file was modifiedpolly/include/polly/ScopInfo.h
The file was modifiedpolly/lib/Support/ISLTools.cpp
The file was modifiedpolly/lib/Transform/ScheduleOptimizer.cpp
The file was modifiedpolly/lib/Transform/MatmulOptimizer.cpp
The file was modifiedpolly/lib/Transform/ZoneAlgo.cpp
The file was modifiedpolly/lib/Analysis/ScopBuilder.cpp
The file was modifiedpolly/lib/Transform/DeLICM.cpp
The file was modifiedpolly/lib/External/isl/include/isl/isl-noexceptions.h
The file was modifiedpolly/lib/Support/SCEVAffinator.cpp
The file was modifiedpolly/lib/Analysis/DependenceInfo.cpp
The file was modifiedpolly/unittests/DeLICM/DeLICMTest.cpp
The file was modifiedpolly/lib/Transform/ScheduleTreeTransform.cpp
The file was modifiedpolly/lib/CodeGen/IslAst.cpp
The file was modifiedpolly/lib/Analysis/ScopInfo.cpp
The file was modifiedpolly/lib/Transform/ManualOptimizer.cpp
The file was modifiedpolly/lib/Transform/FlattenAlgo.cpp
The file was modifiedpolly/lib/Transform/ForwardOpTree.cpp
Commit 6b4b98d98c94256aaaa8d3d69e3ed0e43b732e2b by gysit
[mlir][[linalg] Remove deprecated structured op interface methods.

Cleanup the refactoring started by https://reviews.llvm.org/D103394.

Differential Revision: https://reviews.llvm.org/D104025
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
Commit 4125b46232caf6a558470670f87b56ccb46d61aa by Raphael Isemann
Revert "[lldb] Add support for evaluating expressions in static member functions"

This reverts commit 00764c36edf88ae9806e8d57a6addb782e6ceae8 and the
follow up d2223c7a49973a61cc2de62992662afa8d19065a.

The original patch broke that one could use static member variables while
inside a static member functions without having a running target. It seems that
LLDB currently requires that static variables are only found via the global
variable lookup so that they can get materialized and mapped to the argument
struct of the expression.

After 00764c36edf88ae9806e8d57a6addb782e6ceae8 static variables of the current
class could be found via Clang's lookup which LLDB isn't observing. This
resulting in expressions actually containing these variables as normal
globals that can't be rewritten to a member of the argument struct.

More specifically, in the test TestCPPThis, the expression
`expr --j false -- s_a` is now only passing if we have a runnable target.

I'll revert the patch as the possible fixes aren't trivial and it degrades
the debugging experience more than the issue that the revert patch addressed.

The underlying bug can be reproduced before/after this patch by stopping
in `TestCPPThis` main function and running: `e -j false -- my_a; A<int>::s_a`.
The `my_a` will pull in the `A<int>` class and the second expression will
be resolved by Clang on its own (which causes LLDB to not materialize the
static variable).

Note: A workaround is to just do `::s_a` which will force LLDB to take the global
variable lookup.
The file was removedlldb/test/API/lang/cpp/stopped_in_static_member_function/TestStoppedInStaticMemberFunction.py
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
The file was removedlldb/test/API/lang/cpp/stopped_in_static_member_function/main.cpp
The file was removedlldb/test/API/lang/cpp/stopped_in_static_member_function/Makefile
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
Commit f6b4e081dc9cf74fb5c22439f552fa035f2c2651 by gysit
[mlir][linalg] Prepare drop unit dims for scalar operands.

Adapt drop unit dims for structured ops taking scalar operands.

Differential Revision: https://reviews.llvm.org/D103890
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
Commit f7bc9db95aba77157f10b627a4dea32c3174e148 by llvm-dev
Fix Wdocumentation missing parameter warnings. NFCI.
The file was modifiedclang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
Commit 4295c222a8f12f0d97a7c03f884c5d3f7c93aaa0 by llvm-dev
StringExtrasTest.cpp - add missing newline at the end of file. NFCI.
The file was modifiedllvm/unittests/ADT/StringExtrasTest.cpp
Commit 602ab248335e1540e82667e74fea44b7f042e112 by spatel
[SimplifyCFG] avoid crash on degenerate loop

The problematic code pattern in the test is based on:
https://llvm.org/PR50638

If the IfCond is itself the phi that we are trying to remove,
then the loop around line 2835 can end up with something like:
%cmp = select i1 %cmp, i1 false, i1 true

That can then lead to a use-after-free and assert (although
I'm still not seeing that locally in my release + asserts build).

I think this can only happen with unreachable code.

Differential Revision: https://reviews.llvm.org/D104063
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
The file was modifiedllvm/test/Transforms/SimplifyCFG/two-entry-phi-return.ll
Commit 307cfad0d639b0397033069473e84e6c7f249056 by llvm-dev
Fix extraneous ')' error.
The file was modifiedlldb/source/Core/DumpDataExtractor.cpp
Commit d2661c6c51756686c1f6be6981ee4ad527cba3d8 by gysit
[mlir][linalg] Prepare pad to static bounding box for scalar operands.

Adapt pad to static bounding box to support structured ops taking scalar operands.

Differential Revision: https://reviews.llvm.org/D103891
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
Commit 7b444a66b33ca7ec9cc7b9737205805e9d8106a2 by zahira.ammarguellat
Fix for error "'Run' overrides a member function but is not marked
'override' [-Werror,-Wsuggest-override]" occuring during windows
debug self-build.
The file was modifiedllvm/lib/Testing/Support/CMakeLists.txt
Commit 150f7cedfb2e072804f4a0887d14c97a7fe3f374 by zahira.ammarguellat
Referencing a static function defined in an opnemp clause, is
generating an erroneous warning.

See here: https://godbolt.org/z/ajKPc36M7
The file was modifiedclang/lib/Sema/Sema.cpp
The file was addedclang/test/OpenMP/declare_variant.cpp
Commit 9907746f5db7c2a91917fa7b312136f7bf03d2f5 by sjoerd.meijer
Move Function Specialization to its correct location. NFC.

As a follow up of rGc4a0969b9c14, and as part of D104102, move it to
the IPO transformations directory.
The file was removedllvm/lib/Transforms/Scalar/FunctionSpecialization.cpp
The file was modifiedllvm/lib/Transforms/IPO/CMakeLists.txt
The file was modifiedllvm/lib/Transforms/Scalar/CMakeLists.txt
The file was addedllvm/lib/Transforms/IPO/FunctionSpecialization.cpp
Commit c783013b1471b444a5384e64ac4677e1653057a9 by llvmgnsyncbot
[gn build] Port 9907746f5db7
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Transforms/IPO/BUILD.gn
Commit e2d0798bc3e462738c557270528e8a983df0cf02 by Raphael Isemann
[lldb] Unmark TestInlines as XFAIL for gcc

This works for GCC>8.5 and ToT LLDB.
The file was modifiedlldb/test/API/lang/cpp/inlines/TestInlines.py
Commit b1603cb66fc68eb74c21041456c9e36466603244 by Raphael Isemann
[lldb] Fix compilation after removal of APInt::toString
The file was modifiedlldb/source/Utility/Scalar.cpp
The file was modifiedlldb/source/Plugins/Language/ObjC/Cocoa.cpp
Commit ab46490dfc5cded4b2873da75eb47e150d1ad92c by Raphael Isemann
[lldb] Remove GCC XFAIL for TestTypedefArray

This passes with GCC>8.5 and ToT LLDB.
The file was modifiedlldb/test/API/functionalities/data-formatter/typedef_array/TestTypedefArray.py