TableGen: Reserve per-register lists in RegisterInfoEmitter
The sub-register, super-register and register unit lists of each
register were built one element at a time, although their sizes are
known in advance. AMDGPU has about 20000 registers, so there were a
lot of realloc calls.
Generating AMDGPUGenRegisterInfo.inc executes 0.4% fewer instructions
with 4% fewer page faults. This greatly reduces the time impact with
MALLOC_PERTURB_=1.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[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.