[MLIR][Presburger] Conversion between Int- and FracMatrix (#192822)
A straightforward conversion between `IntMatrix` and `FracMatrix`. This
is one further preparation PR.
The next step for upstreaming is to find a particular solution `x` to
the system `Ax = Bp + C`, which might contain fractions while `A`, `B`
and `C` are IntMatrices. That's the reason we need these conversion
helpers.
---------
Co-authored-by: Arjun Pitchanathan <arjunpitchanathan at gmail.com>
[SelectionDAG][NFC] Add function for `peekThroughFreeze` (#195324)
There are a few callsites in SelectionDAG and DAGCombiner where it is
necessary to look through an `ISD::FREEZE` to unblock some optimization
and folds. This patch introduces `peekThroughFreeze` and
`peekThroughOneUseFreeze` utility functions to cleanup the repeated sites.
[Clang][ItaniumMangle] Preserve field-name closure-prefix for instantiated lambdas (#195340)
Previously, instantiation did not pass `LambdaContextDecl`, so the NSDMI
lambda in the class template used the wrong `ContextDecl`.
Fixes: #190555
[SLP][NFC] Pre-commit tests for build-vector stores in store chains (#195531)
These tests exercise SLP store-chain handling when an explicit
build-vector store (a chain of insertelements stored to memory) is
interleaved with scalar stores at adjacent addresses. The CHECK lines
reflect current behavior:
- buildvector_store_middle: vector store sits in the middle of the
chain.
SLP currently leaves it intact and packs the surrounding scalars into
a narrower <2 x float> + scalar tail mix.
- buildvector_store_start / buildvector_store_end: vector store sits at
the start/end of the chain. SLP already combines the adjacent scalar
stores into a clean <4 x float> store, so these are regression cases
that should remain unchanged.
- buildvector_store_duplicate_offset: scalar stores at the same address
bracket the vector store; SLP keeps the chain split.
A follow-up patch updates the CHECK lines for the cases that change.
[SLP][REVEC] Replace all uses of direct gather scalar operands
When ReVec gather inserts a tree-vector scalar V directly as a
shufflevector operand (poison-vector path of createInsertVector), the
existing per-User external use only rewrites V's use inside that one
shufflevector. Other in-IR uses of V are left untouched and trigger
the "Deleting out-of-tree value" assertion in vectorizeTree when V's
tree entry is erased.
Register an additional nullptr-User external use so V's remaining
uses are rewritten via replaceAllUsesWith.
Fixes #195425
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/195536
[clang-format] Honor later negated .clang-format-ignore patterns (#195432)
This addresses (#178344).
In this issue the negation (`!`) for paths inside .clang-format-ignore
doesn't behave as intended, as clang-format stops processing patterns on
the first match, rather than processing further rules/patterns.
Rather than
```
foo/*
!foo/*.h
```
un-ignoring `.h`-files in `foo/` - the header-files remain ignored,
since the ignore-condition exits early and considers the files ignored
when checking `foo/*`.
I've tried to make negation work with the old behaviour (like mentioned
in #178344), but could find no sensible way to use it.
From the draft/proposal of .clang-format-ignore (#52975) it looks like
the intent of the negation pattern was to behave similar to .gitignore -
[8 lines not shown]
[NFC][LLVM] Eliminate use of `getIntrinsicInfoTableEntries` from CloneFunction.cpp (#195448)
Simplify creation of constrained intrinsic calls by just using
`getOrInsertDeclaration` that accepts arg and return types of an
intrinsic and hence eliminating the need to look at the IIT descriptors
to map overload types.
[NFC][LLVM][Intrinsics] Add `hasStructReturnType` helper (#195457)
Add a helper function to query if an intrinsic has a struct return type
and use it in AutoUpgrade
[NFC][LLVM] Make `matchIntrinsicSignature` static and rename it (#195380)
Make `matchIntrinsicSignature` static, rename it to `isSignatureValid`,
and change the sense of its return value to match the new name.
[LLVM][Intrinsic] Move overload index validation to C++ (#195297)
Move overload index validation to C++ to enable more descriptive error
messages when that validation fails.
Also delete the `intrinsic-arginfo-error.td` test as its redundant.
[JITLink][Docs] Update roadmap and availability sections (#195446)
This patch updates the JITLink documentation, in particular the
`Roadmap` and `JITLink Availability and Feature Status` to match the
latest code changes. I am not an expert on the JITLink codebase, so let
me know if I missed something.
Fixes #191781
[LV] Add test for cost modeling wide calls with mixed return types (NFC) (#195177)
Add missing test coverage for test with multiple calls with different
return types
[VPlan] Dissolve replicate regions with vector live-outs. (#189022)
Remove the scalar VF restriction and properly handle replicate regions
with vector live outs.
After unrolling the replicate regions, we end up with a set of scalar
VPPhis. The current patch post-processes them and converts them to
a chain of InsertElement + VPWidenPHiRecipes to match original codegen
as closely as possible.
An alternative would be to keep the phis scalar and combine them with
BuildVector at the end, but that would result in quite different
codegen.
Now that ::execute for replicate regions is dead, clean up
VPTransformState::Lane and various ::execute that relied on it.
Depends on https://github.com/llvm/llvm-project/pull/186252
PR: https://github.com/llvm/llvm-project/pull/189022
[DebugInfo] Fix crash in declare-to-assign when memcpy writes to scalable-vector alloca (#194107)
## Problem
`declare-to-assign` (`AssignmentTrackingPass`) crashes with a fatal error when a fixed-size `memcpy` writes into a scalable-vector alloca (e.g. an RVV `vint32m1_t`):
Cannot implicitly convert a scalable size to a fixed-width size in TypeSize::operator ScalarTy()
**PS**: The compiler explorer always implicitly adds the '-g' option, when adding the '-g0', the crash will disappear: https://riscvc.godbolt.org/z/dEqhc4EoE
**Reproducer** (clang `-target riscv64-unknown-linux-gnu -march=rv64gcv -O1 -g`):
```c
#include <string.h>
#include <riscv_vector.h>
vint32m1_t get_i32x4(int* v) {
vint32m1_t r;
memcpy(&r, v, 16);
return r;
}
[13 lines not shown]
[llubi] Fix inconsistent intrinsic argument retrieval (#195499)
This PR fixes inconsistent intrinsic argument retrieval by making all
intrinsics fetch their arguments from `Args`. This change is a
prerequisite for handling parameter attributes in `enterCall`.