[mlir][affine] Add early exit to getLowerBound/getUpperBound function (NFC) (#212047)
When an AffineExpr is an AffineConstantExpr, its bound can be directly
returned without computing the lower/upper bounds for all operand
values. This avoids redundant bound evaluations on operands and speeds
up static bound computation.
[ConstraintElimination] Fix trivially true compares with no variables. (#216392)
getConstraintForSolving handles 'X uge 0' and '0 ule X' directly,
returning a constraint that is trivially true. The returned row was sized
Value2Index.size(), which is 0 if the unsigned system does not have any
variables yet, e.g. in a function without arguments. An empty row means
the condition could not be decomposed, so the fast path was discarded and
the compare not simplified.
Size the row to include the entry for the constant part, so it is never
empty.
PR: https://github.com/llvm/llvm-project/pull/216392
[clang-format] Harden star and amp annotation (#212856)
At this point we can't (or won't) decide wether this is a template
argument or just an expression, opt out of the specialized (and in the
test cases wrong) assignment.
Fixes #212622
[CIR][NFC] Remove unnecessary casts in LowerToLLVM (#216395)
Remove unnecessary casts for Op with TypeConstraints and known type for
operands in the LowerToLLVM
[GlobalISel] Add G_SEXT_INREG(G_ZEXT) -> G_SEXT combine. (#213606)
This converts a G_ZEXT or G_ANYEXT to a G_SEXT if we will G_SEXT_INREG
the bits away.
[JITLink][ORC] Add ppc64 to generic stub API; use it in DLLImportDefinitionGenerator (#207968)
`getAnonymousPointerCreator` and `getPointerJumpStubCreator` provide
arch-neutral factory functions for pointer slots and PLT jump stubs, but
ppc64/ppc64le were missing from both switch tables.
Add ppc64 support: `createAnonymousPointer` maps directly, while
`createAnonymousPointerJumpStub` requires a lambda wrapper to fix the
endianness template parameter and supply _LongBranchSaveR2_ as the stub
kind (the correct default for external calls that must preserve the TOC
pointer). Callers needing a different stub kind can construct a
`PointerJumpStubCreator` lambda directly. Update
`DLLImportDefinitionGenerator::createStubsGraph` to use these
arch-neutral factories instead of calling jitlink::x86_64:: directly,
completing part of the work tracked in issue
https://github.com/llvm/llvm-project/issues/57162
[ADT] Mark deprecated APInt constructor deleted (#216371)
Mark deprecated APInt constructor, taking uint64_t[] deleted instead of
removing it as the comment suggests.
[LLDB] fix lldb breg adress width (#216291)
`DW_OP_breg0..31` and `DW_OP_bregx` preserved the scalar width supplied
by the register backend and added their displacement as a `uint64_t`. On
32-bit targets this could leave a 64-bit value on the expression stack,
so later generic address arithmetic did not wrap at the target address
size.
Perform the register-plus-offset calculation using the evaluator's
address-sized generic representation. This keeps `DW_OP_breg*` results
at the target address width without changing shared register reading or
the generic
operand compatibility rule.
Add unit tests for both compact and extended breg opcodes. They cover a
32-bit register value, a backend-provided 64-bit register value on i386,
a negative displacement, and modulo-32-bit overflow.
Fixes #209728
[DirectX] Add support for heap resources to `DXILResourceMap`.
- `DXILResourceMap` now handles a new `llvm.dx.resource.handlefromheap` intrisics
and adds the heap resources to the resource map.
- A new member `HeapResourceID` has been added to `ResourceInfo` to distinguish
between heap resource instances created from different indices. The `HeapResourceID`
is unique for each heap index `Value*`, so multiple handle creation calls using
the same index `Value*` resolve to the same resource.
- Heap resources do not have register bindings, so the `Binding` member
on `ResourceInfo` is now optional.
- All places that were always expecting binding are updated to handle
heap resources. In most cases that means skipping them, such as when
generating DXIL resource metadata, creating PSV resource entries or
pretty-printing the resource table comment for the module disassembly
output.
[2 lines not shown]
[ELF] Prevent .eh_frame_hdr size oscillation in address assignment (#216248)
When .eh_frame_hdr size shifts, section addresses can change whether
FDEs evaluate to identical PC-relative offsets, causing FDE
deduplication count to toggle and section size to oscillate infinitely
between passes.
Prevent .eh_frame_hdr from shrinking during iterative address assignment
passes (matching .relr.dyn) to ensure monotonic convergence.
[NFC][DirectX] Rename ResourceInfo::RecordID to BindingID (#216376)
Rename `ResourceInfo::RecordID` to `BindingID` to better reflect its
purpose. This field is set only for resources with an associated
binding. This also clarifies the distinction from the upcoming
`HeapResourceID` member, which will identify resources originating from
a heap. The existing `RecordID` name could be ambiguous once both
identifiers are present.
The change also removes the `RecordID` argument from the `ResourceIfo`
constructor because it has always been called with `0` value. The
`BindingID` is set later via `setBindingID` after all resource instances
are collected.
[clangd][clang-tidy] Factor out mergeFixits() logic and reuse it in clangd (#208682)
This patch extracts `mergeFixits()` from `DiagnosticRenderer` to
`clang::edit` and reuses it in clangd. This prevents syntax errors
caused by token merging when applying clang-tidy fixits via clangd.
Fixes #207618
[DWARFLinker] Index Swift mangled type names in the parallel linker (#216429)
Swift records a type's mangled name in DW_AT_linkage_name. The classic
linker indexes it as a type accelerator entry alongside the short
DW_AT_name, but the parallel linker indexed only the short name.
Port the DW_LANG_Swift block added to the classic linker in 8234f8ae2685
to the parallel linker's type case.
[SLP]Recalculate copyable-element deps after tree reordering
Reordering permutes the operand columns of the entries and may move an
operand between copyable-covered and plain edges, making the computed
dependency counts stale and tripping the unscheduled-deps assertion.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/216442
[RISCV] Remove short-forward-branch-imm. (#216401)
Just use short-forward-branch-ialu. I hope implentations that implement
short-forward-branch, do it equally for all branch types. Doing anything
else would create complex tradeoffs.
I'm planning to add conditional c.mv fusion support for Zibi and I don't
want to add an immediate version flag there.
The patterns that checked NoShortForwardBranchImm were not checking that
an immediate branch ISA was enabled. So I've changed them to
NoVendorXqcibiOrNoShortForwardBranch.
[NFC][SLP] Add a test for fma fusion with the fmul on operand 1 (#216428)
canConvertToFMA only looks at operand 0 of the fadd, so the accumulator
shape fadd c, a * b is never recognised, and the fmul it does find is
priced with the target's fusion discount already applied. The threshold
puts the decision right at the cost boundary so the checks record which
way SLP goes today.
[DWARFLinker] Constrain a function's high_pc to its own symbol (#216432)
Mach-O objects built with .subsections_via_symbols make every symbol an
independently placeable atom, and the linker packs atoms without
preserving the spacing they had in the object file.
I have an example where the compiler describes such a subprogram as
extending past its own atom. While it's debatable whether that's a good
idea, it's not invalid in the object file. However, once linked, it is
invalid.
We can make dsymutil resilient against this by looking at the size of
the symbol in the debug map and adjusting the end_pc. I'm doing so
conservatively so that only a collision is repaired. Already
overlapping/invalid ranges remain untouched.
rdar://184768778