[IRBuilder] Remove custom insertion point type (#228117)
Historically, insertion points had to be represented as pairs of
BasicBlock and BasicBlock iterator, because an end() iterator did not
know which block it belongs to. This has changed some time ago (I think
as part of the debuginfo records change) and BasicBlock iterators now
have a reference to their parent block. So the canonical representation
of an insertion point is now just a BasicBlock iterator.
This makes the `IRBuilder::SetInsertPoint(BasicBlock::iterator)` API
handle end() iterators correctly (but still keeping the API with a
redundant block argument) and replaces the `IRBuilderBase::InsertPoint`
type (which was a pair of block and iterator) with a plain
`BasicBlock::iterator`.
This requires surprisingly many changes because IRBuilder insertion
points are heavily used in the OpenMP building. A small number of
non-mechanical changes were needed because the code was sometimes
relying on the fact that nothing enforced that the block and iterator
[2 lines not shown]
[VPlan] Preserve the branch weights of scalarized selects. (#224968)
Update VPlan to also carry !prof for select instructions from original
IR. They are threaded through like for branches, and dropped for wide
selects.
This is part of addressing the remaining profcheck failures in
LoopVectorize: https://github.com/llvm/llvm-project/issues/161235.
PR: https://github.com/llvm/llvm-project/pull/224968
[lldb-dap][test] Migrate server mode tests (#227804)
Migrate TestDAP_server.py to the new lldb-dap test infrastructure.
test_server_port and test_server_unix_socket now run two sessions
concurrently.
Add test_breakpoints_in_multiple_sessions to check that a breakpoint set
in one session must not stop another.
Fix test_connection_timeout_at_server_start. It now waits for lldb-dap
to exit on its own before the teardown kills it.
The test now takes significantly less time.
CodeGen: Prefer getting the Triple from the Module when convenient
Take the triple from the contextual module rather than TargetMachine
when it's already readily available.
[clang][AST][NFC] Remove an overload of `ASTTemplateKWAndArgsInfo::initializeFrom` (#227942)
The FIXME comment on this overload:
```cpp
// FIXME: The parameter Deps is the result populated by this method, the
// caller doesn't need it since it is populated by computeDependence. remove
// it.
```
[Flang-RT] Skip SIGFPE tests under WSL1 (#227876)
The floating-point exceptions do not work under WSL1 because the SIGFPE
trap does not propagate to the application
(https://github.com/microsoft/WSL/issues/3657). Mark these tests as
UNSUPPORTED for wsl1.
The Subsystem For Windows detection mechanism is the same as for LLVM
(#137822).
DAG: Gracefully diagnose missing floating-point state libcalls
Previously makeStateFunctionCall would hit a fatal error if the target has
no fegetenv/fesetenv/fegetmode/fesetmode implementation. Report a proper
context error and emit nothing.
Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
[Flang-RT] Skip SIGFPE tests under WSL1 (#227876)
The floating-point exceptions do not work under WSL1 because the SIGFPE
trap does not propagate to the application
(https://github.com/microsoft/WSL/issues/3657). Mark these tests as
UNSUPPORTED for wsl1.
The Subsystem For Windows detection mechanism is the same as for LLVM
(#137822).
[flang][OpenMP] Improve check for LINEAR and ORDERED with argument (#228235)
The LINEAR clause is not allowed on a construct if an ORDERED clause
with an argument is present. The new message is clearer about the
argument to the ORDERED clause.
[CIR][AMDGPU] Drop stale logb FIXME in amdgcnspirv-builtins.hip (NFC) (#228404)
#228004 made CIR emit nsw add and ordered compare for logb, so update
the SPIR-V checks to match
Fix failure appeared on main branch
DAG: Gracefully diagnose missing fp-compare libcall when softening
Avoid fatal errors, and legalize to poison with a proper context
error.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
CodeGen: Fix stale live range for undef PHI sources on split edges (#228057)
SplitCriticalEdge collects the PHI sources coming from the new block so
the trimming loop below does not undo the segment just added for them.
An undef operand gets no segment, but was still added to the set, so a
register that is only an undef PHI operand on the split edge kept the
stale extension of its live range through the new block.
Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
[clang-repl] Fix PTX emission for CUDA inputs with no device code (#226977)
Previously, GeneratePTX() returned an error when PassManager::run()
returned false. That value reports whether any pass changed the module,
not whether emission succeeded. IIUC, addPassesToEmitFile() should be
the only failure point, which is already checked.
The check was harmless until e8b75c172810 ("[NVPTX] Add NewPM
boilerplate to NVPTXAssignValidGlobalNames"). Before it, that pass
returned true unconditionally (if the pass succeeded), so run() always
reported a change. Now a device module without a function definition,
produced in the case of host-only inputs, reports no change and fails
the check, falsely erroring out with `Failed to emit PTX code.` Due to
this, every host-only input to `clang-repl --cuda` is now rejected on
main. The host-supports-cuda lit probe consists mostly of such inputs,
so clang/test/Interpreter/CUDA reports UNSUPPORTED instead of failing.
I've also added a test with host-only inputs so a regression like this
could be caught.
[offload][omp] Move OpenMP KLE to libomptarget
Move preparations related to OpenMP KLE and
dynamicCGroupMem fallback out of the plugins and
into libomptarget.
Resructure Device::launch as it grew too large.
[BOLT] Support SHF_COMPRESSED DWARF debug sections. (#215835)
**Before:** BOLT will report an error when `--update-debug-sections` is
enabled and the input contains a `SHF_COMPRESSED` debug section, stating
that "`--update-debug-sections` requires uncompressed debug
information". This was implemented in #185662.
**After:** This patch follows up on this PR and adds support for
`SHF_COMPRESSED` debug information. BOLT now can decompress `zlib` /
`zstd` compressed debug information, update them and then recompress
with their original compression. This patch also validates compressed
debug sections, reporting an error if applicable. As mentioned in
#185662, legacy GNU-style compression is not handled.
Assisted-by: Codex
[Offload][L0][NFC] Remove unused zexKernelGetArgumentSize dispatcher (#227589)
The KernelGetArgumentSize dispatcher is loaded during context init but
never called.
#218367 converted it to a ZeDispatcher but also removed its only
callers.
Argument sizes are now either not needed
(zeCommandListAppendLaunchKernelWithArguments) or come from
LaunchArgs.ArgSizes on the fallback path, so the driver query is no
longer used(other than debug printing).
This removes the now dead optional API declaration, the dispatcher
member, its loadExperimental call and the related debug output.
Not tested on actual GPU hardware however the plugin builds without
error(which I think should be sufficient check).
AI was only used in a review on unrelated changes which noted this dead
code.
DAG: Gracefully diagnose missing FMA and ppcf128 expansion libcalls (#228094)
Previously this would hit a fatal error. Legalize to poison and report a proper
context error.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>