[lldb] Add a unit test for Wasm architecture compatibility (#213070)
A Wasm module encodes neither a vendor nor an OS, so ObjectFileWasm
reports a bare wasm32 or wasm64 architecture. That keeps an on-disk
module compatible with the more specific triple a Wasm runtime reports
at launch, which lets the dynamic loader reuse the module instead of
reparsing it from process memory. An over-specified triple, including
one that spells out an unknown vendor and OS, does not match, because an
explicitly specified component still counts as specified.
[AMDGPU] Match bitsin(typeof(x)) - ctpop(x) to s_bcnt0_i32 (#164847)
This PR optimizes the pattern bitsin(typeof(x)) - popcnt(x) to
s_bcnt0_i32 on AMDGPU. It also creates a Clang builtin for s_bcnt0_i32
so that users can call this instruction directly instead of relying on
the compiler to match this pattern.
graphics/librsvg2: the port had been updated to version 2.40.23
- Switch to USE_GITLAB/GL_* because it is tagged-only release
- Drop needless GNU_CONFIGURE_MANPREFIX and `localbase' from
the USES list
- Rewrite regex in `post-patch' target so it produces identical
result, but is shorter and more correct (escape the dot)
- Drop the DOCS option which does nothing after HTML files and
images no longer come with the distfile and USES+=gnomeprefix
forces the --disable-gtk-doc anyway (however, dependency on
textproc/gtk-doc is required for GTK_DOC_CHECK macro in the
configure.ac, so keep it but adjust accordingly)
PR: 295743
Reviewed by: arrowd
[offload][lit] Disable failing olCreateProgram test on AMD (#213126)
Fails with an error about not being able to find `lld`. AMD team is
investigating, but disable the test in the meantime.
Context: https://github.com/llvm/llvm-project/pull/212860
Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
X86: Simplify the EH_LABEL Expand condition
Re-express the opt-out handling of EH_LABEL. The special
case is 32-bit non-GNU Windows, and the net result is to skip
printing unused labels. Try to make this more comprehensible
to help figure out where this logic should really be.
I want to eliminate use of the TargetOptions::ExceptionModel,
which ideally wouldn't be needed in a TargetLowering
constructor.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[VPlan] Migrate VPBuilder to VPInsertPt fully (NFC) (#209764)
There is already a VPInsertPoint in VPBuilder which is used just with
InsertPointGuard. In order to share code, migrate VPBuilder to fully use
VPInsertPoint as the canonical insertion point.
[scudo] Fix GCC build after 212604 (#212904)
Change #212604 introduced an issue when building with gcc where it
complains there are "too few template-parameter-lists" (see log:
https://lab.llvm.org/buildbot/#/builders/131/builds/51269/steps/6/logs/stdio
)
This PR fixes the build.
Assisted-by: Automated tooling, human reviewed.
AMDGPU: Add missing atomic-fmin-fmax-global to gfx13 feature map
fillAMDGCNFeatureMap omitted atomic-fmin-fmax-global-f32 and
atomic-fmin-fmax-global-f64 for gfx1310/gfx13-generic, so clang wrongly
rejected the raw_ptr_buffer_atomic_f{min,max}_f{32,64} builtins on those
targets even though the backend enables the features. Add them to the
gfx13 case.
Co-authored-by: Claude (Claude-Opus-4.8)
[AMDGPU] Canonicalize constant CLAMP source (#207902)
CLAMP lowers to v_max_f32, which canonicalizes its result: signaling
NaNs are quieted and denormals are flushed per the function denormal
mode
The constant fold returned the source unchanged, giving a different
result than the hardware. Route the folded constant through
getCanonicalConstantFP so it matches
cmake: Derive CMake system name from a triple via new mechanism
This is a reimplementation of the cmake functionality first implemented in
6e4e181c83, which has now been reverted twice. Implement the raw cmake functionality
without introducing the uses yet.
The runtimes build needs to translate the build target (configured with a target
triple) to cmake's naming scheme, to use for CMAKE_SYSTEM_NAME. Use the OS/environment
list from TargetParser as the source of truth; add an additional entry for the
cmake name to ensure the build system and compiler always recognize the same set
of names.
Upgrade the previous cmake regexes to a new python script which parses the
authoritative def file. The new script logic should match Triple::normalize's
permissiveness for various legacy and malformed triple shapes. This should be
more maintainable than the previous cmake regexes, since there's now a unit test
mirroring the triple unit test.
Co-Authored-By: Claude (Opus 4.8) <noreply at anthropic.com>
AMDGPU: Add missing flat-global-insts to gfx13 frontend feature map
fillAMDGCNFeatureMap omitted flat-global-insts for gfx1310/gfx13-generic,
so clang wrongly rejected __builtin_amdgcn_av_load_b128 /
__builtin_amdgcn_av_store_b128 on those targets even though the backend
enables the feature. Add it to the gfx13 case.
Co-authored-by: Claude (Claude-Opus-4.8)
AMDGPU: Add missing msad-insts to gfx13 frontend feature map
fillAMDGCNFeatureMap omitted msad-insts for gfx1310/gfx13-generic, so
clang wrongly rejected __builtin_amdgcn_msad_u8 on those targets even
though the backend enables the feature (FeatureGFX9 generation, inherited
through FeatureGFX13). Add it to the gfx13 case.
Co-authored-by: Claude (Claude-Opus-4.8)
[lldb][minidump] Fix Memory64List DataSize over-counting on a failed read (#212861)
**Issue:**
save-core records each range's DataSize from the value
ReadMemoryInChunks returns. That value counts bytes read from the
inferior even when the callback dropped them: a chunk that errors
part-way returns Stop before AddData, so the partially-read bytes are
counted but never written.
Because the Memory64List locates every range by the cumulative DataSize
of the preceding ranges, an over-counted DataSize desyncs the shared
data blob: the descriptors claim more bytes than the file holds and
every later range reads back corrupted.
**Fix**
Record the bytes actually written (total_bytes_read) as the range's size
so the descriptor DataSize matches the data in the blob.
**Test**
[3 lines not shown]
AMDGPU: Add missing mqsad-pk-insts to gfx13 frontend feature map
fillAMDGCNFeatureMap omitted mqsad-pk-insts for gfx1310/gfx13-generic, so
clang wrongly rejected __builtin_amdgcn_mqsad_pk_u16_u8 on those targets
even though the backend enables the feature. Add it to the gfx13 case.
Co-authored-by: Claude (Claude-Opus-4.8)
[flang] Fix POSIX.1/XPG checks in intrinsics-library.cpp (#201072)
PR #201063 breaks the `flang` build on Solaris:
```
flang/lib/Evaluate/intrinsics-library.cpp:225:26: error: address of overloaded function 'acos' does not match required type '__float128 (__float128)'
flang/lib/Evaluate/intrinsics-library.cpp:225:26: error: address of overloaded function 'acos' does not match required type '_Complex __float128 (_Complex __float128)'
```
There are two problems here:
- The `__float128` support in `intrinsics-library.cpp` is guarded by the
POSIX.1 >= 2001/XPG >= 6 check, but only depends on `HAVE_QUADMATHLIB`.
- That check is done incorrectly: it tests for `_POSIX_C_SOURCE >=
200112L` or `_XOPEN_SOURCE >= 600`, which are no longer defined on
Solaris after the PR above. This check is due a misunderstanding of
those feature test macros: as detailed in [The Open Group Base
Specifications Issue 8, 2.2.1 POSIX.1
Symbols](https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html),
[14 lines not shown]
[LoopUnroll] Fix freqs for unconditional latches: N>2, uniform (#182405)
This patch introduces the command-line option `-unroll-uniform-weights`.
When computing probabilities for the remaining N conditional latches in
the unrolled loop after converting some iterations' latches to
unconditional, LoopUnroll now supports the following three strategies:
- A. If N <= 2, use a simple formula to compute a single uniform
probability across those latches.
- B. Otherwise, if `-unroll-uniform-weights` is not specified, apply the
original loop's probability to all N latches and then, as needed, adjust
as few of them as possible.
- C. Otherwise, bisect the range [0,1] to find a single uniform
probability across all N latches. This patch implements this strategy.
An issue with C is that it could impact compiler performance, so this
patch makes it opt-in. Its appeal over B is that it treats all latches
the same given that we have no evidence showing that any latch should
have a higher or lower probability than any other. A has neither
[4 lines not shown]
[VPlan] Set correct VPIRFlags for FP selects when sinking stores. (#212973)
Selects of floats carry fast-math flags. Update getDefaultFlags to take
the result type and use it to handle selects. I am planning on extending
this to other similar opcodes, including PHIs.
Then update sinkPredicatedStores to pass through the correct default
flags.
This fixes a crash in cse when intersecting common metadata.
Fixes https://github.com/llvm/llvm-project/issues/212811.
PR: https://github.com/llvm/llvm-project/pull/212973