[NFC][Clang][Driver] Simplify return path slicing in addCompDirArg (#247431)
Since CC1Flag is now a parameter, assert that it ends with '=' and
offset by CC1Flag.size() instead of scanning for '='.
Follow-up to #247135.
[Object][Wasm] Initialize functions without a code section (#245486)
`parseFunctionSection` creates `WasmFunction` objects before their code
bodies are parsed. If an object has no Code section, `Comdat` remains
uninitialized, and `obj2yaml` can use it to index an empty COMDAT list
when dumping the linking section.
Value-initialize each function and set its index and `UINT32_MAX` COMDAT
sentinel in `parseFunctionSection`, instead of relying on
`parseCodeSection`. Computing the index there also preserves COMDAT
function indices when imports are present and the Code section is
absent. Keep the existing support for inspecting objects without a Code
section.
Fixes #239399.
[mlir][gpu] Treat memref.copy as non-capturing in barrier elimination (#246902)
getKnownCapturingStatus treated memref.copy as an unknown user, so a
fresh allocation copied into was considered captured and could alias any
memref of unknown origin. This kept barriers that are not needed.
memref.copy only reads and writes the elements of its operands, so mark
it as non-capturing, like memref.dealloc.
Fixes #227542
Assisted-by: Claude Code
[RISCV,test] Improve branch tests under linker relaxation (#247435)
Fix misspelled prefixes in long-conditional-jump.s.
Add +relax tests for long branch with --mc-relax-all.
[SandboxIR][Tracker] Fix bug in SnapshotChecker (#246098)
This patch fixes the issue in Tracker::accept() when not accepting all
that would not update the snapshot tracker leading to false positives in
EXPENSIVE_CHECKS.
[Clang][Driver][NFC] Generalize addDebugCompDirArg to addCompDirArg (#247135)
Generalize `addDebugCompDirArg` into `addCompDirArg`, which takes the
specific option and cc1 flag,
and use it for both `-fdebug-compilation-dir=` and
`-fcoverage-compilation-dir=`.
This prepares for handling `-fsanitize-compilation-dir=` the same way.
Part of #246884.
Signed-off-by: Björn Svensson <bjorn.a.svensson at est.tech>
[CodeGen] Preserve pseudo-probe contexts when matching common tails (#244667)
PR #219502 introduced `haveSamePseudoProbeContext()` to stop the
backward scan at probes or probe-annotated calls from different inline
contexts. The suffix already matched can still be shared when doing so
preserves the probes’ sampling locations. For example, two calls from
different contexts can stay in their original blocks and share a common
epilogue.
1. Tail merging can leave probes behind in the original blocks as seen
in repro: https://godbolt.org/z/6ndooP4oW.
In the repro, the matched suffix is `MOV`, `LEA`, and `RET`. Sharing it
leaves each original block with its own probe and at most a forwarding
jump. Both probes disappear with tail merging enabled and survive with
it disabled.
Branch folding can bypass a forwarding block, and `PseudoProbeInserter`
removes dangling probes from blocks without real instructions. At a
context mismatch, check the prefix that would remain in each block.
Reject the merge if either prefix would contain a probe without real
[31 lines not shown]