diff options
author | Rajveer Singh Bharadwaj <rajveer.developer@icloud.com> | 2025-08-24 14:21:48 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-24 14:21:48 +0530 |
commit | 93c96849c89507579a77980ff03adbeabb413573 (patch) | |
tree | 2dde9ea3d61ec5a1fad3d473e98161e0ebf096cd /lldb/packages/Python/lldbsuite/test | |
parent | 3054e06c33ac8977b355bf2cff14617a342dbce9 (diff) | |
download | llvm-93c96849c89507579a77980ff03adbeabb413573.zip llvm-93c96849c89507579a77980ff03adbeabb413573.tar.gz llvm-93c96849c89507579a77980ff03adbeabb413573.tar.bz2 |
[VectorCombine] New folding pattern for extract/binop/shuffle chains (#145232)
Resolves #144654
Part of #143088
This adds a new `foldShuffleChainsToReduce` for horizontal reduction of
patterns like:
```llvm
define i16 @test_reduce_v8i16(<8 x i16> %a0) local_unnamed_addr #0 {
%1 = shufflevector <8 x i16> %a0, <8 x i16> poison, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison>
%2 = tail call <8 x i16> @llvm.umin.v8i16(<8 x i16> %a0, <8 x i16> %1)
%3 = shufflevector <8 x i16> %2, <8 x i16> poison, <8 x i32> <i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%4 = tail call <8 x i16> @llvm.umin.v8i16(<8 x i16> %2, <8 x i16> %3)
%5 = shufflevector <8 x i16> %4, <8 x i16> poison, <8 x i32> <i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%6 = tail call <8 x i16> @llvm.umin.v8i16(<8 x i16> %4, <8 x i16> %5)
%7 = extractelement <8 x i16> %6, i64 0
ret i16 %7
}
```
...which can be reduced to a llvm.vector.reduce.umin.v8i16(%a0)
intrinsic call.
Similar transformation for other ops when costs permit to do so.
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
0 files changed, 0 insertions, 0 deletions