[test][ThinLTO] Precommit iFDO test for LowerTypeTests and ICP ordering (#241632)
Add an instrumentation PGO (!VP metadata) ThinLTO backend test for
indirect
call promotion to CFI jump table members. With LowerTypeTestsPass
running
before ICP, the promoted comparisons check @foo.cfi instead of the jump
table
entry @foo.
Needed by #241582.
Assisted-by: Gemini
[flang][OpenACC] Don't crash on unresolved names in DECLARE data clauses (#169500)
When name resolution cannot resolve a name in a data clause of an
OpenACC DECLARE directive, it reports an error (for example "No explicit
type declared for 'm'" under IMPLICIT NONE) and leaves the name without
a symbol. The duplicate-occurrence check for DECLARE clauses then
dereferenced the null symbol and crashed before that error was printed.
All eight data clauses that DECLARE accepts were affected, and the name
could be the enclosing module's name, a misspelled variable or an
intrinsic procedure name.
The check now skips names without a symbol, as the other OpenACC
data-clause checks already do, so only the name-resolution error is
reported.
Fixes #169487
Assisted-by: AI
[KnownFPClass] Avoid the FPClassTest round trip in apply*DenormalMode (#241622)
The contract for `applyInputDenormalMode` and `applyOutputDenormalMode`
is that they only modify zero/subnormal classes. The round trip from
`FPClassMask` to `FPClassTest` via `getKnownFPClasses` and
`setKnownFPClasses` loses information, since `FPClassMask` represents
more information than `FPClassTest` (currently just the sign bit of NaN,
but `FPClassMask` will be able to represent additional classes in the
future).
[ORC] Drop ProxyT parameter from sps::ProxySpec (#241628)
sps::ProxySpec<ProxyT, CI> becomes sps::ProxySpec<CI>: a spec now
depends only on its controller-interface descriptor, and its dispatch
function can serve any Proxy whose argument and result types are
serializable with CI::SPSSig.
ProxySpec::dispatch becomes a function template whose template arguments
are deduced when it is converted to a Proxy's DispatchFn, so existing
uses of Spec::dispatch (including recordProxy) are unchanged. The
callee's return type, which was previously taken from ProxyT, is
recovered from the client-facing result type and the SPS return tag.
The in-tree specs and their uses are updated, as is ORCv2.md.
Export lwp0upa to allow the caller of pmap_bootstrap1() to specify
the physical address for the lwp0 u-area. If left unspecified, the
USPACE-sized region is allocated dynamically, as before.
[lldb] Extract ExternalSymbolResolver from IRExecutionUnit (#241136)
IRExecutionUnit::FindSymbol finds the load addresses of symbols that an
expression refers to but does not define. Despite living on the
execution unit, it is not specific to JIT compilation. It has three
callers: IRForTarget, to rewrite Objective-C constant strings and
selectors; the IR interpreter, to resolve function constants; and the
MCJIT memory manager, to resolve external symbols while linking. The
interpreter uses it even when nothing is JIT compiled.
Move FindSymbol, its five helpers, the file-local LoadAddressResolver
and ResolveFunctionCallLabel, and the state they use (m_sym_ctx,
m_preferred_modules and m_strip_underscore) into a new
ExternalSymbolResolver class. IRExecutionUnit owns one and forwards
FindSymbol and AppendPreferredSymbolContexts to it, so no callers
change.
m_failed_lookups and ReportSymbolLookupError stay on IRExecutionUnit.
They are not part of resolution: each caller decides how to handle a
[11 lines not shown]
[flang] Fix the memcpy function type model for MinGW-w64 (#233251)
`RTBuilder.h` needs a `getModel` specialization for the runtime's
`MemcpyFct` type, `void *(*)(void *, const void *, std::size_t)`, that
matches `std::size_t`. On 64-bit Windows `std::size_t` is `unsigned long
long`, but that specialization was guarded by `_MSC_VER`, so building
flang for MinGW-w64 (windows-gnu) failed to link:
```
ld.lld: error: undefined symbol: mlir::Type (*fir::runtime::getModel<void* (*)(void*, void const*, unsigned long long)>())(mlir::MLIRContext*)
```
Guard it by `_WIN32`, which MSVC, clang-cl and MinGW-w64 all define, and
spell the size parameter `std::uint64_t` instead of the MSVC-only
`unsigned __int64`. On 64-bit Windows `std::uint64_t` is `unsigned long
long`, the same type as `std::size_t` and as `unsigned __int64` under
MSVC, so it still matches `MemcpyFct` while making the 64-bit width
explicit. It has to be unsigned: `std::int64_t` would not match
`std::size_t` on any Windows target. MSVC and non-Windows builds are
[5 lines not shown]
[lldb] Add symbol table state flags, add accessors. (#239451)
A Module's Symtab may be constructed from a DataFileCache symtab, or
from the ObjectFile binary itself. If we have a report of incorrect lldb
behavior from an end user, we may need to know which was the source of
the symbol table via lldb commands or via SB API.
This adds a bitfield `m_state` to Symtab, with getters and setters for
the currently existing fields (set-from-symtab-cache,
set-from-objectfile). It exposes the lldb-enumerations bits via
SBModule. It has `statistics dump` also print if a symtab was
constructed from an object file (it currently only notes if a symtab was
constructed from a DataFileCache symtab file). It adds an option to
`image list`, `-F/--symtab-state-flags` which will show letters for each
bit that is set for the symbol table.
```
(lldb) help image list
-F[<width>] ( --symtab-state-flags=[<width>] )
[33 lines not shown]
AMDGPU: Use ArgRange for builtin constant argument range checks
Replace the manual Sema range checks of constant builtin arguments
with the new ArgRange annotation on the builtin definitions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
clang/AMDGPU: Check constant argument ranges of builtins
These builtins take a constant argument that the IR verifier range
checks on the corresponding intrinsic. Sema didn't enforce this, so
you could write code that failed the IR verifier. Use the new Range
annotation on the builtins to fix this.
This only covers builtins that previously had no range validation at
all. Builtins already checked by the manual switch in SemaAMDGPU will
be converted separately.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
clang: Add ArgRange builtin attribute for constant argument ranges
Many target builtins take constant arguments that must be in a
specific range. These usually correspond directly to the Range
annotation on the IR intrinsic, which the verifier enforces. Today
this requires manual verification with a large builtin ID switch in
Sema, and missed cases will emit code that fails the IR verifier.
Add an ArgRange<Index, Lo, Hi> builtin attribute declaring that a
_Constant argument must be in the half-open range [Lo, Hi), the same
as the IR declaration.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
ixgbe: Restore EEE exclusion for X550EM_X KR
X550EM_X KR devices do not support EEE and have no setup_eee operation.
The shared-code update restored the capability removed by d61b6a41dd30,
and the E610 EEE support subsequently added an unchecked call during
attach. Together these changes allow a NULL function pointer call when
attaching a KR device.
Remove the incorrect EEE capability and use the NULL-safe ixgbe_setup_eee()
wrapper when enabling EEE at attach.
Removing the unsupported capability also stops exposing eee_state and the
eee.tx_lpi_count and eee.rx_lpi_count sysctls on X550EM_X_KR devices.
Fixes: f72de14ea132 ("ixgbe: update if_ix and ixgbe api with ix-3.3.38 changes")
Fixes: 13ee84c591f8 ("ix(4): Add EEE support for E610 adapters")
MFC after: 1 week
Sponsored by: BBOX.io
[LoongArch] Support memcmp expansion for vectors and combine for i128/i256 setcc
This commit enables memcmp expansion for lsx/lasx. After doing
this, i128 and i256 loads which are illegal types on LoongArch
will be generated. Without process, they will be splited to
legal scalar type.
So this commit also enable combination for `setcc` to bitcast
i128/i256 types to vector types before type legalization and
generate vector instructions.
Inspired by x86 and riscv.