[libc][docs] Add guide for implementing a function (#188499)
Added implementing_a_function.rst providing a checklist for adding a new
function to LLVM-libc.
Updated dev/index.rst to include the new guide in the toctree.
[libc][math] Switch log1pf to use the same log_eval from inverse hyperbolic functions. (#188388)
- Switch log1pf to use the same log_eval from inverse hyperbolic
functions.
- Optimize log_eval to use the same range reduction scheme as double
precision log
- Reduce the table size needed for log range reduction.
- This lower the overall latency of log1pf and inverse hyperbolic
functions.
[DAG] Define computeConstantRange for VSCALE folding (#176027)
Resolves #175150
Defines computeConstantRange and computeConstantRangeIncludingKnownBits
in the SelectionDAG. Currently only handles `ISD::VSCALE` operation
related to #174708.
Test cases were constructed to test varying VSCALE ranges on AArch64.
Further testing can be implemented as needed by review.
[TargetLowering] Use APInt::setAllBits() instead of assigning -1. (#188566)
The -1 has 'int' type. The APInt assignment operator takes uint64_t.
Fortunately, due to C rules, the -1 will be converted to an all ones
uint64_t. Unfortunately, if the APInt has more than 64 bits, the upper
words will be zeroed. I don't think we have any testing of that today.
Use setAllBits to avoid the subtle cast and fix the bits > 64 issue.
K still has its own issue that needs to be fixed.
[lldb][CommandObjectType] Add --wants-dereference option to `type synthetic add` (#188512)
This patch exposes the `TypeSynthetic::SetFrontEndWantsDereference` via
the `type synthetic add` command.
The motivation for this is moving the various STL data-formatters to
Python. Those currently set this flag programmatically so that pointers
and references get formatted using the pointee synthetic provider.
Patch that makes use of this new option is:
https://github.com/llvm/llvm-project/pull/187677
Claude helped with writing the test code. Reviewed and cleaned it up
myself
[NVPTX] Split out NVPTXSetByValParamAlign of NVPTXLowerArgs (NFC) (#187965)
This logic was previously embedded in NVPTXLowerArgs, but is split into
a separate pass as it is an optional optimization orthogonal to kernel
parameter lowering. This pass can be run earlier making alignment
available to generic IR passes (like infer-alignment) and a separate
pass makes the alignment logic independently testable. It also
simplifies NVPTXLowerArgs by removing the duplicate handling of
alignment for kernel vs. device functions.
[mlir][tosa] Optimize block scaled cast sequences (#188018)
Add a canonicalization pattern that will delete cast_from_block_scaled
-> cast_to_block_scaled sequences when the input and output types and
block sizes match.
---------
Signed-off-by: Ian Tayler Lessa <ian.taylerlessa at arm.com>
[NFC][OpenMP][mlir][flang] Move OMP offloading module attribute handling from flang to mlir (#186409)
This patch moves the OpenMP offloding module attributes handling from
flang to mlir so that it can be reused in ClangIR was well.
Co-authored-by: Claude Opus 4.6 <noreply at anthropic.com>
Co-authored-by: Michael Kruse <github at meinersbur.de>
[DSE] Fix missed dependency update in #188253 (#188573)
DSE no longer requires LoopInfo, so this dependency is no longer
correct. Update it to CycleInfo to fix a crash when using the legacy PM.
Note: This crash is kind of hard to hit with default LLVM tools since
`opt` can no longer use the legacy PM, but it happens on any invocation
of clang when targeting the DirectX backend.
[lld][ELF][clang][MTE] Add -z memtag-{mode,heap,stack} (#188205)
This change eliminates the Android-specific --android-memtag-* flags
from lld, replacing them with -z memtag-* generic equivalents. With
these generic flags, the linker will emit only the dynamic array tags
specified in the "Memtag ABI Extension to ELF", but no Android-specific
memtag note.
In addition, this change adds an --android-memtag-note flag which should
be used when the Android-specific memtag note should be emitted.
This change also modifies the clang driver to make use of the new flags.
[MC] Move addEncodingComment() into new base class MCAsmBaseStreamer
This is in preparation to use this functionality in the
SystemZHLASMAsmStreamer. No functional change.
tests/netinet: add raw:reconnect test
It tests repetitive connect(2) on AF_INET/SOCK_RAW including connect(2)
to INADDR_ANY that puts socket back into receive-all mode.
Revert "[MLIR] [Mem2Reg] Fix unused block argument removal logic (#188484)" (#188571)
This reverts commit e5adddc5be63b8bb8c36572f68ac64c8042cb282.
This commit broke a lot of Fortran compilations in our tests and builds.
I am working on an additional fix, but I would like to revert this
in the meantime. I will reupload it with the fix.
[libunwind] Fix building on OpenBSD / FreeBSD aarch64 (#188397)
Just checking for the header presence of sys/auxv.h breaks the
build on OpenBSD / FreeBSD. Make use of elf_aux_info().
[MLIR][DataFlow] Fix two crashes in DeadCodeAnalysis on empty/no-terminator regions (#188548)
Two related assertion failures in DeadCodeAnalysis when processing
OpenACC operations:
1. visitRegionBranchEdges (issue #187972): When a RegionSuccessor refers
to an empty region (no blocks), calling getSuccessor()->front()
dereferences a sentinel ilist iterator, crashing with
"\!NodePtr->isKnownSentinel()". Fix: skip successors whose region is
empty.
2. isRegionOrCallableReturn (issue #188408): When iterating over ops in
a nested acc region whose blocks do not have a required terminator,
Block::getTerminator() is called without first checking
mightHaveTerminator(), triggering "Assertion `mightHaveTerminator()'
failed". Fix: guard the getTerminator() call with mightHaveTerminator().
Fixes #187972, #188408
Assisted-by: Claude Code
[HLSL][SPIRV] Fix firstbitset in spirv (#186939)
This patch fixes the logic when lowering firsbithigh and low when
targeting spirv. It adds an aditional check to make sure the second half
is also -1, if it is it returns -1 otherwise returns the resulting sum.
Fix: #143003 and #143171
---------
Co-authored-by: Finn Plummer <mail at inbelic.dev>
Undo renaming
- Keep the class and file name MCAsmStreamer.cpp
- Introduce new base class and MCAsmBaseStreamer.h
- Only change to MCAsmStreamer is to derive from the new base class
[flang] use fir.bitcast for FIRToMemRef scalar reinterpretation (#188328)
Use fir.bitcast in FIR-to-MemRef casts so bit patterns are preserved
(e.g. TRANSFER), while keeping fir.convert for memref/reference
marshaling and non-bitcast-compatible cases.
[HLSL] Add CalculateLevelOfDetail methods to Texture2D
This adds the CalculateLevelOfDetail and CalculateLevelOfDetailUnclamped
methods to Texture2D using the establish pattern used for other methods.
Assisted-by: Gemini
[SPIRV] Implement the int_spv_resource_calculate_lod* IntrinsicsSPIRV
Implements intrinsics used to get the level-of-detail given a texture,
sampler, and a coordinate. It will be used to implement the
corresponding HLSL methods.
Assisted-by: Gemini