[SLP][modularisation][NFC] Move BoUpSLP class definition to SLPTree.h
Move the BoUpSLP class definition and its nested types out of
SLPVectorizer.cpp into the internal header SLPVectorizer/SLPTree.h. Method
definitions outside the class body stay in SLPVectorizer.cpp.
The header is self-contained: it compiles as the only include of a
translation unit and does not depend on anything SLPVectorizer.cpp defines
before including it.
- The limits MaxMemDepDistance and MinScheduleRegionSize, used by inline
scheduler code, move with the class and become static constexpr.
- DenseMapInfo<BoUpSLP::EdgeInfo> moves after the class, since inline
BoUpSLP code instantiates maps keyed on EdgeInfo.
- The header defines DEBUG_TYPE for the LLVM_DEBUG uses in the inline
scheduler code and undefines it at the end.
- getShallowScore gets a function-local PatternMatch using-directive.
- clang-format reflows five moved lines (two accessors, one comment, one
parameter list, operator==).
[5 lines not shown]
[GVN] Preserve PRE load metadata as much as possible
The synthosis Load instruction preserve only hand picked metadata. In
here, we can actually preserce more then we have now. We use the
existing copyMetadataForLoad to fix it. Also, some UB implying
metadata cannot be preserved so that we drop it.
Also, AA related metada should be be keeped after dropping. We call it
after dropping so that we don't need a long whitelist list for the
dropping metadata.
[mlir][SPIR-V] Add spirv.DemoteToHelperInvocation op (#245365)
Adds the `spirv.DemoteToHelperInvocation` op corresponding to
`OpDemoteToHelperInvocation` (opcode 5380), introduced by
`SPV_EXT_demote_to_helper_invocation` and promoted to core in SPIR-V
1.6.
Assisted with Google Antigravity Gemini 4 Neon model
[SLP][modularisation][NFC] Prepare BoUpSLP for a header of its own
Remove the file-local names the BoUpSLP class definition depends on, so the
class can move to SLPVectorizer/SLPTree.h without the header relying on
declarations in SLPVectorizer.cpp:
- SLPReductionUtils: ReductionVectorPart.
- SLPCompatibilityAnalysis: generateKeySubkey.
- HorizontalReduction moves from the anonymous namespace into
llvm::slpvectorizer, so BoUpSLP can befriend it from a header.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
Assisted by AI
[RISCV][TTI] Set the default MaxVectorCoalesceElts to 1 (#246590)
Alternative to #246576
Set the default MaxVectorCoalesceElts to 1 so strided vector memory
operations are costed per element rather than receiving a cache-line
coalescing discount. This matches scheduling models such as SiFive7,
which model ordinary strided accesses as one element per cycle.
This is motivated by reversed_unit_stride: a reverse shuffle followed by
a unit-stride store can replace a negative-stride store. The coalescing
discount can favor the negative-stride store over this alternative.
Add a standalone SLP regression test checking that reversed unit-stride
stores use a reverse shuffle followed by an ordinary vector store.
[AMDGPU] Re-enable AAInstanceInfo in AMDGPUAttributor
This was enabled and then disabled because of its compile time impact. This
recent changes, the compile time issue should have been resolved.
[Attributor] Use call site values when the callee returns an argument
AAPotentialValuesCallSiteReturned takes the interprocedural values of a call
from the interprocedural return values of the callee. If the callee returns one
of its arguments, these values contain the arguments of all call sites, so each
call result also gets the values passed at all other call sites. This is not
necessary. If the callee has many call sites and the call results are passed to
other calls, the value sets also become very large.
If the callee returns only its arguments and constants, we just need to
translate these values to the call site for the interprocedural scope.
This PR was assisted by AI but I reviewed all the changes.
[Attributor] Do not copy large value sets in `AAPotentialValues`
`AAPotentialValuesImpl::recurseForValue` copies all values of another position
into the state. For example, if a callee returns one of its arguments, the call
result takes the values of the call site operand. In a chain of calls where each
call gets the result of the previous call, each call result then has one more
value than the previous one. A call result also sees the new values of the
previous call only in the next fixpoint iteration, so a chain of N calls needs N
iterations, and a long chain hits the iteration limit.
In this PR, we just limit the number of values to copy to 7, and use the value
of the position itself otherwise. 7 is a magic number here, but it is sufficient
for most cases (telling from the fact that no existing test is affected by this
change).
This PR was assisted by AI but I reviewed all the changes.
[RISCV][Docs] Fix the return type in vector add call examples (#247025)
Both the masked and unmasked `llvm.riscv.vadd` examples omit the return
type after `call`. When either example is placed in a function,
`llvm-as` reports `expected type` at the intrinsic name. Add `<vscale x
4 x i32>` to both calls.
With LLVM 24, both examples assemble and pass the IR verifier. On RV64,
`llc` emits `vadd.vv` for both and uses `v0.t` for the masked form. The
existing RV32 and RV64 `rvv/vadd.ll` tests passed, and the LLVM HTML
documentation built with warnings treated as errors.
Assisted-by: OpenAI Codex
[GVN] Process Foldable Terminator beforehead
GVN generates phi node to replace a load call. However, addDeadBlock
modify such phi so that any deadblock sucessor in a phi becomes
poison.
This causes disagreement on SSAUpdater as [%a, %b1] [poison, %b2] is
considered as different with [%a, %b1] [0, %b2] even if poison is
replace with 0.
As a result, we make processFoldableTerminator (which is the only
caller of addDeadBlock now) runs before processInstruction. This is
before what we have on phi node generation so that non of the mismatch
happens.
Asissted-by: Claude # Test
su(1): Fix kerberized path with MKPAM=no MKKERBEROS=yes.
Fixes:
$ su riastradh
riastradh at EXAMPLE.COM's Password:
su: chown 0x7e3294e318a0: No such file or directory
After using the target user's password to get credentials (that is, a
ticket-granting ticket) into an in-memory cache and verifying the
credentials are valid, don't copy them into _another_ in-memory cache
and then chown it -- that makes no sense and doesn't work. Instead,
copy them into a _file_ cache.
This was broken in 2012 with a build fix that apparently nobody has
ever tested since:
https://mail-index.netbsd.org/source-changes/2012/04/12/msg033638.html
PR bin/61091: MKPAM=no kerberized su(1) is busted
rtwn: fix the build without RTWN_DEBUG
RTWN_DPRINTF() compiles to nothing without RTWN_DEBUG, which leaves four
of the IQK result copies in r92f_iq_calib() set but never read. Kernels
with "device rtwn" in their config, LINT among them, then fail with
-Werror,-Wunused-but-set-variable. The module build does not hit this
because its generated opt_rtwn.h always defines RTWN_DEBUG.
Print the result array directly and drop the four locals.
Fixes: 1f0e186e1832 ("rtwn: added support for Realtek RTL8192FU...")
Sponsored by: Rubicon Communications, LLC ("Netgate")