SuccessChanges

Summary

  1. [clang][deps] Fix failing modules.cpp test (details)
  2. [lldb][docs] Document SBType (details)
  3. [clang][deps] NFC: Check the correct context hashes in tests (details)
  4. [clang][deps] Prevent unintended modifications of the original TU command-line (details)
  5. Revert "[lldb] Set return status to failed when adding a command error" (and fixups) (details)
  6. [libc++] Refactor the tests for std::prev, next and advance (details)
  7. [MLIR][NFC] Rename MemRefDataFlow -> AffineScalarReplacement (details)
  8. [clang][deps] NFC: Fix an XFAIL test on Windows (details)
  9. [libc++] NFC: More refactoring in the prev/next/advance tests per review comments (details)
  10. Intrinsic::getName: require a Module argument (details)
  11. [clang][deps] NFC: Handle `DependencyOutputOptions` only once (details)
  12. [clang][deps] NFC: Stop using moved-from object (details)
  13. [DAGCombine] reduceBuildVecToShuffle(): sort input vectors by decreasing size (details)
  14. [NFC][DAGCombine] Extract getFirstIndexOf() lambda back into a function (details)
  15. Reland "[lldb] Set return status to failed when adding a command error" (details)
  16. [flang] Fix compilation problem with rename of "MemRefDataFlow" (details)
  17. Add AutomaticAllocationScope to memref.alloca_scope (details)
Commit 1d8882b5e44e577f226b7a5a83c27df3b16b3ab6 by Jan Svoboda
[clang][deps] Fix failing modules.cpp test

Commit d8bab69ead22a10dc4cdb2e36f6ea6fdfe774e2e updated the ClangScanDeps/modules.cpp test. The new `{{.*}}` regex is supposed to only match `modules_cdb_input.o`, `a.o` or `b.o`. However, due to non-determinism, this can sometimes also match `modules_cdb_input2.o`, causing match failure on the next line. This commit changes the regex to only match one of the three valid cases.

Buildbot failure: https://lab.llvm.org/buildbot/#/builders/109/builds/16675
The file was modifiedclang/test/ClangScanDeps/modules.cpp
Commit 11e2922bb7adbbca17c3a0f44779aa87dbc64b42 by Raphael Isemann
[lldb][docs] Document SBType

This documents the behaviour of the different SBType functions with notes for
the language-specific behaviour for C/C++/Objective-C. All of this reflects the
current behaviour of LLDB (even though that also means some functions behave
kinda weird but at least they are now documented to be weird)

Reviewed By: #lldb, mib

Differential Revision: https://reviews.llvm.org/D103454
The file was modifiedlldb/bindings/interface/SBType.i
Commit 41115efca642981c2165cdf9ef2b2148605faa12 by Jan Svoboda
[clang][deps] NFC: Check the correct context hashes in tests

The `clang-scan-deps` tests for the full output format were written under the assumption that most TUs/modules have the same context hash. This is no longer true, since we're changing the original compilation options. This patch updates the tests, which no longer conflate multiple context hashes into a single FileCheck variable.
The file was modifiedclang/test/ClangScanDeps/modules-full.cpp
The file was modifiedclang/test/ClangScanDeps/modules-inferred.m
Commit 80c0c639687ef52f5c432ea059ff9cb53125d08e by Jan Svoboda
[clang][deps] Prevent unintended modifications of the original TU command-line

One of the goals of the dependency scanner is to generate command-lines that can be used to explicitly build modular dependencies of a translation unit. The only modifications to these command-lines should be for the purposes of explicit modular build.

However, the current version of dependency scanner leaks its implementation details into the command-lines.

The first problem is that the `clang-scan-deps` tool adjusts the original textual command-line (adding `-Eonly -M -MT <target> -sys-header-deps -Wno-error -o /dev/null `, removing `--serialize-diagnostics`) in order to set up the `DependencyScanning` library. This has been addressed in D103461, D104012, D104030, D104031, D104033. With these patches, the `DependencyScanning` library receives the unmodified `CompilerInvocation`, sets it up and uses it for the implicit modular build.

Finally, to prevent leaking the implementation details to the resulting command-lines, this patch generates them from the **original** unmodified `CompilerInvocation` rather than from the one that drives the implicit build.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D104036
The file was modifiedclang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
The file was addedclang/test/ClangScanDeps/Inputs/preserved-args/cdb.json.template
The file was modifiedclang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
The file was addedclang/test/ClangScanDeps/Inputs/preserved-args/tu.c
The file was addedclang/test/ClangScanDeps/Inputs/preserved-args/mod.h
The file was addedclang/test/ClangScanDeps/Inputs/preserved-args/module.modulemap
The file was addedclang/test/ClangScanDeps/preserved-args.c
The file was modifiedclang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
Commit ac031c8db2ce454a9b08f23192ce698e8bde4447 by david.spickett
Revert "[lldb] Set return status to failed when adding a command error" (and fixups)

This reverts commit f583029da3d6dbabe82f48b160227eb0120abd33,
0f94d68a2e15d50796439f20bcb508b95931d2ae and
a2363c0cf9b6a9a81c76ac652da667f73845d38b.

Due to test failures from incorrect SB API usage.
The file was addedlldb/test/Shell/Commands/command-backtrace.test
The file was modifiedlldb/test/API/commands/register/register/register_command/TestRegisters.py
The file was removedlldb/test/Shell/Commands/command-backtrace-parser-2.test
The file was removedlldb/test/Shell/Commands/command-backtrace-parser-1.test
The file was modifiedlldb/source/Interpreter/CommandReturnObject.cpp
Commit 8e93aa304b3fbe57bb7d22f63681f1b9758e63a9 by Louis Dionne
[libc++] Refactor the tests for std::prev, next and advance

This started as an attempt to fix a GCC 11 warning of misplaced parentheses.
I then noticed that trying to fix the parentheses warning actually triggered
errors in the tests, showing that we were incorrectly assuming that the
implementation of ranges::advance was using operator+= or operator-=.

This commit fixes that issue and makes the tests easier to follow by
localizing the assertions it makes.

Differential Revision: https://reviews.llvm.org/D103272
The file was removedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/advance.pass.cpp
The file was addedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count_sentinel.pass.cpp
The file was addedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count.pass.cpp
The file was addedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/constraints.compile.pass.cpp
The file was removedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/constraints.verify.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count_sentinel.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/special_function.compile.pass.cpp
The file was addedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_sentinel.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_sentinel.pass.cpp
The file was addedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/constraints.compile.pass.cpp
The file was modifiedlibcxx/test/support/test_iterators.h
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator.pass.cpp
The file was modifiedlibcxx/include/__iterator/advance.h
The file was removedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count_sentinel.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator.pass.cpp
The file was removedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/check_round_trip.h
The file was removedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/constraints.verify.cpp
Commit 88e4aae57d4deabf55de534e1d3e0794739f4be6 by uday
[MLIR][NFC] Rename MemRefDataFlow -> AffineScalarReplacement

NFC. Rename MemRefDataFlow -> AffineScalarReplacement and move to
AffineTransforms library. Pass command line rename: -memref-dataflow-opt
-> affine-scalrep. Update outdated pass documentation.

Rationale:
https://llvm.discourse.group/t/move-and-rename-memref-dataflow-opt-lib-transforms-lib-affine-dialect-transforms/3640

Differential Revision: https://reviews.llvm.org/D104190
The file was modifiedmlir/include/mlir/Transforms/Passes.td
The file was removedmlir/lib/Transforms/MemRefDataFlowOpt.cpp
The file was modifiedmlir/lib/Transforms/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/Affine/Passes.td
The file was modifiedmlir/examples/toy/Ch5/toyc.cpp
The file was modifiedmlir/examples/toy/Ch6/toyc.cpp
The file was removedmlir/test/Transforms/memref-dataflow-opt.mlir
The file was modifiedmlir/include/mlir/Transforms/Passes.h
The file was modifiedmlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
The file was addedmlir/test/Dialect/Affine/scalrep.mlir
The file was modifiedmlir/include/mlir/Dialect/Affine/Passes.h
The file was addedmlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
The file was modifiedmlir/examples/toy/Ch7/toyc.cpp
Commit f39dcf85f994b464946cd6702bbceadc518ce904 by Jan Svoboda
[clang][deps] NFC: Fix an XFAIL test on Windows

The `sed` command ensures Windows-specific path separators (single and double backslashes) are replaced by forward slashes in the output file. FileCheck can continue using forward slashes in paths this way.
The file was modifiedclang/test/ClangScanDeps/modules-full.cpp
Commit 9f967eed89e66e39909c59ec0246dc2877d75f51 by Louis Dionne
[libc++] NFC: More refactoring in the prev/next/advance tests per review comments
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_sentinel.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count_sentinel.pass.cpp
The file was modifiedlibcxx/test/support/test_iterators.h
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_sentinel.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/constraints.compile.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count_sentinel.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/constraints.compile.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count_sentinel.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator.pass.cpp
Commit bb8ce25e88218be60d2a4ea9c9b0b721809eff27 by jeroen.dobbelaere
Intrinsic::getName: require a Module argument

Ensure that we provide a `Module` when checking if a rename of an intrinsic is necessary.

This fixes the issue that was detected by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32288
(as mentioned by @fhahn), after committing D91250.

Note that the `LLVMIntrinsicCopyOverloadedName` is being deprecated in favor of `LLVMIntrinsicCopyOverloadedName2`.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D99173
The file was modifiedllvm/lib/CodeGen/MachineOperand.cpp
The file was modifiedllvm/docs/ReleaseNotes.rst
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
The file was modifiedllvm/lib/CodeGen/ReplaceWithVeclib.cpp
The file was modifiedllvm/include/llvm-c/Core.h
The file was modifiedllvm/lib/IR/AutoUpgrade.cpp
The file was modifiedllvm/lib/IR/Core.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
The file was modifiedllvm/include/llvm/IR/Intrinsics.h
The file was modifiedllvm/test/Assembler/auto_upgrade_intrinsics.ll
The file was modifiedllvm/lib/IR/Function.cpp
Commit f95ff81627212a8db9f942aafa91392096538847 by Jan Svoboda
[clang][deps] NFC: Handle `DependencyOutputOptions` only once

There's no need to pass `DependencyOutputOptions` to each call of `handleFileDependency`, since the options don't ever change.

This patch adds new `handleDependencyOutputOpts` method to the `DependencyConsumer` interface and the dependency scanner uses it to report the options only once.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D104104
The file was modifiedclang/include/clang/Tooling/DependencyScanning/DependencyScanningWorker.h
The file was modifiedclang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
The file was modifiedclang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
The file was modifiedclang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
Commit 85208b96b85f6f3e502cf4b7fd5f440434d1c7e5 by Jan Svoboda
[clang][deps] NFC: Stop using moved-from object

The dependency scanning worker uses `std::move` to "reset" `DependencyOutputOptions` in the `CompilerInstance` that performs the implicit build. It's probably preferable to replace the object with value-initialized instance, rather than depending on the behavior of a moved-from object.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D104106
The file was modifiedclang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
Commit 6e5628354e22f3ca40b04295bac540843b8e6482 by lebedev.ri
[DAGCombine] reduceBuildVecToShuffle(): sort input vectors by decreasing size

The sorting, obviously, must be stable, else we will have random assembly fluctuations.

Apparently there was no test coverage that would benefit from that,
so i've added one test.

The sorting consists of two parts - just sort the input vectors,
and recompute the shuffle mask -> input vector mapping.
I don't believe we need to do anything else.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D104187
The file was modifiedllvm/test/CodeGen/X86/oddshuffles.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Commit 0f94c3c80dde666f369ef98057ac943e869c3d52 by lebedev.ri
[NFC][DAGCombine] Extract getFirstIndexOf() lambda back into a function

Not all supported compilers like such lambdas, at least one buildbot is unhappy.
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Commit 31b9acaec5797e409afb83d665fc8816d8a37940 by david.spickett
Reland "[lldb] Set return status to failed when adding a command error"

This reverts commit ac031c8db2ce454a9b08f23192ce698e8bde4447.

SB API usage has been corrected.
The file was modifiedlldb/source/Interpreter/CommandReturnObject.cpp
The file was addedlldb/test/Shell/Commands/command-backtrace-parser-2.test
The file was addedlldb/test/Shell/Commands/command-backtrace-parser-1.test
The file was modifiedlldb/test/API/commands/register/register/register_command/TestRegisters.py
The file was removedlldb/test/Shell/Commands/command-backtrace.test
Commit b88fa0e39fa7b8906562b7044d06bba094c8b688 by psteinfeld
[flang] Fix compilation problem with rename of "MemRefDataFlow"

Revision https://reviews.llvm.org/D104190 renamed MemRefDataFlow -> AffineScalarReplacement.  After this rename, mlir failed to build.  With this change, all of clang, mlir, and flang build and test correctly.

Differential Revision: https://reviews.llvm.org/D104223
The file was modifiedflang/include/flang/Optimizer/Support/InitFIR.h
Commit c83e696732fd906297d83a98dee044f1173be355 by zinenko
Add AutomaticAllocationScope to memref.alloca_scope

This change adds `AutomaticAllocationScope` to the
memref.alloca_scope op. Additionally, it also clarifies
that alloca_scope is is conceptually a passthrough operation.

Reviewed By: ftynse, bondhugula

Differential Revision: https://reviews.llvm.org/D104227
The file was modifiedmlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td