[llvm] [VectorCombine] foldShuffleChainsToReduce - add support for partial vector reductions (PR #195119)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Sun May 10 04:28:17 PDT 2026


mstorsjo wrote:

This causes failed asserts for me. Reduced repro:
```c++
struct a {
  bool b() { return m_fn4(a()); }
  int c() { return d; }
  int e() { return d + f; }
  int d;
  int f;
  int g;
  int h;
  bool m_fn4(const a &j) {
    bool i = d == j.d && f == j.f && g == j.g && h;
    return i;
  }
};
struct l {
  a k;
} m;
void n();
void o(a &j) {
  l p = m;
  if (j.b() && p.k.c() > j.e())
    n();
}
```
```console
$ clang -target aarch64-linux-gnu -c repro.cpp -O2
clang: ../include/llvm/Support/Casting.h:109: static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = llvm::FixedVectorType; From = llvm::VectorType]: Assertion `Val && "isa<> used on a null pointer"' failed.
```

Also, please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.<br/>
            See [LLVM Developer Policy](https://llvm.org/docs/DeveloperPolicy.html#email-addresses) and [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.

https://github.com/llvm/llvm-project/pull/195119


More information about the llvm-commits mailing list