[SLP][NFC] Simplify range/type accessors
Use the range-friendly llvm::accumulate() overload instead of the
two-iterator std::accumulate() form, drop redundant cast<>/dyn_cast<>
calls where the source already provides a typed accessor.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/192811
[VPlan] Fix isLatch to handle BranchOnTwoConds, check verifier.(NFC) (#192808)
Update `isLatch` to handle BranchOnTwoConds,
in preparation to enable running the verifier on earlier VPlans.
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
This patch also implements what's neceessary to allow overloading
on pure differences in instantiation dependence, making `std::void_t`
usable for SFINAE purposes.
This also readds a few test cases from da98651, which was a previous attempt
at resolving CWG2064.
Fixes #8740
Fixes #61818
Fixes #190388
[VPlan] Allow same predecessor multiple times in the verifier. (NFC) (#192809)
IR instructions like switch lead to initial VPlans with blocks that have
the same predecessor multiple times. Allow it in the verifier.
[clang] fix profiling of pack index expressions
This replaces a few incorrect calls of VisitExpr on subcomponents,
which should have been plain `Visit` instead, because the former
just implements the commonality between all kind-specific profile
functions (marking the class kind and visiting children).
So this for example would visit a DeclRefExpr but not actually profile
any of it's properties, like the parameter declaration, so it would fail
to distinguish between DeclRefExps referencing distinct entities.
This also adds a call to record the PackIndexExpr's kind in the profile,
to avoid false positives when comparing expressions with different kinds.
[clang] fix a bug matching constrained out-of-line definitions of class member functions
The method which gathered the template arguments for transforming constraints
was incorrectly skipping adding the arguments for function templates which are
class members.
This fixes that, and removes an undocumented workaround for template alias CTAD.
Also adds a test case showing #139276 causes a profiling issue with PackIndexExprs,
which for the tests added in that PR gave the false impression they were fixing the
problem, but were actually causing the implementation to be too accepting, which
masked the bug solved in this patch.
[clang] fix a bug matching constrained out-of-line definitions of class member functions
The method which gathered the template arguments for transforming constraints
was incorrectly skipping adding the arguments for function templates which are
class members.
This fixes that, and removes an undocumented workaround for template alias CTAD.
Also adds a test case showing #139276 causes a profiling issue with PackIndexExprs,
which for the tests added in that PR gave the false impression they were fixing the
problem, but were actually causing the implementation to be too accepting, which
masked the bug solved in this patch.
[clang] fix a bug matching constrained out-of-line definitions of class member functions
The method which gathered the template arguments for transforming constraints
was incorrectly skipping adding the arguments for function templates which are
class members.
This fixes that, and removes an undocumented workaround for template alias CTAD.
Also adds a test case showing #139276 causes a profiling issue with PackIndexExprs,
which for the tests added in that PR gave the false impression they were fixing the
problem, but were actually causing the implementation to be too accepting, which
masked the bug solved in this patch.
[clang] fix a bug matching constrained out-of-line definitions of class member functions
The method which gathered the template arguments for transforming constraints
was incorrectly skipping adding the arguments for function templates which are
class members.
This fixes that, and removes an undocumented workaround for template alias CTAD.
Also adds a test case showing #139276 causes a profiling issue with PackIndexExprs,
which for the tests added in that PR gave the false impression they were fixing the
problem, but were actually causing the implementation to be too accepting, which
masked the bug solved in this patch.
Revert "[FileCheck] Add a diff output option for FileCheck (#187120)" (#192803)
This reverts commit 40333cde2bbd62936d67478eab15ed1fa55b0532.
The implementation is buggy. There are thousands of failures in
```
FILECHECK_OPTS=--diff ninja -C /tmp/Rel check-llvm-mc
FILECHECK_OPTS=--diff ninja -C /tmp/Rel check-lld-elf
```
[lldb] Avoid NotRequired for Python < 3.11 compatibility (#192723)
NotRequired was added in Python 3.11, while the minimum supported Python
for LLDB is 3.8. Avoid it by using `Dict[str, Any]` instead.
[flang][OpenMP] Move directive deprecation check to semantic checks
Replace IssueNonConformanceWarning in resolve-directives.cpp with
CheckDirectiveDeprecation in check-omp-structure.cpp.
[AMDGPU] Report only local per-function resource usage when object linking is enabled
With object linking the linker aggregates resource usage across TUs, so
compile-time pessimism and call-graph propagation duplicate the linker's work or
pollute its inputs.
In this mode, skip the per-callsite conservative bumps in
`AMDGPUResourceUsageAnalysis` and assign each resource symbol in
`AMDGPUMCResourceInfo` a concrete local constant instead of building call-graph
`max`/`or` expressions.
[VPlan] Strip vp_post_order_{deep,shallow} (NFC) (#192787)
Post 691a130 ([ADT] Refactor post order traversal, #191047),
PostOrderTraversal's lifetime needs to exceed the lifetime of the
iterator. The vp_post_order_{deep,shallow} helpers now have the
potential for being used incorrectly: hence, strip them, and require the
PostOrderTraversal to be constructed explictly, similar to RPOT.
[flang][OpenMP] Move ALLOCATE + privatize check to semantic checks
Move the check from symbol resolution to semantic checks.
The check now seems to be more accurate, catching some cases that were
not detected before.
[clang][ssaf] Rework NestedBuildNamespaces of TU and LU summaries (#191489)
Problem:
ASTEntityMapping::getEntityName() creates EntityName with an empty
NestedBuildNamespace, but the linker expected the TU namespace to
already be present in the EntityName. This caused internal linkage
symbols to conflict during linking: since their NestedBuildNamespace was
empty, they all inherited the same LU namespace during resolution,
making internal symbols from different TUs appear identical. For
example, two "static inline" functions with the same USR in separate TUs
would be incorrectly merged into a single LU entity instead of remaining
distinct.
This is now fixed and demonstrated by the
InternalLinkageWithEmptyNamespaceAcrossTUs test, which creates two
internal linkage symbols across two TUs and verifies they remain
separate after linking.
[27 lines not shown]
[AArch64][GISel] Regbank G_BITCAST using src regbank. (#191522)
This takes the regbank of a G_BITCAST from the input srcreg that has
already been allocated, keeping the bitcast on the same bank. A copy
then might be added to the dst if needed.
onlyUsesFP is also improved for G_BITCAST, allowing operations to guess
the correct type through a onlyUsesFP too.
Originally from #177158 by Ryan Cowan with modifications.
[clang-format] Preserve trailing NOLINTEND placement with SeparateDefinitionBlocks (#190741)
Fixes https://github.com/llvm/llvm-project/issues/189384.
When `SeparateDefinitionBlocks: Always` is enabled, clang-format may
separate a clearly trailing comment block by inserting an empty line
before it.
For example, it may format:
```c++
// NOLINTBEGIN
int x = 1;
int y = 2;
// NOLINTEND
void some_function() {}
```
[23 lines not shown]