Revert "kern: Fix write-open "." or ".." to return EISDIR instead of EEXIST"
This reverts commit d5838e7c8154895375e3f278fa0c03a2b913132c.
That change broke mkdir() and maybe others, causing them to return
the wrong EISDIR instead of EEXIST. For example:
```
% mkdir .
mkdir: .: Is a directory
```
We'll need to fix the original issue in another way.
Reported-by: swildner, mneumann
setutxdb(3): Support UTX_DB_LASTLOGX to read last login records
Before this fix, setutxdb(3) returned EINVAL for choosing
UTX_DB_LASTLOGX, so getutxuser() was unable to get last login records
from the lastlogx(5) database. This exact problem caused sshd(8)
failing to print the 'Last login' message on login.
Fix setutxdb(3) to support UTX_DB_LASTLOGX. Note that the lastlogx(5)
database is a Berkeley DB hash keyed by uid and uses the 'lastlogx'
struct.
Assisted-by: DeepSeek-v4.1-flash (with Pi Coding Agent)
[mlir][LLVM] Add ignore_denormal_mode UnitAttr to LLVM::AtomicRMWOp (#217588)
Add an `ignore_denormal_mode` unit attribute to `llvm.atomicrmw`. It
maps 1:1 to the target-independent `!atomic.ignore.denormal.mode`
instruction metadata (#217585): export attaches the metadata when the
attribute is set, and import sets the attribute when the metadata is
present.
The metadata tells the backend that the atomic may ignore the function's
denormal mode, so a native atomic instruction with fixed denormal
behavior can be used instead of a CAS loop. AMDGPU already honors it,
and NVPTX does as of #217586. Until now MLIR could only produce it on
AMDGPU, through the discardable `rocdl.ignore_denormal_mode` attribute.
That leaves frontends like XLA with no way to request it for NVPTX, and
forces target-specific code for something that is target-independent in
LLVM IR.
The attribute is modeled like `volatile_`: an inherent unit attribute
with an optional `ignore_denormal_mode` keyword in the assembly format
[12 lines not shown]
RegAllocGreedy: Skip redundant hint recoloring walks
Each broken hint starts a walk over its copy-connected registers. When
many broken hints share one large component, as happens after PHI
elimination splits many critical edges into a block, the same component
is walked over and over, which is quadratic.
A walk that recolors nothing changes no assignments, so a later walk
from any register it reached would also recolor nothing. Skip those
seeds until the next recoloring.
On a stress test with 4000 split critical edges, Greedy drops from 40.8G
to 3.8G instructions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[InstCombine] Fold fpto[su]i.sat of NaN guarded select
fpto[su]i.sat returns 0 for both NaN and $\pm 0.0$, so a select that
replaces a NaN input with zero does not change the result, and the call
can take X directly.
```llvm
%not.nan = fcmp ord float %x, 0.0
%sel = select i1 %not.nan, float %x, float 0.0
%r = call i32 @llvm.fptosi.sat.i32.f32(float %sel)
-->
%r = call i32 @llvm.fptosi.sat.i32.f32(float %x)
```
The inverted form `select (fcmp uno X, 0.0), 0.0, X` is folded too.
Only the canonical `fcmp ord/uno X, 0.0` is matched, which also covers
`oeq/une X, X` after fcmp canonicalization.
[InstCombine] Add tests for fpto[su]i.sat of NaN guarded select. NFC
fpto[su]i.sat returns 0 for NaN and +/-0.0, so the select is redundant.
Cover ord/oeq/uno/une checks, scalar and vector, and negative cases.
[CIR][HIP][SPIR-V] Emit constant globals in addrspace(1) (#230813)
CIR treated HIP `__constant__` like OpenCL constant, which is
addrspace(2) on SPIR-V
Align behavior with classic codegen
[Mips] Fix R6 floating-point condition register handling (#226838)
Sharing a predicate between R6 floating-point selects can produce copies
between incompatible register classes and crash in copyPhysReg. The
condition classes model both CMP.S and CMP.D results as i32, despite the
instructions writing 32-bit and 64-bit FPRs respectively.
Use ordinary FPR classes for compare results and tied select operands.
Represent the legalized i32 condition with a same-width copy for CMP.S
and a low-word subregister for CMP.D. Insert the condition into the low
word for SEL.D, leaving the unused upper word undefined. This lets
register coalescing handle shared predicates and mixed-precision users,
removing the special condition classes, copy heuristics and
register-flags pass.
Select BC1EQZ/BC1NEZ directly for FP comparison conditions, including
their microMIPS counterparts, and support them in branch analysis. These
branches read bit zero, avoiding a GPR transfer and boolean
normalization. Fold normalization of known 0/-1 masks into zero/nonzero
[14 lines not shown]
[clang][bytecode] Check for invalid record decls when returning a pointer from an evaluation (#230907)
We do allow creating such records for diagnostic purposes, but we
shouldn't allow returning them from an evaluation.
TableGen: Cache resolved class instantiations
The same class instantiation is often referenced many times in one
record, and each reference was resolved from scratch along with
everything nested in its arguments. Cache the results in MapResolver and
RecordResolver, and share them with any TrackUnresolvedResolver wrapping
those.
Gigainstructions executed by llvm-tblgen --null-backend
before after
AMDGPU.td 71.75 18.22 -74.6%
X86.td 6.10 6.15 +0.8%
AArch64.td 3.28 3.32 +1.3%
RISCV.td 8.18 8.26 +1.0%
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
TableGen: Skip resolving values that cannot change (#231083)
Lists, dags, bits and arguments made only of leaf values always resolve
to themselves, but resolving them still walked every element. Record
this when they are created and return early.
Gigainstructions executed by llvm-tblgen --null-backend
| |before |after | |
|-------------|-------|------|------|
| AMDGPU.td |79.12 |71.73 | -9.3%|
| X86.td | 6.25 | 6.12 | -2.1%|
| AArch64.td | 3.40 | 3.28 | -3.7%|
| RISCV.td | 8.34 | 8.19 | -1.8%|
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Fix wrong types of some vector math functions
The f32 x86 libmvec __expf_finite, __logf_finite and __powf_finite
variants were assigned to the f64 libcalls, and amd_vrd4_erf and
amd_vrd8_erf to the f32 ones.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[VectorCombine] Ignore frees when checking dereferenceability for load widening (#218657)
For load widening, we can ignore frees in dereferenceability checks: The
presence of the load proves that the object cannot have been freed.
The only concern here is in-place shrinkage of allocations. In that
case, it could be that the object is no longer dereferenceable for the
wide load type, but still dereferenceable for the narrow load type.
LangRef currently does not allow shrinking allocations. We discussed
whether we plan to allow this in the future in a recent formal spec WG
meeting, and I believe there was a quite strong consensus that we do not
want to allow shrinking allocations in the future. I believe that
follow-up discussions on the Rust side also failed to produce any
compelling use-cases.
So this PR makes use of the fact that allocations can't shrink in
VectorCombine.
[SDAG] Don't expand forceExpandWideMUL to libcall with unsuitable types. (#230522)
When the wide type is legal or the narrow type isn't, emit a wide MUL
and let it legalise normally to avoid setting up the call incorrectly.
This came up while doing more testing with [su]mulh intrinsics. It seems
it could also be triggered with umulfix, for instance.
Fix force_disable_versioning object lock test
## Problem
`sharing.s3.force_disable_versioning` refuses a bucket with object lock by raising a single `ValidationError`, which the API client re-raises as that same class. The test expected `ValidationErrors`, so the refusal escaped `pytest.raises` and the test failed.
## Solution
Catch `ValidationError` and assert on its `errmsg` directly. The latch xattr is now set with `os.setxattr` through `python3` over ssh instead of `setfattr`, following the precedent in `tests/sharing_protocols/smb/test_smb_protocol_base.py`, which sets xattrs on the remote host the same way.