Attributor: Collect the values only used by assumes on demand
initializeInformationCache tracked the uses of the operands of every
llvm.assume to find the values only used by assumes, but only a few
abstract attributes and OpenMPOpt ask for them, none of which run in
attributor-light. Collect them for a function when they are first asked
for.
Instruction counts (callgrind) of the light passes in the ThinLTO
backend of tramp3d-v4: -5.8%.
CTMark (-attributor-enable=light): O3 -0.03%, ThinLTO -0.02%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[CIR] Prune CIR type subtrees when collecting symbol uses (#234811)
applyReplacements builds a symbol user map over the whole module to find
the users of replaced functions, and the generic walk descends into
every nested record of every function signature even though no symbol
reference can hide in a CIR type. Collect only the users of the
functions being replaced, in one pre-order walk that skips CIR type
subtrees, and keep chained replacements working by merging the old users
into the new symbol's set.
On SemaExpr.cpp, applyReplacements drops from 1.7% to 0.4% of compile
samples (perf, cycles).
[mlir][llvm] Add tbaa_struct field attrs to the LLVM dialect (#238991)
The LLVM dialect models `!tbaa` access tags but has no representation
for `!tbaa.struct`, so aggregate copies with struct TBAA lose that
metadata in both directions: export drops it, import warns unhandled
metadata.
This PR adds the missing pieces.
The importer declines nodes it cannot model (null tags, empty nodes)
rather than representing them (warning on unhandled metadata), the
MLIR-side verification of LLVM's non-decreasing-offset rule is left out.
[MemProf][NFC] Standardize on MemPGO terminology and expand docs (#241353)
Documentation, option help strings, header comments, and tests have
referred to LLVM's memory profile-guided optimization framework
inconsistently as "profile guided heap optimization" (PGHO),
"profile-guided memory optimization", and "MemProf". Because the
compiler pipeline optimizes both dynamic heap allocations and static
data layout using profiles from the MemProf instrumentation and runtime,
standardize on "profile-guided memory optimization (MemPGO)" for the
overall optimization framework while reserving "MemProf" for the
profiler, runtime, and profile format.
Updates and expands documentation that was in MemProf.md (now moved to
MemPGO.md with a redirect stub in the old file) to describe more details
about how allocation contexts are classified, the hint values used, and
how matching and LTO whole-program context disambiguation work.
Assisted-by: Gemini
InstCombine: Fold readnone ldexp libcalls to llvm.ldexp
This was already done for the equivalent scalbn.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
carp: Check if_carp under carp_sx in carp_nl_get()
carp_nl_get() tested ifp->if_carp for NULL before taking carp_sx and
walked the softc list afterwards. When the last vhid on the interface
is removed in between, carp_free_if() clears if_carp and the walk
dereferences a NULL pointer. A reader that passes the check while the
removal holds carp_sx always hits this.
The check was done with the lock held until the ioctl(2) API was
retired. Do it under the lock again.
Reported by: Marcos Mendoza <mmendoza at netgate.com>
Fixes: 72472e52e310 ("carp: retire ioctl(2) API")
Sponsored by: Rubicon Communications, LLC ("Netgate")
NAS-140886 / 27.0.0 / Simplify `LongString` (by themylogin) (by bugclerk) (#20194)
Our current `LongString` implementation boxes all strings in
`LongStringWrapper`. Sometimes it's transparent, but sometimes we need
to unbox it explicitly, which leads to quite ugly code. This is a better
implementation that does not need that.
Original PR: https://github.com/truenas/middleware/pull/18887
Original PR: https://github.com/truenas/middleware/pull/20193
Co-authored-by: themylogin <themylogin at gmail.com>
Add truenas-scst-boot.py to keep scst disabled after upgrade
On upgrade the installer enables every unit marked enabled in the
old boot environment's /data/user-services.json. Middleware without
the previous commit recorded scst there as enabled even on HA and in
LIO mode, so the first boot of the new environment could start SCST
before middleware disabled it again.
Add a script for the installer to run chrooted in the new boot
environment, after the database migration and with /proc, /sys and
/dev mounted, as it already does for truenas-hw-license.py. It
disables scst if the system is licensed for HA or the iSCSI mode is
LIO. If it cannot determine either, it reports the error and leaves
scst unchanged.
[CIR] Remove unused CIRGenModule::getMLIRVisibility overload (NFC) (#241103)
The last callers of the CIRGenModule::getMLIRVisibility overload taking
clang::Visibility were removed on November 10, 2026 in commit
07a5b49195119547bc6420bde79a5b714153faca.
Assisted-by: Antigravity
Add truenas-scst-boot.py to keep scst disabled after upgrade
On upgrade the installer enables every unit marked enabled in the
old boot environment's /data/user-services.json. Middleware without
the previous commit recorded scst there as enabled even on HA and in
LIO mode, so the first boot of the new environment could start SCST
before middleware disabled it again.
Add a script for the installer to run chrooted in the new boot
environment, after the database migration and with /proc, /sys and
/dev mounted, as it already does for truenas-hw-license.py. It
disables scst if the system is licensed for HA or the iSCSI mode is
LIO. If it cannot determine either, it reports the error and leaves
scst unchanged.
Warn when SCST is not loaded during standby_after_start
Diagnostic only: retrying to surface cluster_mode cannot succeed if the
SCST kernel modules are not loaded, so log a rate-limited warning.
Keep scst disabled at boot on HA and in LIO mode
On HA, scst must not start at boot; middleware starts it from
vrrp_master / vrrp_backup. It is also unused in LIO mode.
etc_files/systemd.py enforced this when setting unit state, but
two other paths did not:
- The config.on_upload hook (run on the STANDBY by sync_to_peer)
enabled scst just before the STANDBY rebooted.
- /data/user-services.json recorded scst as enabled, so the
installer enabled it in the new boot environment on upgrade.
Add systemd_enabled_units(), which defaults to the service's systemd
units, and override it for iscsitarget to return none on HA or in LIO
mode. Use it in both etc_files/systemd.py (including the JSON it
writes) and on_config_upload. on_config_upload passes the uploaded
database so the iSCSI mode is taken from it, not from the live config.
[HIP] Add preprocessing tests for include path ordering
Add a new test file hip-include-path-preprocess.hip with two
preprocessing tests (-E -P) that verify actual #include resolution,
complementing the command-line flag tests in hip-include-path.hip.
Test 1 (SHADOW): When --rocm-path selects an alternate ROCm
installation, its hip/hip_runtime.h must take precedence over a
same-named header in the sysroot. This is the core bug that the
late-hook fix addresses.
Test 2 (INCLNEXT): When the sysroot has a trailing slash, the
#include_next chain from a C++ stdlib wrapper (cstdlib) must still
reach the underlying C system header (stdlib.h).
Co-Authored-By: Claude Opus 4.6 <noreply at anthropic.com>
[GVNHoist] Call removeMemoryAccess without removing uselist (#241423)
OldMA->replaceAllUsesWith remove all of the members in the use list.
This makes removeMemoryAccess doesn't relink to the new MA. Without
this, the MemorySSA link to the old value as it never triggers
U.set(NewDefTarget);
Asisted-by: Claude # Test