Changes

Summary

  1. [mlir] ODS: emit interface traits outside of the interface class (details)
  2. [analyzer] Make checker silencing work for non-pathsensitive bug reports (details)
  3. [Format] Fix incorrect pointer/reference detection (details)
  4. [VPlan] Support PHIs as LastInst when inserting scalars in ::get(). (details)
  5. [Demangle] Support Rust v0 mangling scheme in llvm::demangle (details)
  6. [InterleaveAccess] Copy fast math flags when adjusting binary operators in interleave access pass (details)
  7. [clang][AST] Set correct DeclContext in ASTImporter lookup table for template params. (details)
  8. [RISCV][VP] Lower FP VP ISD nodes to RVV instructions (details)
  9. [FuncSpec] Don't specialise functions with attribute NoDuplicate. (details)
Commit a4f81b2054c30954c6739532b923f2b223bc7d77 by zinenko
[mlir] ODS: emit interface traits outside of the interface class

ODS currently emits the interface trait class as a nested class inside the
interface class. As an unintended consequence, the default implementations of
interface methods have implicit access to static fields of the interface class,
e.g. those declared in `extraClassDeclaration`, including private methods (!),
or in the parent class. This may break the use of default implementations for
external models, which are not defined in the interface class, and generally
complexifies the abstraction.

Emit intraface traits outside of the interface class itself to avoid accidental
implicit visibility. Public static fields can still be accessed via explicit
qualification with a class name, e.g., `MyOpInterface::staticMethod()` instead
of `staticMethod`.

Update the documentation to clarify the role of `extraClassDeclaration` in
interfaces.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D104384
The file was modifiedmlir/tools/mlir-tblgen/OpInterfacesGen.cpp
The file was modifiedmlir/include/mlir/Interfaces/ControlFlowInterfaces.td
The file was modifiedmlir/docs/Interfaces.md
Commit 9cca5c1391d637b5500ada646cf136ddb38254a3 by dkszelethus
[analyzer] Make checker silencing work for non-pathsensitive bug reports

D66572 separated BugReport and BugReporter into basic and path sensitive
versions. As a result, checker silencing, which worked deep in the path
sensitive report generation facilities became specific to it. DeadStoresChecker,
for instance, despite being in the static analyzer, emits non-pathsensitive
reports, and was impossible to silence.

This patch moves the corresponding code before the call to the virtual function
generateDiagnosticForConsumerMap (which is overriden by the specific kinds of
bug reporters). Although we see bug reporting as relatively lightweight compared
to the analysis, this will get rid of several steps we used to throw away.

Quoting from D65379:

At a very high level, this consists of 3 steps:

For all BugReports in the same BugReportEquivClass, collect all their error
nodes in a set. With that set, create a new, trimmed ExplodedGraph whose leafs
are all error nodes.
Until a valid report is found, construct a bug path, which is yet another
ExplodedGraph, that is linear from a given error node to the root of the graph.
Run all visitors on the constructed bug path. If in this process the report got
invalidated, start over from step 2.
Checker silencing used to kick in after all of these. Now it does before any of
them :^)

Differential Revision: https://reviews.llvm.org/D102914

Change-Id: Ice42939304516f2bebd05a1ea19878b89c96a25d
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporter.cpp
The file was removedclang/test/Analysis/silence-checkers-malloc.cpp
The file was addedclang/test/Analysis/silence-checkers.cpp
Commit 873308fd8c96a54f0024251425daac1b78f70119 by mydeveloperday
[Format] Fix incorrect pointer/reference detection

https://llvm.org/PR50568

When an overloaded operator is called, its argument must be an
expression.

Before:
    void f() { a.operator()(a *a); }

After:
    void f() { a.operator()(a * a); }

Reviewed By: HazardyKnusperkeks, curdeius, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D103678
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit 80a403348b0f4f5429c40816bf02ae37bd2e85a1 by flo
[VPlan] Support PHIs as LastInst when inserting scalars in ::get().

At the moment, we create insertelement instructions directly after
LastInst when inserting scalar values in a vector in
VPTransformState::get.

This results in invalid IR when LastInst is a phi, followed by another
phi. In that case, the new instructions should be inserted just after
the last PHI node in the block.

At the moment, I don't think the problematic case can be triggered, but
it can happen once predicate regions are merged and multiple
VPredInstPHI recipes are in the same block (D100260).

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D104188
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit 9b1085604ecf3d2d1a416ee658bca981af133128 by tomasz.miasko
[Demangle] Support Rust v0 mangling scheme in llvm::demangle

The llvm::demangle is currently used by llvm-objdump and llvm-readobj,
so this effectively adds support for Rust v0 mangling to those
applications.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D104340
The file was modifiedllvm/unittests/Demangle/DemangleTest.cpp
The file was modifiedllvm/lib/Demangle/Demangle.cpp
Commit fda8b4714e05c68deee469970cb6f7f7ea8b32b7 by david.green
[InterleaveAccess] Copy fast math flags when adjusting binary operators in interleave access pass

The Interleave Access pass will convert shuffle(binop(load, load)) to
binop(shuffle(load), shuffle(load)), in order to create more
interleaving load patterns (VLD2/3/4) that might have been messed up by
instcombine. As shown in D104247 we were missing copying IR flags to the
new instruction though, which should just be kept the same as the
original instruction.

Differential Revision: https://reviews.llvm.org/D104255
The file was modifiedllvm/test/Transforms/InterleavedAccess/AArch64/binopshuffles-inseltpoison.ll
The file was modifiedllvm/test/Transforms/InterleavedAccess/AArch64/binopshuffles.ll
The file was modifiedllvm/include/llvm/IR/InstrTypes.h
The file was modifiedllvm/lib/CodeGen/InterleavedAccessPass.cpp
Commit 05e95d2dd74973dd5163b7d44828fac61e416452 by 1.int32
[clang][AST] Set correct DeclContext in ASTImporter lookup table for template params.

Template parameters are created in ASTImporter with the translation unit as DeclContext.
The DeclContext is later updated (by the create function of template classes).
ASTImporterLookupTable was not updated after these changes of the DC. The patch
adds update of the DeclContext in ASTImporterLookupTable.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D103792
The file was modifiedclang/unittests/AST/ASTImporterTest.cpp
The file was modifiedclang/lib/AST/ASTImporter.cpp
Commit fed1503e855a1e3cf936fa0866f099bf1c8c9416 by fraser
[RISCV][VP] Lower FP VP ISD nodes to RVV instructions

With the exception of `frem`, this patch supports the current set of VP
floating-point binary intrinsics by lowering them to to RVV instructions. It
does so by using the existing `RISCVISD *_VL` custom nodes as an intermediate
layer. Both scalable and fixed-length vectors are supported by using this
method.

The `frem` node is unsupported due to a lack of available instructions. For
fixed-length vectors we could scalarize but that option is not (currently)
available for scalable-vector types. The support is intentionally left out so
it equivalent for both vector types.

The matching of vector/scalar forms is currently lacking, as scalable vector
types do not lower to the custom `VFMV_V_F_VL` node. We could either make
floating-point scalable vector splats lower to this node, or support the
matching of multiple kinds of splat via a `ComplexPattern`, much like we do for
integer types.

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D104237
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was addedllvm/test/CodeGen/RISCV/rvv/vfrdiv-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfadd-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfdiv-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfmul-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vfrsub-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vfsub-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vfdiv-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vfmul-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vfadd-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfrdiv-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfrsub-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfsub-vp.ll
Commit dcd23d875a7e3750903ca4ec865508544757dd99 by sjoerd.meijer
[FuncSpec] Don't specialise functions with attribute NoDuplicate.

Differential Revision: https://reviews.llvm.org/D104378
The file was modifiedllvm/lib/Transforms/IPO/FunctionSpecialization.cpp
The file was addedllvm/test/Transforms/FunctionSpecialization/function-specialization-nodup.ll