[llvm] [SLP] Fix dep accounting when cancelling a bundle with copyable elements (PR #223174)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 13 04:27:18 PDT 2026


mstorsjo wrote:

I’m also hitting asserts due to this change.

```c
typedef char a;
a b, c, d, e, f, g, h, i, j, k, l, m, n;
static void z() {
  a p = b, q = c, r = d, s = e, t = f, u = g, v = h, w = i, x = j, y = k, a = l,
    o = c = q * w >> 4;
  d = p * 5 + q * 2 + r + s + t + u + v + w + x >> 4;
  f = 3 + q + r + s + t + u * 2 + v + w + x + y + a >> 4;
  h = s + u * 2 + v * 2 + w * 2 + x + y + a + o + m >> 4;
  i = q + t + u + x * 2 + y + a + o + m + n >> 4;
  j = r + t + w * 2 + x * 2 + y * 2 + a + o + m + n * 2;
  k = u + v + w + x * 2 + y + a * 2 + o + m + n >> 4;
  l = t + u + v + w + x + y * 2 + a * 2 + o * 2 + m + n >> 4;
  m = v + w + x + y + a + 2 + m * 2 + n >> 4;
}
void aa() { z(); }
```
```console
$ clang -target x86_64-linux-gnu -c repro.c -O2
clang: ../lib/Transforms/Vectorize/SLPVectorizer.cpp:3894: int llvm::slpvectorizer::BoUpSLP::ScheduleData::incrementUnscheduledDeps(int): Assertion `UnscheduledDeps >= 0 && "Expected valid number of unscheduled deps"' failed.
```

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


More information about the llvm-commits mailing list