[CIR] Handle Indirect call in getter and setter of callee
Indirect call from function pointer has no SymbolRefAttr, which cause
assetion in dyn_cast. Handle them specially.
Assisted-by: Claude # Test
[SystemZ] Lower ISD::PDEP and ISD::PEXT on z17 using BDEPG and BEXTG (#244196)
Implement custom lowering for ISD::PDEP and ISD::PEXT on IBM z17
(Miscellaneous-Instruction-Extensions Facility 4 / arch15).
z17 introduces BDEPG (Bit Deposit) and BEXTG (Bit Extract) instructions,
which operate on left-justified (MSB-first) bit fields:
- ISD::PEXT is lowered using BEXTG followed by a right shift (by 64 -
popcount(mask)) to right-justify the extracted bits.
- ISD::PDEP is lowered by left-shifting the value (by 64 -
popcount(mask)) to align LSBs to the MSB, followed by BDEPG.
- For constant masks, popcount and shift amounts are computed at compile
time.
- Scalar sub-i64 types (i8, i16, i32) are promoted to i64.
Assisted by: IBM Bob
---------
Co-authored-by: Kazu Hirata <kazu at google.com>
ext2fs: Multi-block allocator with extent tree support and allocation lifecycle state machine
The idea is to have an allocator that makes better use of the locality
information and is better suited for extents. It is similar to what
Linux calls a multiblock allocator in a paper from 2005. The Linux
code was not inspected or used in this implementation.
Implement ext2_alloc_run() — a multi-block physical allocator that
reserves a contiguous physical block run and returns it via a
context-based state machine:
ALLOCATED -> MAPPED -> PUBLISHED -> ROLLED_BACK
ext2_alloc_run() enforces the reserved-block policy using struct
ucred *cred (NOCRED panics under INVARIANTS). Callers include
ext2_alloc() and ext4_new_blocks() for block allocation.
ext4_ext_split() uses scalar ext2_rollback_unpublished() for metadata
block cleanup (no context arrays). ext4_ext_insert_extent() handles
[23 lines not shown]
[ValueTracking] Propagate demanded lanes through bitcasts in sign-bit queries (#244290)
Map demanded result lanes back to their source lanes when splitting
integer elements in a bitcast.
Assisted by: GPT 6.1 Sol
html: Remove the dead /latest/ redirect
Since dfe3002d4, process_data() sets page_buildname from the loaded
data before process_data_build() runs, so the page_buildname ==
"latest" check never matches. A build=latest URL loads the build
through the latest symlink and stays on it.
[MLIR] Filter out recursive memory effect for ReturnLike
ReturnLike interface should be rule out from the MemoryEffect check
for RecursiveMemoryEffect. It makes sense as the memory effect for
ReturnLike never effect its parent scope.
Assisted-by: Claude # Test
[GitHub][libc] Use MinSizeRel instead of RelWithDebInfo
Comments were stale after fc60e08b4574a85f6966a751f32290f5732d1329
seeminly accidentally switched to RelWithDebInfo. Switch back to
MinSizeRel to avoid all the overhead of generating debug info.
Also drop the requirement for CMP0141 given it's explicitly set in
CMakePolicy.cmake and is also redundant after requiring CMake 3.31.
Reviewers: SchrodingerZhu, kaladron, lntue
Pull Request: https://github.com/llvm/llvm-project/pull/244733
[AMDGPU] Pass the cast source to isKnownNonNull in lowerADDRSPACECAST (#244287)
`lowerADDRSPACECAST` passes the cast node instead of its source to
`isKnownNonNull`. The cast node is never a frame index, a global
address, or a constant, so the check never succeeds, and SelectionDAG
checks for null when it casts an alloca or a global. At -O2 the
`nonnull` flag that IR passes set on the cast hides this, but at -O0
every such cast gets a compare and two selects. The GlobalISel path
already passes the source.
This PR was assisted by AI but I reviewed all the changes.
[mlir][openacc] Update LegalizeDataValues to be anchored on FunctionOpInterface (#244687)
In preparation to use the pass in the CIR/OpenACC pipeline, CIR uses
cir.func that implement the FunctionOpInterface so the pass is better
anchored on it than func.func.
[SelectOptimize] Do not convert unpredictable selects to branches in inner loops (#236418)
Inner loop select optimization does not check for unpredictable
metadata, allowing unpredictable selects to be converted to branches.
Filter out unpredictable select groups in
findProfitableSIGroupsInnerLoops and add regression tests to
AArch64/selectopt.ll covering single and dual recurrence loops.
[LVI] Raise MaxUsesToInspect limit in getValueAtUse to 6 (#241468)
Using ternary operators can result in a redundant min() operation:
```
int need = avail < 0 ? -avail : 0; // -min(avail, 0)
uint64_t add = avail < 0 ? (uint64_t)w << need : 0; // the min is redundant
```
The same can happen when using branches (see the referenced issue below). IR and the redundant min:
```
%5 = icmp slt i32 %4, 0
%6 = tail call i32 @llvm.smin.i32(i32 %4, i32 0) ; <== this can be eliminated
%7 = sub nsw i32 0, %6
%8 = zext i32 %1 to i64
%9 = zext nneg i32 %7 to i64
%10 = shl i64 %8, %9
%11 = select i1 %5, i64 %10, i64 0
[6 lines not shown]
[libc] Switch default find_first_character impl to clang_vector
The clang_vector implementation is way faster than the SWAR
implementation and what we want to be using by default at this point.
Override AArch64 and PPC to use the word implementation as otherwise
when compiling with glibc they fall back to the arch_vector
implementation which doesn't exist.
Reviewers: jhuber6, vonosmas
Pull Request: https://github.com/llvm/llvm-project/pull/244470
[libc] Add optimized clang_vector memchr implementation
This patch adds a reasonably optimized clang_vector based memchr
implementation. It is comparable in .text size to glibc and about 30%
faster for inputs <64 bytes (90+% of inputs for server applications). We
lose a little bit for larger inputs due to extra instructions in the
main loop that LLVM isn't able to optimize away, but not by too much.
The original implementatin was written by an agent as I prodded it to
keep making the implementation faster. Then I heavily hand-edited mostly
for style.
Assisted-By: LLM
Reviewers: lntue, jhuber6, michaelrj-google
Pull Request: https://github.com/llvm/llvm-project/pull/244469
[VPlan] Simplify VPBlockUtils::blocksAs using CastTo (NFC). (#244721)
CastTo preserves the const-ness of its argument, so the lambda and the
explicit BaseTy needed to pick the const-qualified base type are no
longer needed.
[SystemZ] Lower ISD::PDEP and ISD::PEXT on z17 using BDEPG and BEXTG
Implement custom lowering for ISD::PDEP and ISD::PEXT on IBM z17
(Miscellaneous-Instruction-Extensions Facility 4 / arch15).
z17 introduces BDEPG (Bit Deposit) and BEXTG (Bit Extract) instructions,
which operate on left-justified (MSB-first) bit fields:
- ISD::PEXT is lowered using BEXTG followed by a right shift (by 64 - popcount(mask))
to right-justify the extracted bits.
- ISD::PDEP is lowered by left-shifting the value (by 64 - popcount(mask)) to align
LSBs to the MSB, followed by BDEPG.
- For constant masks, popcount and shift amounts are computed at compile time.
- Scalar sub-i64 types (i8, i16, i32) are promoted to i64.