[MemProf] Enhance -memprof-report-hinted-sizes with post-cloning path… (#234265)
Previously, `-memprof-report-hinted-sizes` (`printTotalSizes()`, which
runs after `assignFunctions()`) only reported the `AllocTypes` of the
leaf allocation node in the abstract CallsiteContextGraph (CCG) for each
context. It did not show the actual cloned call paths or the final
coldness state of the allocation clones that the context reaches after
function cloning.
When function clone assignment goes wrong (e.g. callers above a trimmed
MIB context cloned for another allocation, as fixed by #230351, or
cloned callsites/allocations left pointing at default `NotCold`/`None`
clones), an abstract leaf node can appear `Cold` in the old report while
the actual post-cloning call path loses the cold hint. The detail report
makes such cases visible by showing the real path from each caller
clone.
This patch adds `-memprof-report-hinted-sizes-detail` (off by default;
used together with `-memprof-report-hinted-sizes`). When enabled, it
[25 lines not shown]
[SPARC] Emit correct CFI for leaf procedures with a stack frame (#236588)
A leaf procedure that needs a stack frame allocates it by adjusting %sp
with add instead of executing save. The prologue still emitted the
non-leaf CFI (.cfi_def_cfa_register %fp, .cfi_window_save and
.cfi_register %o7, %i7), describing a register window that was never
created. An unwinder would then take the CFA from %fp and the return
address from %i7, both of which still belong to the caller.
For leaf procedures, only update the CFA offset to account for the
stack adjustment, including the stack bias on SPARC64. The CFA stays
%sp-based and the return address stays in %o7.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Attributor: Deduce noundef returns if poison-generating attributes hold
Instead of giving up on noundef for returns with poison-generating
attributes, check that the attributes are assumed to hold for all
returned values. This uses the Attributor's own deductions for the
returned values (AANonNull, AAAlign, AAValueConstantRange and
AANoFPClass), so e.g. a range only known from a callee is enough.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Attributor: Don't infer noundef returns with poison-generating attributes (#231796)
Returning a value that violates an existing return attribute results
in poison. AANoUndef did not account for this and could mark such
returns noundef. Give up on returns with poison-generating attributes.
Unlike FunctionAttrs, this does not try to prove that the attributes
hold for the returned values. This loses 2 of 3 noundef returns that
would have been proven over CTMark with -attributor-enable=full, and
no call site attributes. In the future it should check if they can be
preserved for parity with functionattrs.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Passes] Wire up CFIFixup into NewPM (#237484)
Not sure how this got missed. This has been in TargetPassConfig for
quite a while, and this patch mirrors it in the base CGPB.
[AArch64][PowerPC][RISCV] Ignore debug instructions when trimming stackmap shadows (#219756)
Debug instructions do not emit code and therefore must not consume
stackmap
shadow bytes.
The AArch64, PowerPC, and RISC-V `LowerSTACKMAP` implementations scan
subsequent fixed-width instructions to determine how many NOP bytes are
still
required. Previously, `DBG_VALUE` stopped this scan, while other debug
instructions such as `DBG_LABEL` were incorrectly counted as encoded
instructions. This could either inhibit shadow optimization or underfill
the
requested shadow.
Skip all debug instructions without decrementing the remaining shadow
size.
Add `DBG_LABEL` and `DBG_VALUE` regression coverage for all three
targets.
[4 lines not shown]
RuntimeLibcalls: Describe vector FuncArgTypes by element type and count
Define the vector libcall argument types from an element type and
count. Derive the matching integer and mask vector types from them
instead of spelling each one out.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[MSan][Test] Add baseline test for llvm.experimental.vector.extract.last.active (#237415)
This is a baseline test before patching
https://github.com/llvm/llvm-project/pull/233552.
This test shows vector.extract.last.active is being handled strictly.
Assisted-by: Gemini
[NVPTX] Use target nodes for clz.b64 and popc.b64 (#236435)
Since #130668, 64-bit ctlz and ctpop are lowered to an i32 ctlz/ctpop of
the i64 operand. DAG combines assume the result is as wide as the
operand, so e.g. `__builtin_clzll(x | 1) >> 5` gets folded to 0, and
some compares of a 64-bit cttz hit an assertion. Use NVPTX-specific
nodes for clz.b64 and popc.b64 instead.
Fixes #235271.
Assisted-by: Claude Code (Claude Opus 5.5)