[llvm] [LV] Add vplan folds for (X - (X & Y)) -> (X & ~Y) (PR #226466)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 04:04:09 PDT 2026


david-arm wrote:

The only other way of landing this PR without making that example worse is by teaching instcombine to go the other way and turn `%0 = and i64 %wide.trip.count, -32` back into

```
  %0 = and i64 %wide.trip.count, 31
  %n.vec = sub i64 %wide.trip.count, %0
```

so that it can then fold `%0 = and i64 %wide.trip.count, 31` into `5`. However, I feel like there is a danger of ending up in an infinite loop because then we'd be fighting the reverse transformation.

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


More information about the llvm-commits mailing list