[clang][deps] Flush the in-process module cache on a background thread (#242385)
The in-process module cache keeps every PCM built during the lifetime of
the
dependency scanning service in memory, and flushes them to disk at the
end.
Long-running builds that scan many variants of modules (e.g. with
different
search paths or macro definitions) accumulate tens of gigabytes worth of
scanning PCMs this way. Moreover, the final flush is single-threaded and
happens after all scanning work is done.
This PR makes the service start a background thread that flushes each
PCM to
disk as soon as it's written, and then replaces its in-memory buffer
with the
memory-mapped file. Readers of the in-memory buffer keep it alive on
their own
(shared ownership), and importers of the freshly built PCM never wait
[73 lines not shown]
[KnownFPClass] Bail out for x86_fp80 and ppc_fp128 for KnownFPClass::canonicalize (#243313)
`KnownFPClass::canonicalize` now bails for non-ieee types like
`x86_fp80` and `ppc_fp128`, resolving the `FIXME` for
`KnownFPClass::canonicalize`.
Follow-up to https://github.com/llvm/llvm-project/pull/237096
Bitstream: Read fields with unaligned word loads
Instead of buffering a word in CurWord and refilling it when a field
crosses a word boundary, track only the current bit number and read
each field from a word loaded at its first byte. Fall back to reading
a byte at a time near the end of the stream.
Parsing CTMark bitcode with opt -passes=verify executes 0.14-0.43%
fewer instructions. On kimwitu++ k.bc and sqlite3, cycles drop 2.3%
and 2.4%, and branch misses drop 12% and 10%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Allow fp128 sincosl on x86_64-linux-android (#242486)
On x86_64-linux-android, long double is fp128 rather than x87 fp80 as
on GNU targets, so sincosl provides SINCOS_F128 rather than SINCOS_F80.
Remove the x86 LibraryExclusion and x87-only guard for sincosl to fix
`error: no libcall available for fsincos`.
Link:
https://android.googlesource.com/platform/bionic/+/refs/heads/main/libm/upstream-freebsd/lib/msun/src/s_sincosl.c#47
Assisted-by: Gemini
[flang][openacc] Look through converts when detecting common block storage uses (#243580)
A common block is not implicitly mapped as a whole when it is used in a
compute region only as the `storage` operand of the `fir.declare` of its
members. That check only matched a bare `fir.address_of` of the global.
Look through `fir.convert` before matching `fir.address_of`.
[AMDGPU] Do not form min3/max3 from legacy min/max (#242538)
minMaxOpcToMin3Max3Opc has no mapping for FMIN_LEGACY and FMAX_LEGACY,
so a select-form min or max chain hit unreachable on gfx6 and gfx7.
[Offload][Buildbot] Remove SDMA option from clang/flang buildbot config (#243605)
Removing the option to enable SDMA by default for the tests in the
buildbot.
Check S22's holder by access, not by READ FULL STATUS port
check_s22 looked for the holding registration by its RELATIVE TARGET
PORT IDENTIFIER in READ FULL STATUS. For an ALL_TG_PT registration that
field is not defined (SPC-5 6.16.4) and LIO reports 0, so the check
failed in every phase although the state was correct.
Assert instead that every registration belongs to the ALL_TG_PT
initiator port and that exactly one holds the reservation, and identify
the holding port by access: through the STANDBY port the nexus has a
holder's access, through the ACTIVE port a registered non-holder's.
Add LIO per-I_T-nexus UA/PR and HA failover tests
test_266: LIO ALUA, single node and HA, including hard failover.
test_267: unit attentions are queued and reported per I_T nexus.
test_268: PR identity: ISID, ports, unregistered nexuses.
test_269: PR state across failover and failback (S7 to S22).
conftest.py and iscsi_ua_pr_utils.py hold the shared fixtures and
helpers; the fixtures are opt-in and the existing tests are unaffected.
Reload lio_ha as STANDBY when demoted without a reboot
vrrp_backup started iscsitarget in LIO mode, which does not reload a
loaded lio_ha. A node demoted without a reboot kept the lio_ha it had
as ACTIVE, with forwarding cleared: as BACKUP it did not forward, and
lio_ha now refuses to set forwarding again. Restart iscsitarget in
that case, which reloads lio_ha with default_forward_active=1.
Harden LIO ALUA state updates on failover
Log and skip a failed write to one storage object's ALUA group instead
of aborting, and do not let an ALUA error abort vrrp_master.
On takeover, set both controller groups to TRANSITIONING before pool
import; the peer's group still held ACTIVE_OPTIMIZED from when this node
was STANDBY.
When the STANDBY syncs, retry the ACTIVE's refresh_alua_states until it
gives the STANDBY's group NONOPTIMIZED. The ACTIVE's own ha_state can lag,
and one missed refresh left the group UNAVAILABLE until the next reload.
Add context_params to iscsi_scsi_connect()
Pass an optional context_params dict through to python-scsi's
init_device(), so a test can set pre-login iscsi.Context options such
as an explicit ISID. context_params_supported() lets callers skip when
the installed python-scsi predates it.
Also ruff.
Set the peer's ALUA group when LIO becomes ACTIVE
On takeover, set_alua_active() wrote only the local controller group.
The peer's group kept the value this node had given it while STANDBY,
ACTIVE/OPTIMIZED. Nothing else rewrote it until the peer came back,
reached lio_ha 'synced' and called refresh_alua_states() on this node.
Until then, REPORT TARGET PORT GROUPS advertised the down peer as the
optimized path. If that remote call failed, the wrong state stayed,
because the failure is only logged.
set_alua_active() now writes both groups. The local group becomes
OPTIMIZED, and the peer's group gets the state the ACTIVE node gives
for the current ha_state: NONOPTIMIZED when synced, UNAVAILABLE when
disconnected, otherwise TRANSITIONING.
refresh_alua_states() uses the same table, so the disconnected case now
writes UNAVAILABLE rather than TRANSITIONING. That matches the table in
utils/lio/config.py, so the reconciler and the event handlers no longer
disagree about the peer's state.
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]
[LoopUtils] Only expand RT check bounds for affine outer recurrences. (#243571)
When expanding the bounds to cover the outer loop, the outer step is
only checked to be non-negative once. This is not sufficient if the step
varies across outer iterations, i.e. the recurrences are not affine.