SuccessChanges

Summary

  1. [X86] Support __tile_stream_loadd intrinsic for new AMX interface (details)
  2. [NFC][VectorCombine] Extract computeAlignmentAfterScalarization() helper function (details)
  3. [VectorCombine] scalarizeLoadExtract(): use computeAlignmentAfterScalarization() helper (details)
  4. [analyzer] Introduce a new interface for tracking (details)
  5. [analyzer] Reimplement trackExpressionValue as ExpressionHandler (details)
  6. [analyzer] Change FindLastStoreBRVisitor to use Tracker (details)
  7. [analyzer] Hide and rename FindLastStoreBRVisitor (details)
  8. [analyzer] Turn ReturnVisitor into a tracking visitor (details)
  9. [analyzer] Refactor trackRValueExpression into ExpressionHandler (details)
  10. [analyzer] Turn TrackControlDependencyCond into a tracking visitor (details)
  11. [analyzer] Refactor trackExpressionValue to accept TrackingOptions (details)
  12. [llvm-stress] Fix dead code preventing us generating per-element vector selects (details)
  13. clang-format: [JS] don't sort named imports if off. (details)
  14. [OpenCL] Fix overloading resolution of addrspace constructors (details)
  15. [CostModel][AArch64] Improve the cost estimate of CTPOP intrinsic (details)
  16. Do not generate calls to the 128-bit function __multi3() on 32-bit ARM (details)
  17. [clang][NFC] Avoid assignment in condition (details)
  18. [ADT] Consistently use StringExtrasTest for the test suite filter. NFCI. (details)
  19. [clang-tidy] NarrowingConversionsCheck should support inhibiting conversions of (details)
  20. [Test] Add loop deletion test with switch (details)
Commit 56d5c46b494d2232792a46e9b95de40b082f4164 by bing1.yu
[X86] Support __tile_stream_loadd intrinsic for new AMX interface

Adding support for __tile_stream_loadd intrinsic.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D103784
The file was modifiedllvm/lib/Target/X86/X86ISelDAGToDAG.cpp
The file was modifiedllvm/test/CodeGen/X86/AMX/amx-tile-basic.ll
The file was modifiedclang/include/clang/Basic/BuiltinsX86_64.def
The file was modifiedclang/lib/Headers/amxintrin.h
The file was modifiedllvm/lib/Target/X86/X86InstrAMX.td
The file was modifiedllvm/lib/Target/X86/X86PreAMXConfig.cpp
The file was modifiedllvm/lib/Target/X86/X86LowerAMXType.cpp
The file was modifiedclang/test/CodeGen/X86/amx_api.c
The file was modifiedllvm/lib/Target/X86/X86ExpandPseudo.cpp
The file was modifiedllvm/lib/Target/X86/X86FastTileConfig.cpp
The file was modifiedllvm/lib/Target/X86/X86RegisterInfo.cpp
The file was modifiedllvm/include/llvm/IR/IntrinsicsX86.td
Commit abc0e0125cc54426cd2e89080b87b706c3385173 by lebedev.ri
[NFC][VectorCombine] Extract computeAlignmentAfterScalarization() helper function
The file was modifiedllvm/lib/Transforms/Vectorize/VectorCombine.cpp
Commit 20542b47d6373dde497987abd1da83e84983fe13 by lebedev.ri
[VectorCombine] scalarizeLoadExtract(): use computeAlignmentAfterScalarization() helper

This results in slightly more optimistic alignments in some cases
The file was modifiedllvm/lib/Transforms/Vectorize/VectorCombine.cpp
The file was modifiedllvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll
Commit 0cc3100bf8d126ce080c0075cf25784b45e5f990 by vsavchenko
[analyzer] Introduce a new interface for tracking

Tracking values through expressions and the stores is fundamental
for producing clear diagnostics.  However, the main components
participating in this process, namely `trackExpressionValue` and
`FindLastStoreBRVisitor`, became pretty bloated.  They have an
interesting dynamic between them (and some other visitors) that
one might call a "chain reaction". `trackExpressionValue` adds
`FindLastStoreBRVisitor`, and the latter calls `trackExpressionValue`.

Because of this design, individual checkers couldn't affect what's
going to happen somewhere in the middle of that chain.  Whether they
want to produce a more informative note or keep the overall tracking
going by utilizing some of the domain expertise.  This all lead to two
biggest problems that I see:

  * Some checkers don't use it
  This should probably never be the case for path-sensitive checks.

  * Some checkers incorporated their logic directly into those
    components
  This doesn't make the maintenance easier, breaks multiple
  architecture principles, and makes the code harder to read adn
  understand, thus, increasing the probability of the first case.

This commit introduces a prototype for a new interface that will be
responsible for tracking.  My main idea here was to make operations
that I want have as a checker developer easy to implement and hook
directly into the tracking process.

Differential Revision: https://reviews.llvm.org/D103605
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
Commit 967c06b3e95ba776fb06ad0ea5aa699cf2e1b59a by vsavchenko
[analyzer] Reimplement trackExpressionValue as ExpressionHandler

This commit moves trackExpressionValue into the Tracker interface
as DefaultExpressionHandler.  It still can be split into smaller
handlers, but that can be a future change.

Additionally, this commit doesn't remove the original trackExpressionValue
interface, so it's not too big.  One of the next commits will address it.

Differential Revision: https://reviews.llvm.org/D103616
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
Commit b6bcf953220db7880f2bb508f6f5c02b41078b2c by vsavchenko
[analyzer] Change FindLastStoreBRVisitor to use Tracker

Additionally, this commit completely removes any uses of
FindLastStoreBRVisitor from the analyzer except for the
one in Tracker.

The next step is actually removing this class altogether
from the header file.

Differential Revision: https://reviews.llvm.org/D103618
The file was modifiedclang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
Commit 87a5c4d3745a06ec0594fa3f7aaf7f58a53315ec by vsavchenko
[analyzer] Hide and rename FindLastStoreBRVisitor

This component should not be used directly at this point and it is
simply an implementation detail, that's why StoreSiteFinder is
out of the header file.

Differential Revision: https://reviews.llvm.org/D103624
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
Commit f853d2601abd4f6ab789ca1513ae8b59ba5d38b7 by vsavchenko
[analyzer] Turn ReturnVisitor into a tracking visitor

Whenever Tracker spawns a visitor that needs to call tracker
back, we have to use TrackingBugReporterVisitor in order to maintain
all the hooks that the checker might've used.

Differential Revision: https://reviews.llvm.org/D103628
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
Commit 3fc8d943c360f801a428ff24569d2dd53a2afe0f by vsavchenko
[analyzer] Refactor trackRValueExpression into ExpressionHandler

Differential Revision: https://reviews.llvm.org/D103630
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
Commit 51d4704d5ec9b8e4e5e445ee69c56a58250e370e by vsavchenko
[analyzer] Turn TrackControlDependencyCond into a tracking visitor

Differential Revision: https://reviews.llvm.org/D103631
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
Commit 57006d2f6d96d8a6836ae901218ed615071b3b8e by vsavchenko
[analyzer] Refactor trackExpressionValue to accept TrackingOptions

Differential Revision: https://reviews.llvm.org/D103633
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
The file was modifiedclang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
Commit 646e970d44d7eaf4f56e2956fb58b48eb9360cb3 by llvm-dev
[llvm-stress] Fix dead code preventing us generating per-element vector selects

This has been reported several times by the PVS Studio team as well as coming up in some static analysis.

getRandom() % 1 always returns 0 so we never actually test this codepath, (git blame suggests this has always been like this) - given that we have plenty of other "getRandom() & 1" the typo is pretty obvious, and matches the intention in the comment above - with this change we generate a nice mixture of scalar/vector condition selects of vectors.

I don't know llvm-stress that well - but I don't think we guarantee that the same seed value will always generate the same IR for later versions of the program - just that the same binary would.

Differential Revision: https://reviews.llvm.org/D104022
The file was modifiedllvm/tools/llvm-stress/llvm-stress.cpp
Commit 63042d46bb0c2481a8b7aa1c324405c2720b3603 by martin
clang-format: [JS] don't sort named imports if off.

The previous implementation would accidentally still sort the individual
named imports, even if the module reference was in a clang-format off
block.

Differential Revision: https://reviews.llvm.org/D104101
The file was modifiedclang/unittests/Format/SortImportsTestJS.cpp
The file was modifiedclang/lib/Format/SortJavaScriptImports.cpp
Commit b102e6880ab06654f945284a520f68c099732f44 by olemarius.strohm
[OpenCL] Fix overloading resolution of addrspace constructors

This fixes the prioritization of address spaces when choosing a
constructor, stopping them from being considered equally good,
which made the construction of types that could be constructed
by more than one of the constructors.

It does this by preferring the most specific address space,
which is decided by seeing if one of the address spaces is
a superset of the other, and preferring the other.

Fixes: PR50329

Reviewed By: Anastasia

Differential Revision: https://reviews.llvm.org/D102850
The file was modifiedclang/test/SemaOpenCLCXX/addrspace-constructors.clcpp
The file was modifiedclang/lib/Sema/SemaOverload.cpp
The file was modifiedclang/test/CodeGenOpenCLCXX/addrspace-constructors.clcpp
Commit d7c219a506ec9aabe7c5d36c0da55656af487b73 by rosie.sumpter
[CostModel][AArch64] Improve the cost estimate of CTPOP intrinsic

Added a case for CTPOP to AArch64TTIImpl::getIntrinsicInstrCost so that
the cost estimate matches the codegen in
test/CodeGen/AArch64/arm64-vpopcnt.ll

Differential Revision: https://reviews.llvm.org/D103952
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
The file was modifiedllvm/test/Analysis/CostModel/AArch64/ctpop.ll
Commit 789708617d2023dbb343c65120556b2e6a97044d by rengolin
Do not generate calls to the 128-bit function __multi3() on 32-bit ARM

Re-applying this patch after bots failures. Should be fine now.

The function __multi3() is undefined on 32-bit ARM, so a call to it should
never be emitted. Instead, plain instructions need to be generated to
perform 128-bit multiplications.

Differential Revision: https://reviews.llvm.org/D103906
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.cpp
The file was modifiedllvm/test/CodeGen/Thumb/umulo-128-legalisation-lowering.ll
The file was modifiedllvm/test/CodeGen/Thumb2/umulo-128-legalisation-lowering.ll
The file was modifiedllvm/test/CodeGen/ARM/umulo-128-legalisation-lowering.ll
The file was modifiedllvm/test/CodeGen/Thumb/pr35836_2.ll
Commit 691ba0f8acb511f7da1e78c59fe9560b64c47f3a by nathan
[clang][NFC] Avoid assignment in condition

Refactor to avoid assignment inside condition by using 'if
(init-decl)'.  Also remove some unnecessary braces on a separate
if-nest.

Differential Revision: https://reviews.llvm.org/D104039
The file was modifiedclang/lib/Sema/SemaDecl.cpp
Commit 955d88992a55223102c74787fcf58cf20757e2dd by llvm-dev
[ADT] Consistently use StringExtrasTest for the test suite filter. NFCI.

Noticed while updating D103888 - some of the tests were using "StringExtras" for the test_suite_name instead of the expected "StringExtrasTest"
The file was modifiedllvm/unittests/ADT/StringExtrasTest.cpp
Commit 1a53fb0596abf4a8a9d5b4633cd5a8dc04f5e602 by hokein.wu
[clang-tidy] NarrowingConversionsCheck should support inhibiting conversions of
mixed integer and floating point types with WarnOnEquivalentBitWidth=0.

Also standardize control flow of handleX conversion functions to make it easier to be consistent.

Patch by Stephen Concannon!

Differential Revision: https://reviews.llvm.org/D103894
The file was modifiedclang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.h
The file was modifiedclang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-equivalentbitwidth-option.cpp
Commit 8dc2c1a0abdd52eadb12e8ae3b75f1eb8becc25c by mkazantsev
[Test] Add loop deletion test with switch
The file was modifiedllvm/test/Transforms/LoopDeletion/eval_first_iteration.ll