[GlobalISel] Use G_FCONSTANT semantics in getFConstantVRegValWithLookThrough (#236404)
Currently, `getFConstantVRegValWithLookThrough` picked the APFloat
semantics from the bit width alone, so bf16 got read as half and s80
x86_fp80 hit the "Invalid FP type size" unreachable in
getFltSemanticForLLT.
Take the semantics from the G_FCONSTANT instead. If a looked-through
trunc/ext resized the value, fall back to the IEEE type for the new
width, or bail if there is none.
Test changes:
- AArch64: `x * bf16 0xR3C00` (0.0078125, but half 1.0) no longer folds
to x, and `x * bf16 1.0` now does. In bf16-v4/v8 test_reduce_fmul_fast
without +bf16, the start-value fmul now goes away, dropping a redundant
round-to-bf16 sequence.
- X86: s80 `x * 1.0` folds instead of crashing.
- AMDGPU: the gfx1250 wmma bf16 1.0 splat is now an inline imm, same as
SelectionDAG.
RuntimeLibcalls: Use <2 x i64> for i128 libcall types on Win64
Win64 passes __int128 by reference and returns it in XMM0. i128 uses
GPR pairs, and <2 x i64> uses the correct vector register. This
matches the type AtomicExpand and clang uses for these functions.
Also fix AtomicExpand to use the correct type for UEFI (which should
eventually use the type information in RuntimeLibcallsInfo).
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
devel/fifechan: the port had been improved (+)
- Stretch out CMAKE_MINIMUM_REQUIRED() version range
to accommodate for upcoming CMake 4.x and beyond
- Note that version 0.2.0 is available, however not
compatible with current `games/py-fife' port which
is already at its latest version (as of right now)
- Adjust the option knob order and some descriptions
[mlir][scf] Preserve parallel loop results during specialization (#212409)
This PR preserves the results of `scf.parallel` operations during
parallel loop specialization. The generated `scf.if` now has the
original loop result types, and both branches yield the results of their
cloned loops before replacing the original uses.
A regression test covers a result-producing parallel reduction whose
result is returned by the function.
Fixes #205231
Assisted-by: codex
[flang] Cache in flang-licm which locations a loop may modify
Hoisting a load asks the alias analysis whether the loop may modify each
location the load reads, and the answer depends only on the loop and the
location. The loads of a loop read the same few locations over and over, so
flang-licm asked the same question many times: on a large OpenACC region 97%
of the queries of a run repeated an earlier one, and with alias analysis
implementations that are expensive to query the pass took minutes.
Cache the answers of a run, keyed by the loop and the location, in a small
LoopModifiesLocationCache that the pass owns. It is valid for the whole run
because the pass only hoists operations that have no effects or only read: it
never moves a write, so a location that is not modified in a loop does not
become modified in it. Only whether the location may be modified is used, as
before.
-debug-only=flang-licm-cache prints, for each run, how many queries were
answered from the cache and how many asked the alias analysis.
[AMDGPU][NFC] Use Select helpers for more real instruction encodings (#238112)
Replace explicit SIMCInstr, AssemblerPredicate and DecoderNamespace
settings with the Select/Select_vi/Select_gfx6_gfx7 helpers in
SMRD_Real_si, DS_Real_Base_vi, VBUFFER_Real_gfx12, VBUFFER_Real_gfx13
and VOP3be_Real_dpp.
FLATInstructions.td was handled in
https://github.com/llvm/llvm-project/pull/237849
[SelectionDAG] Narrow (shr (sub A, B), 1) to AVGSUBFLOOR (#233635)
Add combineShiftToAVGSUB, which forms AVGSUBFLOORS/AVGSUBFLOORU on a
narrower
type when both operands are known to be extended from it, so the
subtract
can't overflow. This is similar to combineShiftToAVG.
The node is only formed if it is legal or custom on the narrow type or
the original type after type legalization. As long as type legalization
won't change the element type. This covers WidenVector, SplitVector and
ScalarizeVector. This can be relaxed in the future.
Remove the RISC-V P extension truncate combine for (P)ASUB(U) since this
is now handled by the generic combine.
Co-Authored-By: Claude Sonnet 5.5 <noreply at anthropic.com>
[RISCV] Remove X5 from CSR_RT_MostRegs/CSR_RT_MostRegs_RVE (#238090)
X5 is used by the PLT header, register restore libcall, and machine
outlining. I don't think it's practical to preserve it.
Fixes #235751
[lld][MachO] Ignore FDE padding in ICF (#236075)
MC pads each FDE so that it ends at a multiple of its address size, so
the same FDE gets different padding depending on where it starts. ICF
required FDEs to have equal sizes, so identical functions could fail to
fold depending on where their FDEs were placed. Ignore the length field
and trailing DW_CFA_nop padding.
[RISCV][P-ext] Convert Intrinsic::riscv_pmerge to RISCVISD::MERGE in ReplaceNodeResults. (#238140)
Instead of emitting a new intrinsic. This is possible now that we have
patterns for RISCVISD::MERGE that don't use bitcasts to scalar.
Annoyingly the operands are in a different order because RISCVISD::MERGE
matches the operand order of the merge instruction while the intrinsic
takes the operand from RVV's vmerge.
RuntimeLibcalls: Handle int and long size more similarly
Previously we eagerly computed the int size and passed it through all
the various functions to get the type signature. The long cases were
evaluated in the context that need a long. Treat these the same way
which reduces the number of arguments passed around.
[flang][OpenMP] Support for nocontext and novariants clauses for dispatch construct (#227954)
Support for nocontext and novariants clauses for dispatch construct in
flang.
[libc] Use a syscall wrapper for sendfile (#237955)
This PR move sendfile behind the centralized syscall wrappers, following
libc/docs/dev/syscall_wrapper_refactor.md.
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
[libc] Use a syscall wrapper for uname (#237954)
This PR move uname behind the centralized syscall wrappers, following
libc/docs/dev/syscall_wrapper_refactor.md.
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
RuntimeLibcalls: Stop returning an attribute when getting libcall types (#238209)
The attribute half of the pair has been empty since the extension
attributes moved to getIntExtAttr, so return just the type.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>