Add middleware support for LIO ALUA HA
Wire up the middleware side of LIO ALUA high-availability: load
lio_ha.ko with per-node addresses on service start, manage ALUA
state across failover events, clean up STANDBY configfs on pool
export, and add pre-flight validation that targets have static
initiator ACLs before ALUA can be enabled.
For each target, create a portal-less phantom TPG carrying the peer
node's controller group so that a single RTPG response from any
connected port lists both ALUA groups. Write tpgt_N/rtpi explicitly
before enable so that relative target port IDs in RTPG match the
tag formula (portal.tag on Node A, portal.tag + 32000 on Node B)
rather than being auto-assigned sequentially by the kernel.
ALUA group states are driven by role and ha_state:
MASTER + synced local=OPTIMIZED remote=NONOPTIMIZED
MASTER + connected local=OPTIMIZED remote=TRANSITIONING
[4 lines not shown]
[flang] Add -finit-local= to initialize automatic variables (#216164)
This patch implements the `-finit-local=` compiler option, which
initializes automatic (local) Fortran variables that have no explicit or
default initialization.
Assisted-by: IBM Bob
RFC:
https://discourse.llvm.org/t/rfc-add-finit-local-to-flang-for-initializing-automatic-variables/91545
## Accepted values
| Value | Effect |
|-------|--------|
| `zero` | Fill every storage byte with zero |
| `0x` | Fill every storage byte with the given hex pattern |
The gfortran compatibility alias `-finit-local-zero` is equivalent to
[28 lines not shown]
CodeGen: Mark dead PHI destination copies dead in the LiveIntervals path (#225760)
When PHIElimination lowers a PHI whose destination is dead, it records a
dead def in LiveIntervals but did not set the dead flag on the lowered
copy's def operand. The LiveVariables path set this via addVirtualRegisterDead.
Avoids "Instruction ending live segment on dead slot has no dead flag"
verifier errors once LiveVariables is removed.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[AMDGPU] Stub Target.td classes in generic feature validation test
Parsing Target.td dominated each llvm-tblgen run in
AMDGPUTargetDefGenericFeatures.td. Replace it with minimal stand-ins for the
classes AMDGPUTargetParser.td uses, and keep including the real
AMDGPUTargetParser.td so the test still exercises the real
AMDGPUGenericAnyFeature and processor classes.
Local test time drops from 4.2s to 0.07s.
Change-Id: I9dbc4add9a0885cd2b3a83597f9817b1a32729b1
[X86] Fix CodeGen crash for arrays of empty structs and unions (#224203)
getFPTypeAtOffset() divides by the allocation size of an array element
when normalizing IROffset. Empty structs and unions have zero allocation
size, so arrays of these types can cause a division-by-zero during X86
ABI lowering.
Return nullptr for zero-sized array elements and add CodeGen tests for
empty struct and union arrays.
[lldb][test] Remove dead a.out rule from TestSBModule's Makefile (#225943)
The custom a.out recipe was overridden by the default $(EXE) rule in
Makefile.rules ("overriding commands for target 'a.out'"), so a.o and
b.o were linked directly into a.out rather than through libfoo.a. Build
only main.c through C_SOURCES and pass libfoo.a via LD_EXTRAS, so the
default rule links against the archive as intended.
Assisted-by: Claude
[SCCP] Implement Structure support in select
Same as my previous work on PhiNode, we support structure in select if
there is at least one member is mergeable.
As structure type check code has multiple consumer now, we create a
helper function forEachLatticeElement, which accept a function to
indicate what we want to do for a single lattice eleemnt. The lattice
getter function is passed as a currying function of the callback.
Also, remove an assertion for testing DenseMap reference as
isInstFullyOverDefined has already emit elements in DenseMap.
[AMDGPU] Insert V_NOP after V_PERM_PK16 (gfx1250 hazard)
On gfx1250 the V_PERM_PK16 family (V_PERM_PK16_B4/B6/B8_U4) has a hazard:
the instruction must be immediately followed by a "safe" instruction that
issues on the pipe which clears the hazard. Insert V_NOP as needed.
Also updated hasUnwantedEffectsWhenEXECEmpty() to ensure V_PERM_PK16 and
the inserted V_NOP are under non-zero EXEC.
Fixes: ROCM-26041
Assisted-by: Opus 4.8 Medium
[alpha.webkit.UncountedCallArgsChecker] Wait for the instantiation to check a dependent call argument (#224565)
RawPtrRefCallArgsChecker reported a call argument as unsafe when the
call appeared in an uninstantiated template pattern and the argument was
still type-dependent. In
template <typename T> void f(T& voice) {
Wrapper::create(protect(voice));
}
Wrapper::create is qualified, so it is resolved in the pattern and its
parameter is known to be a raw reference, but protect(voice) is a
dependent call whose callee is still an UnresolvedLookupExpr.
tryToFindPtrOrigin has nothing to look at -- there is no callee decl and
the type of the call is '<dependent type>' rather than Ref<Voice> -- so
the argument was reported even though the instantiation resolves it to a
Ref. Giving the parameter a concrete type made the report go away with
no other change. The same happened in the body of a generic lambda,
which is such a pattern.
[8 lines not shown]
[lldb] Fix dwim-print's arrow-operator check to match the substring (#225778)
`CommandObjectDWIMPrint::DoExecute` decides whether to try `expr` as a
limited, dot-only frame variable path before falling back to full
expression evaluation. The comment above the check says a variable
path is not attempted if `expr` contains the arrow operator (`->`) or
the subscript operator (`[]`), or a bare `*` or `&`:
```
const bool try_variable_path =
expr.find_first_of("*&->[]") == StringRef::npos;
```
`find_first_of` treats its argument as a set of characters so this also
matches a lone `-` or a lone `>` anywhere in `expr`, not only the
two-character `->` sequence the comment describes.
Fix the check to test for the `->` substring directly with
`StringRef::contains`, keeping `find_first_of` only for the four
characters that are genuinely excluded one at a time (`*`, `&`, `[`,
`]`).
[29 lines not shown]
[lldb] Fix crash on a trailing '-' in a legacy variable expression path (#225661)
`StackFrame::LegacyGetValueForVariableExpressionPath` walks a variable
expression path one separator character at a time. On seeing a `-` it
checks that the following character is `>`, to confirm this is really
the `->` operator and not something else:
```
case '-':
expr_is_ptr = true;
if (var_expr.size() >= 2 && var_expr[1] != '>')
return ValueObjectSP();
...
var_expr = var_expr.drop_front(); // Remove the '-'
[[fallthrough]];
case '.': {
var_expr = var_expr.drop_front(); // Remove the '.' or '>'
```
The `var_expr.size() >= 2` guard is only meant to make the `var_expr[1]`
read safe, but it also disables the whole check when `var_expr` is
[26 lines not shown]
Reland "[AMDGPU] PromoteAlloca: flatten homogeneous structs to vectors" (#221058)
This relands #217055
The original commit revealed a latent issue in eliminateFrameIndex in
SIRegisterInfo where SCC can be clobbered before reading it on
gfx900/gfx90a. This change itself has no known issues.
[AMDGPU] Update based on review feedback
Replace the lambda with the check inlined at both sites, and report a fatal
error when neither a free SGPR nor FrameReg is available, rather than
silently falling back to the spilling scavenge.
[AMDGPU] Use the scavenger to test whether SCC is live after MI
The register scavenger is stepped backwards to the liveness state
immediately after MI, so RS->isRegUsed(SCC) already answers "is SCC live
after MI" directly. Replace the hand-rolled test with that query.
[AMDGPU] Don't spill an SGPR while SCC is live in frame index lowering
When SCC is live into a scalar frame index user, the scaling path avoids
SALU ops that write SCC by computing the address in a VGPR and reading it
back with V_READFIRSTLANE_B32. If the destination of that readfirstlane is
scavenged with spilling allowed, an AMDGPU SGPR spill writes inactive
lanes, so it flips EXEC with S_NOT_B64 and clobbers SCC. Instead, scavenge
that register with AllowSpill=false.
[NFC][AMDGPU] Add tests for SCC live into a frame index user
Pre-commit tests for the case where SCC is live into a frame index user and
no SGPR is free to hold the V_READFIRSTLANE_B32 result. Scavenging one
emergency-spills an SGPR, and an SGPR spill flips EXEC with S_NOT_B64, so the
EXEC flips land between the S_CMP_EQ_U32 that defines SCC and the read of SCC
that follows, clobbering it in between.
[AMDGPU] Insert V_NOP after V_PERM_PK16 (gfx1250 hazard)
On gfx1250 the V_PERM_PK16 family (V_PERM_PK16_B4/B6/B8_U4) has a hazard:
the instruction must be immediately followed by a "safe" instruction that
issues on the pipe which clears the hazard. Insert V_NOP as needed.
Also updated hasUnwantedEffectsWhenEXECEmpty() to ensure V_PERM_PK16 and
the inserted V_NOP are under non-zero EXEC.
Fixes: ROCM-26041
Assisted-by: Opus 4.8 Medium
RISCV: Don't use MCTargetOptions::ABIName in the ELF target streamer (#224704)
The abi name should come from the target-abi module flag in codegen,
which should be set up in the AsmPrinter. The ABI name field should
only be of practical use in the assembler, which reads the flag in
onBeginOfFile.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude Opus 4.8)
[alpha.webkit.UncountedLocalVarsChecker] Wait for the instantiation to check a dependent local variable (#224566)
RawPtrRefLocalVarsChecker had the same false positive as the call
arguments checker: a local variable whose declared type is a concrete
raw pointer was reported when its initializer was still type-dependent.
In
template <typename T> void f(T& guard) {
Voice* v = guard.ptr();
}
the declared type Voice* makes isUnsafePtr fire, while guard.ptr() is a
CXXDependentScopeMemberExpr, so tryToFindPtrOrigin bails out before it
can reach the guardian analysis which makes the resolved form safe. The
instantiation is character for character the concrete form, which is not
reported.
Skip type-dependent initializers and traverse the instantiated call
operators of a generic lambda, as in the call arguments checker. Unlike
[5 lines not shown]