[CIR] Enable x86_64 calling-convention lowering by default (#215026)
x86_64 calling-convention lowering has been opt-in behind
`-clangir-enable-call-conv-lowering` since it landed, so nothing reaches
the pass unless a test asks for it. The ClangIR default path therefore
emits high-level signatures that do not match SysV: a 32-byte struct
return stays first-class instead of going out through `sret`, and a
one-eightbyte struct argument is passed as a record instead of being
coerced to `i64`.
This change turns the pass on by default for x86_64 and renames the flag
to a `BoolFOption` pair, `-fclangir-call-conv-lowering` and
`-fno-clangir-call-conv-lowering`. The last flag on the command line
wins, so a build can disable the pass globally and re-enable it for one
translation unit.
Flipping the default breaks 147 of 949 CIR tests. 37 tests are CHECK
regenerations where lowering moved toward classic CodeGen. 110 tests are
quarantined by adding the disable flag to the RUN lines that turn the
[12 lines not shown]
[SimplifyLibCalls] Shrink llvm.sincos.f64 to llvm.sincos.f32 (#211218)
The double -> float shrink in LibCallSimplifier::optimizeCall only knows
about Intrinsic::sin and Intrinsic::cos, so once InstCombine combines a
sin/cos pair into llvm.sincos the fpext/fptrunc pair is left in place
and the work is done at double precision.
Handle Intrinsic::sincos too, behind the same UnsafeFPShrink gate. It
needs its own helper rather than optimizeDoubleFP because sincos returns
a struct: the results are read back through extractvalue instead of
being used directly, and the narrowed call has to be rebuilt as a
struct. InstCombine folds the resulting extractvalue/insertvalue pairs
away, so the sin/cos pair in the reported case now ends up as a single
llvm.sincos.f32 call.
NOTE: reported as a 2-2.5% regression on SPEC17 526.blender with -flto
-ffast-math on neoverse-v2 in #194616.
Assisted-by: Opus 4.8
[libc++][CI] Add a cron job to trigger benchmarking jobs (#212859)
This patch introduces a GitHub workflow that runs on a schedule and
determines which benchmarking jobs to trigger to fill the LNT instances
with performance data.
As a drive-by, it also consolidates the information describing libc++
LNT machines into a single JSON file.
The added cron workflow will run every hour, but since the benchmarks
typically take more than an hour to run, it is expected that some of
those triggers will not actually trigger new jobs.
[Test][CAS] Fix PluginCASTest DLL discovery on Windows multi-config generators and MinGW config (#215099)
The test was computing the plugin path by walking up 3 directory levels
from the test executable to reach the build root, then appending
bin/CASPluginTest.dll. This fails on MSVC multi-config builds where an
extra Release/ subdirectory exists. Place the plugin library next to
the test executable instead, matching the pattern used by the Passes
plugin tests.
Also fix MinGW config, in mingw build configurations, the plugin is
named libCASTestPlugin.dll, while it resides in the bin directory.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[ORC] Reimplement EPCGenericDylibManager on RTBridge proxies (#215256)
Reimplement EPCGenericDylibManager's open/resolve operations using
rt::Proxy objects rather than direct
ExecutorProcessControl::callSPSWrapper* calls, bringing it in line with
the other RTBridge-based executor accessors. Behavior is unchanged; the
public open/lookup surface is the same aside from the removals noted
below.
Implementation details:
* The SymbolAddrs struct (three ExecutorAddrs) becomes Bindings: the
manager instance address plus rt::Proxy handles for open and resolve.
Bindings members are protocol-agnostic, so a client can build their own
for another protocol and pass them to the constructor; Create resolves
them via buildProxies against a JITDylib / the bootstrap JITDylib.
* open/resolve return SPSExpected, so this relies on the proxy layer's
Error/Expected support to deliver a single flattened Expected, replacing
[14 lines not shown]
[Hexagon] Fix reg class for C2_cmoveit/cmoveif cext lowering (#212911)
HexagonConstExtenders::getDirectRegReplacement mapped C2_cmoveit and
C2_cmoveif (32-bit predicated immediate moves into IntRegs) to A2_tfrpt
/ A2_tfrpf - the 64-bit DoubleRegs predicated transfers. When the
const-extender pass found a shared extended immediate profitable to
hoist into a register, it rewrote
%d:intregs = C2_cmoveit %p:predregs, #imm
into
%d:intregs = A2_tfrpt %p:predregs, %hoisted:intregs (BAD)
producing a paired-register transfer with IntRegs operands and tripping
the machine verifier:
Bad machine code: Illegal virtual register for instruction
Expected a DoubleRegs register, but got a IntRegs register
[9 lines not shown]
[SandboxVec][SeedCollector] Fix seed insert if can't determine mem access distance (#213807)
Up until now we would insert a memory instruction in a MemSeedBundle
even if we could not determine the access distance against the existing
bundle instructionss. This was causing a crash in the invocation of
upper_bound() as the vector could no longer be partitioned.
The fix is to extend the functions that check the memory access ordering
to return nullopt when the access difference can't be determined.
[lldb] Use StringRef when creating Listeners (#214863)
This is primarily motivated to remove the last ConstString from
Debugger.cpp. It would have been possible to write this change without
changing Listener, but then I noticed a few places where we would have
benefitted from changing the interface.
[docs] Finish MyST migration for selected LLVM docs (#214618)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is a stacked PR based on #214616 , which will be a standalone
commit that
renames *.rst -> *.md before this PR lands for history preservation
purposes.
This was prepared with rst2myst plus LLM-assisted cleanup. I paged
through all the generated HTML looking for migration artifacts, and all
of the differences I could find appear to be formatting error
corrections.
[docs] Rename selected LLVM docs to Markdown (#214616)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is the initial straight rename commit. It will probably break the
docs build, but it has to be a separate PR for blame preservation
purposes.
[CIR] Route MLIR diagnostics through clang::DiagnosticsEngine (#199297)
Install a scoped MLIR diagnostic handler on the CIRGenerator's
MLIRContext that translates mlir::Diagnostic severity and location to
clang diag IDs and SourceLocation, so CIR pass / verifier / lowering
errors surface in clang's standard format and respect -W/-R flags.
Disable MLIR multithreading on that context (DiagnosticsEngine is not
thread-safe). Gate the generic CIR-to-CIR fallback errors on
hasErrorOccurred() to avoid double-printing alongside specific routed
diagnostics.
[OpenACC] Don't generate a call to emitStmt if we don't have one. (#215387)
OpenACC assumed that the statement it got when parsing the associated
statement would either be an error or a valid statement. However, there
are some cases where a statement does nothing where we don't bother to
generate a statement object at all. This patch makes the OpenACC codegen
tolerant of that.
Fixes: #215246
[Flang][OpenMP] Generate maps for allocatable components of privatized symbols for target offload (#214015)
Currently we do not generate maps for allocatable components of derived
types for privatized derived type symbols, this can be a problem when
the variable requires initialization from the original copy, as the
device will try to perform initialization and the data will not be
present to do so. This causes a runtime memory access error on device.
Some example code that can trigger this:
type :: btype
real(kind=8),allocatable, dimension(:) :: a
end type
!$omp target teams distribute parallel do firstprivate(b)
This does not apply to pointers as they aren't mandated to be
initialized as allocatables are at the moment I believe when they're
sub-objects. But it does apply to allocatables where initialization and
copy blocks are generated.
[4 lines not shown]
[flang][AIX] Diagnose unsupported OBJECT_MODE setting and -maix32 option (#209919)
This patch is to align flang's default behavior to the other tools in
toolchain on AIX. Flang assumes 32-bit compile by default. The compile
mode can be overridden by setting environment variable OBJECT_MODE=64 or
specifying the -maix64 option.
[CIR] Change the 'inline_kind' enum to have an explicit attribute (#215335)
If we use the builtin automatic inline-kind here, we don't get to have
it printed reasonably/normally. This patch adds the
'genSpecializedAttr=0' and adds an explicit attribute so we print it as
an enum value.