[NVPTX] Mark SMUL_LOHI and UMUL_LOHI as Expand for v2i16 (#225808)
`SMUL_LOHI` and `UMUL_LOHI` were inadvertently left as `Legal` for
`v2i16` in NVPTX, despite the backend having no instruction patterns to
select them. As a result, the vector legalizer expands `v2i16`
high-multiplies (`mulhs`/`mulhu`) and constant divisions into `v2i16`
`smul_lohi`/`umul_lohi` nodes instead of scalarizing them into `i16`
operations, causing an instruction selection crash. Marking both
operations as `Expand` for `v2i16` ensures they are properly scalarized.
Assisted-by: Gemini
---------
Co-authored-by: Yonah Goldberg <ygoldberg at nvidia.com>
[libc][math] Use float-only evaluation in asinbf16 and acosbf16 (#228734)
Update `asinbf16` and `acosbf16` to use a shared `float` polynomial
instead of the double-precision `asin_eval` helper. Reuse the polynomial
coefficients from `asinf16`.
For small `acosbf16` inputs, return pi/2 rounded to `bfloat16` before
squaring the input or evaluating the polynomial. This avoids spurious
underflow from intermediate products.
Related: #202079
Assisted-by: GPT-6-Astra
Update wineh-empty-seh-scope.ll for the Windows trap change
An unreachable that does not follow a call no longer traps, so the empty
function gets the generic zero-length function nop, as on X86.
X86: Preserve dead flag when expanding MOV32ri64
The expansion narrowed the dead 64-bit def to a dead 32-bit def, but
added a live implicit-def of the 64-bit register. This avoids failing
a future verifier check.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Clang] [CUDA] Follow ctor/member initializers in DeferredDiagnosticsEmitter (#232044)
We are currently ignoring the fact that a constructor invocation also
runs constructor/member initializers, which causes us to miss some
diagnostics about `__host__`/`__device__` mismatch. Inherited constructors
are likewise not handled correctly.
This patch fixes both.
Fixes #118415.
Assisted-by: Codex
[SampleProf][test] Precommit test to demonstrate the duplicated vtable error upon repeated profile read. (#232461)
Extend test case in #231339 with a vtable type record to surface the
duplicated vtable warning message
warning: Duplicate vtable type _ZTV4Base at the same location.
Additional
counters will be ignored.
This is how the doubled head/body samples documented in #231339 were
first noticed.
Assisted by: Claude
[DAGCombiner] Narrow truncating stores of extended values (#231338)
Previous code did `truncstore(extend(x)) -> store(x)`. This patch adds
the following combine: `truncstore(extend(x)) -> narrower_truncstore(x)`
to get rid of the extension in more cases.
[flang][OpenMP] Switch clause verification to descriptor-based
Delete all the scattered pieces of clause verification that are now
replaced by the unified handling.
[flang][OpenMP] Improve diagnostics about modifier properties
Use OpenMPDeprecated and OpenMPFuture warning categories for modifier
diagnostics as well, analogously to how they are used for clauses.
[flang][OpenMP] Account for using different versions for modifier checks
When a modifier from a past/future version is accepted, use its properties
from the nearest version in which it is allowed.
[flang][OpenMP] Create generic interfaces for "container" entities
In short, clauses are containers of modifiers, and directives are
containers of clauses. With the abstractions in place, clauses and
modifiers look almost the same from the point of view of syntactic
properties.
Use these functions to implement generic GetAllowedElements and
GetElementVersionRange functions.
[flang][OpenMP] Properly use GetAllowedElements
Allowed elements are not just those explicitly listed, but also those
from the union of allowed sets.
For example, the set of modifiers allowed on a clause are those that
are listed on a given clause, plus the union of all modifier sets that
the clause allows.
[bazel][libc] Add __support_math_expf_float_utils target (#232450)
9dc80b90f811 (#231671) added src/__support/math/expf_float_utils.h and
included it in src/__support/math/expf_float_eval.h without updating the
Bazel overlay.
[AMDGPU] Encode op_sel_hi as zero for the V_PK 64-bit instructions (#230662)
VOP3P defaults unused op_sel_hi bits to one, but the gfx1251 64-bit
packed instructions have no op_sel and SP3 encodes those bits as zero.
Add a ZeroOutOpSelHi bit on VOPProfile and InstSI, set it on the V_PK
64-bit profiles, and honor it in VOP3Pe and in AMDGPUMCCodeEmitter via the new
AMDGPU::zeroesOutOpSelHi() query.
Fixes: LCOMPILER-2952 (partially)
[CIR] Only load ACC/OMP dialect if they are enabled. (#232434)
This reduces the overall instr count of a ClangIR build without these
languages by ~6%, which seems worth-while.
We DID have to unconditionally load the LLVMDialect, as we previously
were only getting it via the OpenACC dialect transitively.
AArch64: Move the Windows trap after noreturn calls into the AsmPrinter
With Windows unwind info, the unwinder finds the function or funclet
for a frame from its return address, so a call must not be the last
instruction of one.
This was hackily handled by overwriting TrapUnreachable in the
TargetMachine constructor which inserts traps after every
unreachable. X86 handles the same problem by padding calls in the
AsmPrinter, so do the same here: emit a trap only after a noreturn
call that would end a function or funclet. This addresses the FIXME
about eliding the trap when the next instruction is in the same
region, so noreturn calls in the middle of a function no longer get a
trap.
This removes one of the last obstacles to removing ExceptionModel from
TargetOptions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[SLP] Reject reused non-schedulable copyables in the other build order (#231624)
#231598 fixed #231525 for one build order: it rejects a bundle whose
real element is already a non-schedulable copyable element of another
node in the block. The same conflict also arises when the node with the
real element is built first. A later node then models the
already-vectorized scalar as a non-schedulable copyable element, and its
operand gather reuses the scalar from the first node's vector. Nothing
orders the two nodes, so on main that reuse can still land before the
vector is defined.
`@test_reverse_order` is the reproducer from #231525 with the operands
of the two adds swapped. On current main it still fails with
"Instruction does not dominate all uses!". This patch rejects such
bundles as well.
On current main (with #231598), the full Julia module that #231525 was
reduced from still fails verification at -mcpu=znver4, znver5 and
[2 lines not shown]