OpenMPOpt: Invalidate function analyses individually
Avoid discarding analyses that never need to be invalidated, such as
TargetLibraryInfo.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[llvm] Remove write-only private member variables (NFC) (#244811)
This patch removes private member variables across llvm/ that are
assigned to but never read, along with their assignments.
Assisted-by: Antigravity
OpenMPOpt: Invalidate function analyses individually
Avoid discarding analyses that never need to be invalidated, such as
TargetLibraryInfo.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
ConstantMerge: Preserve CFG analyses (#244817)
ConstantMerge only changes global variables, so it does not need to
invalidate every function analysis.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[RISCV] Remove RVE specific array from getArgGPRs by slicing the front of the full array. (#244770)
The RVE array is a prefix of the full array so we can take the front. This
requires hardcoding the sizes, but these arrays aren't expected to
change so I don't think that's a maintenance issue.
[Target] Move function definitions out of anonymous namespaces (#244814)
The coding standards say the following:
> Make anonymous namespaces as small as possible, and only use them for
> class declarations.
This also makes these files compliant with the
llvm-prefer-static-over-anonymous-namespaces clang-tidy check.
FunctionAttrs: Only invalidate analyses of changed functions in norecurse LTO inference
NoRecurseLTOInferencePass only adds norecurse, so invalidate only the
changed functions and their direct callers instead of every function
analysis.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[mlir][XeGPU] Lower multi_reduction over a unit dim as an elementwise combine (#244005)
Lower a vector.multi_reduction over a unit dim to an elementwise combine
with the accumulator in SgToLaneDistribute, fixing out-of-bounds slices
for tiles like vector<1x8x16> [0] that blocking produces since #240592.
assisted-by-claude
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
ConstantMerge: Preserve CFG analyses
ConstantMerge only changes global variables, so it does not need to
invalidate every function analysis.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Diagnose [[clang::counted_by]] after the type specifiers outside a field
int [[clang::counted_by(n)]] *a; outside a field was silently dropped.
Assisted-by: Opus 5.5
[mlir][vector] Keep the vector.mask pass-thru when dropping unit dims of a read (#243710)
`TransferReadDropUnitDimsPattern` rewrites a `vector.transfer_read`
inside `vector.mask` into a rank-reduced read and mask, but dropped the
pass-thru of the `vector.mask`. The masked-off lanes then got the
padding: for a `vector<3x2x1xf32>` read with mask `[2, 2, 1]` and
pass-thru `9`, the last row came out `0`.
The pass-thru is now shape-cast to the reduced type and kept.
`-lower-vector-mask` can't lower a pass-thru on `transfer_read` yet, so
such IR now stays unlowered instead of lowering to wrong values.
Tested by `@transfer_read_and_vector_rank_reducing_masked_passthru`.
Part of #227821.
Assisted-by: Claude
[SystemZ] Use NORK/NOGRK for bitwise NOT on z15+
With the miscellaneous-extensions-3 facility, `xor x, -1` can be
selected as a single NORK (i32) or NOGRK (i64) with both source
operands equal. This replaces LR+XILF for i32 and LCGR+AGHI for i64:
one instruction instead of two, with a shorter encoding and no
register copy.
Update affected tests and add not-01.ll coverage for z15 and z14.
Assisted by: IBM Bob
[MC] Remove MCContext::RelSecNames. NFC (#244813)
getOrCreateSectionSymbol called by createELFSectionImpl will create a
symbol table entry anyway. Create the symbol table entry earlier to be
reused by the REL/RELA section name, removing RelSecNames.
FunctionAttrs: Only invalidate analyses of changed functions in RPO attrs
Previously any inferred attribute invalidated all function analyses in
the module. Instead, invalidate only the changed functions and their
direct callers, like PostOrderFunctionAttrsPass.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
docs: Add some best practices documentation for codegen tests
Document common review feedback.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
InferFunctionAttrs: Preserve CFG and TargetLibraryInfo analyses (#244764)
InferFunctionAttrs reported no preserved analyses whenever it inferred
anything, which clears every cached function analysis in the module.
It only adds attributes to declarations, so preserve the CFG analyses
and TargetLibraryInfo.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Coroutines: Only invalidate analyses of lowered functions in CoroCleanup
CoroCleanupPass already invalidates the analyses of the functions it
lowers, but then reported no preserved analyses, which clears every
cached function.
Also stop preserving CFG analyses for lowered functions, since noop
coroutine elision can change the CFG.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[SystemZ] Match more shift and displacement patterns for LXA/LLXA
Add TableGen selection patterns for LXA/LLXA instructions to support:
- Add + shift of an extended value with scaled 20-bit displacement (with base)
- Shift of an extended value with scaled 20-bit displacement (without base)
- Add of an extended value with unscaled 20-bit displacement (LXAB/LLXAB)
Update test cases in lxa-*.ll and llxa-*.ll to cover the new patterns.
Assisted by: IBM Bob