[BasicAA] Don't look through llvm.ptrmask in GEP decomposition (#197082)
DecomposeGEPExpression() looked through llvm.ptrmask via
getArgumentAliasingToReturnedPointer(Call, MustPreserveNullness=false).
ptrmask preserves the underlying object but can change the byte address
by clearing low bits, so treating its result as having the same symbolic
offset as its argument produces stale offsets and bogus NoAlias answers.
The bug was introduced by 3f2850bc606c847075673554fe49d4a35f525b61.
Rename MustPreserveNullness to MustPreserveOffset, the property
DecomposeGEPExpression actually needs. Offset preservation is strictly
stronger than nullness preservation, so existing callers remain correct
and the accepted intrinsic set is unchanged (ptrmask stays excluded).
switch DecomposeGEPExpression to pass MustPreserveOffset=true. Every
call site is now tagged with MustPreserveOffset=.
[DAG] visitBITCAST - fold (conv (scalar_to_vector(load x))) -> (load (conv*)x) (#196978)
Legalization can leave superfluous scalar_to_vector nodes with the
scalar bitwidth matching the vector bitwidth - peek through these when
attempting to bitcast folds
Only one match in trunk at the moment, but there are some additional
folds encountered in #149798
[LLDB] Simplify the API of ClangUserExpression::ScanContext [NFC] (#197037)
- this function is a virtual function, but it is called by the leaf
class ClangUserExpression
- it also returns a Status only to then report any error as a warning
This patch devirtualizes the function, since there is use-case for
overloading it in other expression evaluator plugins, and it cleans up
the Status usage by passing in DiagnosticManager directly, like its
sibling functions do.
[DAG] canCreateUndefOrPoison - fmaxnum/fminnum/fmaximum/fminimum/fmaximumnum/fminimumnum don't create poison (#197195)
Test coverage is proving tricky due to lack of folds that work with these - I'm open to suggestions if we don't want to just eyeball this.
[clangd] Avoid crash on pseudo-destructor selection (#195939)
clangd crashes during textDocument/codeAction on valid pseudo-destructor
expressions like y->~decltype(A())(). The bug is in
Selection.cpp::earlySourceRange(), which assumes destructor names always
have NamedTypeInfo. The fix is adding null checks before calling
getTypeLoc().
Fixes #195788.
SymbolizableObjectFile: Fix Wasm test to avoid layering violation (#193574)
Tests for LLVM libraries should not require wasm-ld. It's not necessary
in this case to generate the binary at test time, so instead check in a
YAMLized pre-linked binary.
libzfs_pool: document export and initialize functions
Add brief docstrings to zpool_export(), zpool_export_force(),
zpool_initialize() and zpool_initialize_wait().
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18514
Consistently encode DRR_BEGIN packed nvlist payloads with NV_ENCODE_XDR
Currently, zfs send generates a mix of nvlist encodings in DRR_BEGIN
records, some XDR and some in native byte order. The result is that
most streams currently can't be zfs received on opposite-endian systems.
zfs send generates the outer wrappers for compound streams in userspace,
and it explicitly requests NV_ENCODE_XDR format for those records. But
the BEGIN records for individual datasets are generated on the kernel
side, in dmu_send.c, where fnvlist_pack() is used for encoding. That
routine hard-wires NV_ENCODE_NATIVE format.
This PR replaces the fnvlist_pack() call with a direct call to
nvlist_pack() that specifies NV_ENCODE_XDR.
Tests are included to verify that native-encoded nvlists are not
generated by any kernel path that attaches nvlists to BEGIN records.
There's also a check for XDR encoding in the outer wrapper of
replication streams in case there is ever a regression there.
[15 lines not shown]
NAS-140975 / 27.0.0-BETA.1 / use truenas_pydmi module (#18937)
The old module was fork+exec'ing to `dmidecode` and parsing the text
(with fragility) output. The new module reads the DMI information
straight from sysfs which the kernel provides for us. Furthermore, the
other module has GitHub CI tests to catch any obvious regressions and
the ability to add more DMI fixtures so testing can be done when we do
run across the inevitable BIOS version that doesn't conform exactly to
industry standards. Tests come back clean.
zap: internal interface cleanup
Similar to previous, though a much lighter touch because these are not
"public" interfaces.
- reorganising functions into groups, by rough function class.
- matching header order to source order, to make it a little easier to
find things.
- adding light documentation to functions that had none.
Note that I've not added any documentation for the mzap_* and fzap_*
functions, as part of this commit series is laying the groundwork to
hide those functions in their backend modules; such documentation would
become obsolete very quickly.
No actual code changes.
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
[4 lines not shown]
zap: public interface cleanup
- reorganising functions into groups, collections of the variants of the
same function.
- matching header order to source order, to make it a little easier to
find things.
- moving per-function documentation from source to header.
- adding light documentation to functions that had none.
No actual code changes.
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Akash B <akash-b at hpe.com>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18516
zap: split implementation out into more files
The ZAP code is mixed up across a few files without clear separation of
concerns. This splits it out from three source files to five:
- zap.c: the bulk of the "public" interface
- zap_impl.c: internals shared across all backends
- zap_micro.c: microzap backend
- zap_fat.c: fatzap backend: core logic
- zap_leaf.c: fatzap backend: leaf blocks
Note that this doesn't not change any code, just moves functions around.
Also note that right now the microzap and fatzap backends know more
about each other than is healthy. This change is simply marking out
where different things should live in the end, to make it easier for
that refactoring work to begin.
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
[4 lines not shown]
[GVN][NVPTX] Rename PRE flag to ScalarPRE, disable option in NVPTX (#190386)
Scalar PRE in GVN may cause performance issues in the NVPTX backend
by increasing register pressure. This PR renames the enable-pre flag to
enable-scalar-pre and updates its usage to cover an additional case of
scalar PRE being performed. The newly renamed option is also used to
disable scalar PRE for NVPTX.
Active Directory: fix rejoin, harden reset/recover, improve diagnostics
SAF cache stores {host, ip} dict (host captured via a fresh CLDAP ping to
the chosen kdc_server IP, so the pair authoritatively identifies one DC).
_saf_kdc_name uses the cached host directly, avoiding RDNS in samba's
--server flag and the krb5.conf kdc= override. activate_standby accepts
both the legacy single-string IP and the new dict form for HA mixed-version
upgrades.
_health_check_ad runs _test_machine_account_password only as a refinement
of a failing WBClient.ping_dc(). No krb5.conf churn on healthy systems;
AD_SECRET_INVALID fires only when ping_dc has already failed AND the
password test confirms a credential mismatch (PREAUTH_FAILED). The temp
krb5.conf the test writes now mirrors the system config (rdns=false,
dns_canonicalize_hostname=false, NAS-138687) and is restored via a finally
block so KRB5Error doesn't leave the system config polluted.
_recover_secrets typo fix: KRB5_PREAUTH_FAILED -> KRB5KDC_ERR_PREAUTH_FAILED.
The wrong constant meant the credential-mismatch arm was previously
[18 lines not shown]
[NFC][LLVM][VPlan] Fix "parameter ‘P’ set but not used" warning. (#197194)
For Is... = {} the fold expression short-circuits to true and does not
evaluate P.