[Clang] Make Unlabeled the default control flow branch label scheme (#223297)
The work on "func-sig" label scheme is discontinued, so it's better to
switch the default to unlabeled at this time.
LowerAtomic: Preserve the volatile flag when lowering atomicrmw and cmpxchg
These utility functions built the replacements without copying the volatile
flag from the original instruction.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[X86] Fix FP `stackifier` crash on invalid `x87` inline `asm` constraints (#221881)
Fixes #149371
When an x87 inline asm uses the stack registers in a layout the FP
stackifier can't model, for example an input tied to `st(1)` while
`st(0)` and `st(1)` are both outputs, the pass reports "fixed input regs
must be last on the x87 stack" and then keeps going as if nothing
happened. It simulates the pops and pushes with counts taken from masks
it has just found to be non-contiguous, so the input never leaves the
stack model and the same register gets pushed again as an output. The
model now holds a duplicate entry, and the next `adjustLiveRegs` trips
"Live count mismatch". The odd `R0` constraint in the report isn't the
culprit, by the way; it resolves to a plain integer register and leaves
the tied `1` as the only x87 input.
Once any of these errors has been reported, the asm is no longer
simulated. The pass pops the inputs the asm kills and pushes its
outputs, which keeps the stack model consistent with what the register
[7 lines not shown]
[MergeFunc] Fix poison flag merging for varargs functions (#223347)
This is a followup to https://github.com/llvm/llvm-project/pull/220015.
writeThunkOrAliasIfNeeded() has an early exit for the case where none of
erase/thunk/alias apply, and we failed to merge the poison flags in that
case. I've opted to fix this by moving the annotation merging logic out
of writeThunkOrAliasIfNeeded() entirely, because I don't think it
logically fits there (it's not related to thunk/alias creation at all).
This is the minimal fix to address the miscompile. There is a potential
larger change we could make here, which is to avoid "merging" the
functions in this case in the first place. We don't actually merge the
functions here, but just rewrite all uses to one of them. This seems
kind of dubious to me, though I could see an argument that this can
still be beneficial in conjunction with --gc-sections (i.e. linker-level
dead function elimination).
clang: Distinguish unspecified from disabled exception model
Add ExceptionHandlingKind::Default so clang can tell an unspecified
exception model from an explicit -exception-model=none.
clang: Emit "exception-model" module flag
Record the exception-handling model as an "exception-model" IR module
flag when it differs from the target triple's default, mirroring how
other target ABI properties are recorded. Adds a
CodeGenOptions::toExceptionHandling helper to translate clang's
ExceptionHandlingKind into the LLVM ExceptionHandling enum.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
IR: Introduce "exception-model" module flag
Add an "exception-model" IR module flag intended to replace
TargetOptions::ExceptionModel, such that the ABI is fully
computable from the IR alone. Add the basic documentation and
verifier/linker tests, but doesn't wire up the consumers.
The main thing I question is whether the single "wasm" model is
really the correct control. With the existing TargetOption,
WebAssembly is overloading "none" in a weird way that sometimes
means default, and sometimes mean forcibly disabled exceptions.
It additionally has -wasm-enable-eh and -wasm-enable-sjlj cl::opts
and I don't fully understand the interaction between all of these
knobs; the cl::opts are even worse than the TargetOptions since
these still change the ABI and are backend private.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[NFC][CrossDSOCFI] Move findCfiTypeIds to LowerTypeTests (#223582)
Move 64-bit numeric type identifier collection logic and
extractNumericTypeId
from CrossDSOCFI.cpp into LowerTypeTests.cpp, exposing it as
lowertypetests::findCfiTypeIds in llvm/Transforms/IPO/LowerTypeTests.h.
Encapsulate Cross-DSO CFI type ID discovery so CrossDSOCFI no longer
directly parses cfi.functions metadata.
PR Stack:
* https://github.com/llvm/llvm-project/pull/223581
* ➤ https://github.com/llvm/llvm-project/pull/223582
Assisted-by: Gemini
disconnect_controlling_tty() is the only thing from sshpty.c used
in sshd, and sshd is the only thing that calls this function.
Move it into sshd.c and we no longer need to compile sshd against
sshpty.c
Part of bz3996 from Colin Watson
ixv: Use host granted RSS queues on Hyper-V
Discover the Hyper-V queue grant through PCI configuration space for
X550, X552, X553, and E610 VFs. The X550 family exposes a byte at 0x207;
0x208 is a separate DCB flag. E610 exposes a little-endian queue count
word at those offsets. Accept grants of one, two, or four and use at most
two symmetric queue sets, subject to the existing MSI-X resource limit.
Keep one queue for invalid grants and for 82599/X540 Hyper-V VFs.
The family gates and queue limits are snooped from Windows Intel VF bus
traffic.
Update the shared code queue max so stop disables every usable queue.
Also program the receive length limit on every usable RX queue instead
of only queue zero and retain the 82599 exception for that register field.
MFC after: 2 weeks
Sponsored by: BBOX.io
Fix ChannelTimeout specificity
Previously a more specific channel type (e.g. "session:shell") could
clobber a user-specified ChannelTimeout if it was less specific
(e.g. "session").
Also, in some cases, the debug messages were printing 0 instead of the
effective timeout.
From Bhagavathiyappan Shanmugam <Bhagavathiyappan.Shanmugam at ibm.com>
via bz3994