[CodeGen] Report an error for a direct inline asm output in memory
An inline asm output returned by value has no memory to write to, yet a
constraint such as "=rm" picks memory, the most general constraint, as
does "=m". SelectionDAG asserted on that ("Can only indirectify direct
input operands!"), and GlobalISel dereferenced a null pointer. Clang
never emits such an output, since it passes the address of a memory
output, but other IR can. Report "cannot handle direct memory outputs
yet for constraint 'm'" instead, like the other inline asm errors there.
Assisted-by: Claude Opus 5.5
[TargetInstrInfo] Fix folding inline asm operands next to tied operands
foldInlineAsmMemOperand() swapped a register operand for the target's
memory operands with MachineInstr::removeOperand(), which asserts when a
later operand is tied, because moving it would break the tie. Inline asm
lists every input after every output, so folding any operand that comes
before another tied pair asserted, e.g. an "rm" input followed by the
input of a "+r" operand, or one of two "+rm" operands. Without
assertions, the moved operands kept stale tie indices. Untie the
operands, rebuild the operand list, and re-tie the remaining pairs at
their new positions.
It also gave up when the register appears in more than one operand, e.g.
one value passed to two "rm" operands, which left the greedy allocator
unable to spill that value at all. Fold every such operand into the
stack slot.
Finally, take MayLoad from the folded operands rather than from every
read of the register: a folded def whose tied use is another virtual
[9 lines not shown]
Remove (mostly) redundant run line
The second run line showed that the *printed* form of the numeric flag (1076101129 -> reguse:GR32 foldable) parses back. But the first run line already contains the symbolic syntax, so it may be a bit overkill.
[MIR] Serialize the "foldable" inline asm register operand flag
The symbolic MIR syntax for inline asm operand flags dropped
InlineAsm::Flag's RegMayBeFolded bit, which marks a register operand
(from an "rm" constraint) that the register allocator may fold to a
stack slot. Printing MIR and parsing it back therefore silently changed
what the allocator was allowed to do, e.g. with -stop-before and
-run-pass, and a test could only set the bit through a raw numeric flag.
Print the bit as a trailing "foldable", as MachineInstr::print() already
does, and parse it back. A tied use stores its matched operand number in
the same bits, so it never prints the marker.
Assisted-by: Claude Opus 5.5
Parse 'foldable' in one place and test the class-less form
Replace the ParseOptionalFoldable lambda with a single check at the end of
parseSymbolicInlineAsmOperand by making the ':' constraint parsing
conditional. Add class-less "regdef foldable" and "reguse foldable" operands
to inline-asm-foldable.mir, which take the path without a ':' constraint
that wasn't tested before.
Assisted-by: Claude Opus 5.5
A tied inline asm use is never foldable
A tied use stores its matched operand number in the bits that otherwise
hold RegMayBeFolded. Make InlineAsm::Flag enforce that: setRegMayBeFolded()
asserts the operand isn't tied, and getRegMayBeFolded() returns false for a
tied use. The MIR printer no longer needs to special-case tied uses, so
print 'foldable' independently of 'tiedto' and drop the comments that
explained the shared bits.
Also use F.isMemKind() instead of comparing K in the MIR parser.
Assisted-by: Claude Opus 5.5
AMDGPU: Reserve the callee's scratch rsrc registers for call arguments
When assigning outgoing arguments, the caller reserved its own scratch
resource descriptor register instead of the callee's. For entry functions
this is a placeholder register, and for chain functions it is s[48:51], so
inreg arguments could be assigned to s[0:3] and clobber the descriptor
passed to the callee.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Revert "[LLDB] Remove fallthrough (#216398)" (#232476)
This reverts commit 99690a356c8c059db73786adecd827d7f20e3297.
This commit broke lldb-defines.h. The version defines are never filled
in because the unifdef copy_command overrides calling the
version-header-fix script. This does mean that you can't remove any SWIG
preprocessor macros from lldb-defines right now, but there are none
currently.
devel/libdispatch: fix cpu eating by backport patches from upstream (+)
* Use relative kqueue deadlines for BSD uptime and monotonic timers
* Use eventfd abi instead of pipe2
* Fix typos in workqueue.c
* FreeBSD tid are off by two bits (see lock.h)
* Guard against integer truncation before left shifting [1]
PR: 298758
Thanks to: osa, makc, glebius
Exclude `DebugInfo/MIR/InstrRef/spill-slot-idx-limits.mir` from profcheck (#232491)
Test introduced in PR #225950. By the looks of it, exposes existing
profile propagation issues.
vdev_rebuild: wait for the syncing txg before rebuilding a metaslab
Before a sequential rebuild reads a metaslab, it disables allocations
from it and waits for pending allocations to sync. Later passes of the
syncing txg can still rewrite blocks born in that txg in place: a
rewrite allocates nothing, and the first pass has already moved their
allocations to the space map. A rebuild read which overlaps such a
rewrite sees some columns before it and some after. dRAID then finds
the row's parity inconsistent and withholds its repair, and a read
which completes before the rewrite can write the old block over the new
one on the device being rebuilt.
Wait for the txg that is syncing when the metaslab is disabled. No later
txg can allocate from it, so none can rewrite its blocks in place.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Andriy Tkachuk <atkachuk at wasabi.com>
Signed-off-by: Kamil Monicz <kamil at monicz.dev>
Closes #19198
misc/sesh: update to 2.33.0
Changes in 2.33.0:
* Picker: use the terminal's native cursor in the filter input
* New --no-cache option for sesh list and the picker
* Run startup commands in the correct session
* Fix connecting to sessions with a dot in the name
* Escape # in session names and start directories
[clang][CodeGen] Add release note for EmitDeferred re-emission fix
Follow-up to #223877, which fixed a use-after-free when an already-emitted deferred declaration was emitted a second time. The release note was missed before that PR merged.
[mlir][acc] Add compute kernel launch codegen to ACCToLLVM (#232382)
Add the OpenACCToLLVM lowering of acc.kernel_environment together with
the gpu.launch_func operations it contains. The environment maps its
data operands in an implicit data region around its launches. The entry
call writes the device address of each already mapped operand back, and
every launch passes that address to the kernel as a device pointer.
Each gpu.launch_func becomes a call to the runtime that launches the
kernel, using the async and wait clauses of the environment and sharing
its argument encoding with the data directive lowering.
---------
Co-authored-by: Matsu <kmatsumura at nvidia.com>