[mlir][acc] Replicate privatized storage across active parallel dims (#235974)
`computePrivatizeMapFlags` derives replication flags for an
`acc.privatize` from its `par_dims`. `par_dims` records ownership: the
parallel levels a privatization or reduction is associated with.
`active_par_dims` records the launch dimensions that execute the op
unpredicated, and that is what `ACCCGToGPU` uses to lay out hoisted
private storage in the kernel: the `acc.private_local` view has one
leading dimension per active level and is indexed by the corresponding
block/thread ids.
`par_dims` and `active_par_dims` may differ. A vector-level array
reduction nested in a gang loop has ownership `par_dims([thread_x])`,
since its partial results are combined across threads, but its temporary
is allocated inside the gang loop, so its active dimensions are
`[block_x, thread_x]`. The host then maps the storage as
`vector_private` (one copy per thread), while the kernel indexes it as
`[num_gangs][num_threads][n]`. Every gang other than gang 0 accesses
memory past the end of the allocation.
[13 lines not shown]
[lldb][OpenBSD] Fix FindProcesses and process group/session IDs (#235403)
FindProcessesImpl() checked the whole match, including the name, before
reading the process arguments that provide the name, so it never found
anything. Leave the name out of the first check, as FreeBSD and NetBSD
do.
Also fill in the process group and session IDs from kinfo_proc, and
skip the getProcFile_Pid test on OpenBSD, which has no /proc.
This fixes the Host.FindProcesses, HostTest.GetProcessInfo and
Support.getProcFile_Pid unit tests.
[lldb][OpenBSD] Implement HostInfoOpenBSD::GetProgramFileSpec() (#235230)
GetProgramFileSpec() on OpenBSD always returned an empty FileSpec.
Use getexecpath(3) to look up the path of the running executable.
getexecpath() is only available on newer OpenBSD releases, so add a
HAVE_GETEXECPATH check to LLDB's generated config, as LLVM Support
does for getMainExecutable().
[libc++][test][NFC] Use correct number of digits for <numbers> ground-truth values (#233664)
Corrects the number of digits used for the `float` hexadecimal literals
for the `<numbers>` test. All literals are now exactly representable as
`float`. The tested values themselves are unchanged.
Noted here:
https://github.com/llvm/llvm-project/pull/222830#discussion_r3985465297
[AArch64][Windows] Fix tail call support. (#230429)
Fix a handful of problems with tail calls on Arm64 Windows:
* Add support for the `endc` unwind opcode, and use an `alloc_s`/`endc`
pair to tell the Windows unwinder about callee-pops functions.
* Ensure that we use a frame pointer in any function that does a
non-tail call to a callee-pops function that has stack-based arguments.
* Fix pointer authentication for tail calls where the stack-based
argument size differs from the caller's; we can't simply use `autibsp`
in that case because the stack pointer value will be different, so
authentication would fail. Restoring the link register and
authenticating it immediately prior to the epilogue fixes the problem.
Assisted-by: claude
rdar://189018874
[RegAlloc] Cache failed canReassign searches
The eviction advisor can ask canReassign repeatedly for the same live
interval. For register classes with long allocation orders, rescanning every
candidate is expensive when the answer remains false.
Cache failed searches that examine more than the configured order-size
threshold. A failure remains valid while registers are assigned because an
assignment cannot make another physical register available. LiveRegMatrix now
notifies every eviction advisor when an interval is unassigned so cached
failures whose slot ranges overlap the freed interval can record the affected
physical register. MLEvictAdvisor embeds a DefaultEvictionAdvisor, so both
register as listeners.
On a later query, return the cached failure immediately when no relevant
unassign occurred. Otherwise, check only the freed register and its aliases
that belong to the interval's allocation order. If none are now free, retain
the failure without rescanning the full order. Hint-only searches are not
reused, because the hint set can grow without an overlapping unassign.
[10 lines not shown]
devel/prjpeppercorn114: Add new port
This port is used by devel/nextpnr* to produce configuration bitstreams for
CologneChip GateMate FPGAs.
This port is versioned because of version compatibility requirements with
devel/nextpnr*.
[ConstantFolding] Compute GEP offsets in the index width (#235838)
SymbolicallyEvaluateGEP rewrites a GEP with constant indices as a base
pointer plus a byte offset, absorbing the GEPs it is based on. It
computed
each offset with DataLayout::getIndexedOffsetInType, which returns an
int64_t, and then extended the result to the index width.
That is wrong when the index type is wider than 64 bits, e.g. with
p:128:128:
* an index that doesn't fit int64_t hits the assertion in
APInt::getSExtValue, and is truncated in builds without assertions;
* indices that each fit int64_t but whose sum doesn't are silently
wrapped, even with assertions.
Use GEPOperator::accumulateConstantOffset, which accumulates in an APInt
of
the index width, and don't fold if it fails to compute the offset.
[AMDGPU] Decrease sensitivity of rewrite-vgpr-mfma-to-agpr-spill-multi-store-mir.mir (#235994)
This test is sensitive to changes and is challenging to maintain.
This adds `-enable-misched=0` to remove dependency on the scheduler and
`-amdgpu-stress-vgpr=138` to constrain RA to behave more like we want.
tests/pf/igmp: fix attribute error with newer versions of scapy
This fixes the flaky testcase in CI[0].
While here:
* fix a typo in a comment
* remove an unnecessary import
* fix this deprecation warning:
/usr/local/lib/python3.12/site-packages/scapy/contrib/igmp.py:12:
DeprecationWarning: scapy.contrib.igmp is deprecated. Please use
scapy.layers.igmp instead !
[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/29813/testReport/junit/sys.netpfil.pf.igmp/py/TestIGMP__test_ip_opts/
Reviewed by: kp
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
[RegAlloc] Cache failed canReassign searches
The eviction advisor can ask canReassign repeatedly for the same live
interval. For register classes with long allocation orders, rescanning every
candidate is expensive when the answer remains false.
Cache failed searches that examine more than the configured order-size
threshold. A failure remains valid while registers are assigned because an
assignment cannot make another physical register available. LiveRegMatrix now
notifies every eviction advisor when an interval is unassigned so cached
failures whose slot ranges overlap the freed interval can record the affected
physical register. MLEvictAdvisor embeds a DefaultEvictionAdvisor, so both
register as listeners.
On a later query, return the cached failure immediately when no relevant
unassign occurred. Otherwise, check only the freed register and its aliases
that belong to the interval's allocation order. If none are now free, retain
the failure without rescanning the full order. Hint-only searches are not
reused, because the hint set can grow without an overlapping unassign.
[10 lines not shown]
[MemProf] Refactor indirect call ICP info to reference callsite records (NFC) (#235142)
Prepare for an upcoming change to support indirect tail calls. This will
involve performing ICP using callsite records that are not laid out
contiguously in the function's callsite list.
Rather than recording a start index into the function's callsite
records, have ICallAnalysisData hold a pointer to the CallsiteInfo for
each profiled target, which recordICPInfo obtains via a callback. A
null entry means there is no record for that target, in which case all
clones call the original target. performICP then no longer needs the
function's callsite list.
Assisted-by: Gemini
[SCEV] Remove unused MatchBinaryOp() arguments (NFC) (#236165)
This function used to call haveNoCommonBitsSet(), but this has been
replaced with a disjoint flag check.
[Offload][L0] Add PISA image support to L0 plugin (#235698)
As part of the ongoing effort to add PISA support to LLVM (see
[here](https://discourse.llvm.org/t/rfc-upstreaming-the-pisa-backend-to-llvm/91474/16)),
add a new OffloadBinary image type and extend the L0 plugin to recognize
it.
Following PRs will add the OffloadImage generation support.
[CIR] Propagate error condition in the case of emitSimpleStmt failure
In the case where emitSimpleStmt fails we will reach some cases that are
normally unreachable. This patch ensures the the failure is propagated.
[SandboxVec][LoadStoreVec] Move legality checks to LegalityAnalysis (NFC) (#234783)
Up until now the LoadStoreVec was using a custom legality checker. This
patch is the first step towards unifying and sharing the legality checks
across the passes.
[flang] Do not hoist loop-like operations in LICM (#236056)
Hoisting a loop out of the loop it is nested in changes how it is
scheduled relative to the iterations of the enclosing loop. For example,
an inner loop of an OpenACC parallel loop that ends up outside of the
parallel loop is no longer executed by every iteration of it, and can
then be mapped to parallel dimensions on its own and compute wrong
results.
Skip operations implementing LoopLikeOpInterface, including when they
are nested in a hoistable operation.
[Clang] Add test coverage for musttail returns (NFC)
Precommit tests for #191198. After a musttail call, clang emits the
function epilog into a dead block with a second return. That block also
gets the code emitted after the call: the null check of a reference
return under -fsanitize=null and the alignment assumption of an
align_value return type.
Claude-Session: https://claude.ai/code/session_01BbuhcvnQHrMsr86cJSCZfr
[clang][CMake] Make clangCodeGen depend on analysis_gen
clangCodeGen includes llvm/Analysis/TargetLibraryInfo.h, which includes
the TableGen-generated TargetLibraryInfo.inc since c9f573463ebd. Nothing
orders obj.clangCodeGen after analysis_gen, so a clean
"ninja obj.clangCodeGen" fails with "TargetLibraryInfo.inc file not
found" in BackendUtil.cpp, CodeGenAction.cpp and CodeGenModule.cpp, and
full builds can race. Add analysis_gen next to the other transitively
included generated headers, as LLVMAnalysis and LLVMCore already do.
Assisted-by: Claude Code (Opus 5.5).
[offload][OpenMP][NFC] Add a default-grid run to the no-loop tests
Add a run without OMP_NUM_TEAMS and OMP_TEAMS_THREAD_LIMIT to show the
kernels are promoted with the runtime's default grid as well.
[NFC] Change strided loop name
Changes strided loop to be named grid-stride loop instead for less
ambiguity as stride describes the jump distance in general.