[llvm] [AArch64][SVE] Fold nested boolean UMIN trees (PR #209234)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 30 06:40:53 PDT 2026
================
@@ -3235,6 +3235,48 @@ instCombineInStreamingMode(InstCombiner &IC, IntrinsicInst &II) {
return std::nullopt;
}
+static std::optional<Instruction *> instCombineSVEUMin(InstCombiner &IC,
+ IntrinsicInst &II) {
+ // Fold umin(umin(umin(umin(A, B), 1),
+ // umin(umin(C, D), 1)),
+ // 1)
+ // into
+ // umin(umin(umin(A, B),
+ // umin(C, D)),
+ // 1),
----------------
paulwalker-arm wrote:
Rather than matching the whole pattern, if you split it into smaller combines it will simplify the code and has the chance to trigger in more cases. I'm thinking something like:
```
umin(umin(A, 1), umin(B, 1)) -> umin(umin(A,B), 1)
umin(umin(A, 1), 1) -> umin(A, 1)
```
https://github.com/llvm/llvm-project/pull/209234
More information about the llvm-commits
mailing list