SuccessChanges

Summary

  1. [clang-tidy] Omit std::make_unique/make_shared for default initialization. (details)
  2. [X86] Regenerate clzero.ll tests (details)
  3. [X86] Regenerate sttni.ll tests (details)
  4. [X86] Regenerate addcarry2.ll tests (details)
  5. [X86] Regenerate bmi-intrinsics-fast-isel.ll tests (details)
  6. [X86] Regenerate store-narrow.ll tests (details)
  7. [X86] Regenerate vector-shift-*.ll tests (details)
  8. [PowerPC] Fix missing nop after call to weak callee. (details)
  9. [mlir] Tighten access of RewritePattern methods. (details)
  10. [ICP] Don't promote when target not defined in module (details)
  11. [flang][openacc] Add clause validity tests for the update directive (details)
  12. [analyzer][StdLibraryFunctionsChecker] Make close and mmap to accept -1 as fd (details)
Commit 8d2c095e5a6bd34f8bb5cffd5c57c8deea5b8647 by ckennelly
[clang-tidy] Omit std::make_unique/make_shared for default initialization.

This extends the check for default initialization in arrays added in
547f89d6070 to include scalar types and exclude them from the suggested fix for
make_unique/make_shared.

Rewriting std::unique_ptr<int>(new int) as std::make_unique<int>() (or for
other, similar trivial T) switches from default initialization to value
initialization, a performance regression for trivial T.  For these use cases,
std::make_unique_for_overwrite is more suitable alternative.

Reviewed By: hokein

Differential Revision: https://reviews.llvm.org/D90392
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/modernize-make-shared.rst
The file was modifiedclang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/modernize-make-unique.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/modernize-make-shared.cpp
The file was addedclang-tools-extra/test/clang-tidy/checkers/modernize-make-unique-default-init.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.h
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/modernize-make-unique.rst
Commit bbc5c4bf40907275a1bca62711198afc51eebd1d by llvm-dev
[X86] Regenerate clzero.ll tests

Replace X32 check prefixes with X86 - X32 is generally used for gnux triple tests
The file was modifiedllvm/test/CodeGen/X86/clzero.ll
Commit dcff846f4dcac0aa605af0fb1a6290a9d79fb56e by llvm-dev
[X86] Regenerate sttni.ll tests

Replace X32 check prefixes with X86 - X32 is generally used for gnux triple tests
The file was modifiedllvm/test/CodeGen/X86/sttni.ll
Commit 3204282a988eb6b8a78ac983c47681726b31d360 by llvm-dev
[X86] Regenerate addcarry2.ll tests

Replace X32 check prefixes with X86 - X32 is generally used for gnux triple tests
The file was modifiedllvm/test/CodeGen/X86/addcarry2.ll
Commit 0785f12e6ebb7cdffe7191b5fe9a430a2979217e by llvm-dev
[X86] Regenerate bmi-intrinsics-fast-isel.ll tests

Replace X32 check prefixes with X86 - X32 is generally used for gnux triple tests
The file was modifiedllvm/test/CodeGen/X86/bmi-intrinsics-fast-isel.ll
Commit e18f8d63bd7f8cb0baa12f142a2542aeb40847d6 by llvm-dev
[X86] Regenerate store-narrow.ll tests

Replace X32 check prefixes with X86 - X32 is generally used for gnux triple tests
The file was modifiedllvm/test/CodeGen/X86/store-narrow.ll
Commit 45878ede7e05b5e255eca3dee1d0b23830fc55b3 by llvm-dev
[X86] Regenerate vector-shift-*.ll tests

Replace X32 check prefixes with X86 - X32 is generally used for gnux triple tests
The file was modifiedllvm/test/CodeGen/X86/vector-shift-lshr-256.ll
The file was modifiedllvm/test/CodeGen/X86/vector-shift-ashr-256.ll
The file was modifiedllvm/test/CodeGen/X86/vector-shift-ashr-sub128.ll
The file was modifiedllvm/test/CodeGen/X86/vector-shift-shl-256.ll
The file was modifiedllvm/test/CodeGen/X86/vector-shift-lshr-128.ll
The file was modifiedllvm/test/CodeGen/X86/vector-shift-shl-sub128.ll
The file was modifiedllvm/test/CodeGen/X86/vector-shift-lshr-sub128.ll
The file was modifiedllvm/test/CodeGen/X86/vector-shift-shl-128.ll
The file was modifiedllvm/test/CodeGen/X86/vector-shift-ashr-128.ll
Commit 2812c1515627904e31605bbd4f25a887a1f8eb12 by stefanp
[PowerPC] Fix missing nop after call to weak callee.

Weak functions can be replaced by other functions at link time. Previously it
was assumed that no matter what the weak callee function was replaced with it
would still share the same TOC as the caller. This is no longer true as a weak
callee with a TOC setup can be replaced by another function that was compiled
with PC Relative and does not have a TOC at all.

This patch makes sure that all calls to functions defined as weak from a caller
that has a valid TOC have a nop after the call to allow a place for the linker
to restore the TOC.

Reviewed By: NeHuang

Differential Revision: https://reviews.llvm.org/D91983
The file was modifiedllvm/test/CodeGen/PowerPC/preemption.ll
The file was modifiedllvm/test/CodeGen/PowerPC/ppc64-blnop.ll
The file was modifiedllvm/test/CodeGen/PowerPC/pr41088.ll
The file was modifiedllvm/test/CodeGen/PowerPC/xray-tail-call-hidden.ll
The file was modifiedllvm/test/CodeGen/PowerPC/ppc64-calls.ll
The file was modifiedllvm/test/CodeGen/PowerPC/ppc64-sibcall.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
Commit 02c9050155dff70497b3423ae95ed7d2ab7675a8 by csigg
[mlir] Tighten access of RewritePattern methods.

In RewritePattern, only expose `matchAndRewrite` as a public function. `match` can be protected (but needs to be protected because we want to call it from an override of `matchAndRewrite`). `rewrite` can be private.

For classes deriving from RewritePattern, all 3 functions can be private.

Side note: I didn't understand the need for the `using RewritePattern::matchAndRewrite` in derived classes, and started poking around. They are gone now, and I think the result is (only very slightly) cleaner.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D92670
The file was modifiedmlir/include/mlir/IR/PatternMatch.h
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
The file was modifiedmlir/include/mlir/Transforms/DialectConversion.h
Commit 77b509710ce7e6aec9ab460bc22a34f44fa94ab3 by tejohnson
[ICP] Don't promote when target not defined in module

This guards against cases where the symbol was dead code eliminated in
the binary by ThinLTO, and we have a sample profile collected for one
binary but used to optimize another.

Most of the benefit from ICP comes from inlining the target, which we
can't do with only a declaration anyway. If this is in the pre-ThinLTO
link step (e.g. for instrumentation based PGO), we will attempt the
promotion again in the ThinLTO backend after importing anyway, and we
don't need the early promotion to facilitate that.

Differential Revision: https://reviews.llvm.org/D92804
The file was modifiedllvm/test/LTO/Resolution/X86/load-sample-prof-icp.ll
The file was modifiedllvm/test/Transforms/PGOProfile/indirect_call_promotion_musttail.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
The file was modifiedllvm/test/Transforms/PGOProfile/icp_covariant_invoke_return.ll
The file was modifiedllvm/test/Transforms/PGOProfile/icp_covariant_call_return.ll
Commit 1dd24e6ab7a70242edfa4139441bfe7753892b4e by clementval
[flang][openacc] Add clause validity tests for the update directive

Add couple of clause validity tests for the update directive and check for
the restriction where at least self, host or device clause must appear on the directive.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D92447
The file was modifiedflang/lib/Lower/OpenACC.cpp
The file was modifiedflang/lib/Parser/openacc-parsers.cpp
The file was modifiedflang/include/flang/Parser/dump-parse-tree.h
The file was modifiedllvm/include/llvm/Frontend/OpenACC/ACC.td
The file was modifiedflang/include/flang/Parser/parse-tree.h
The file was modifiedflang/lib/Semantics/check-acc-structure.cpp
The file was modifiedflang/test/Semantics/acc-clause-validity.f90
Commit d14c63167315edfc4a4ad91fac9c866c6e0cb67f by gabor.marton
[analyzer][StdLibraryFunctionsChecker] Make close and mmap to accept -1 as fd

close:
It is quite often that users chose to call close even if the fd is
negative. Theoretically, it would be nicer to close only valid fds, but
in practice the implementations of close just returns with EBADF in case
of a non-valid fd param. So, we can eliminate many false positives if we
let close to take -1 as an fd. Other negative values are very unlikely,
because open and other fd factories return with -1 in case of failure.

mmap:
In the case of MAP_ANONYMOUS flag (which is supported e.g. in Linux) the
mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to
be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified, and portable
applications should ensure this.
Consequently, we must allow -1 as the 4th arg.

Differential Revision: https://reviews.llvm.org/D92764
The file was modifiedclang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp