[llvm] [LV] Remove common extends and selects in CSE (PR #147731)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 21 06:53:30 PDT 2025


https://github.com/sdesmalen-arm approved this pull request.

```///Perform cse of induction variable instructions
static void cse(BasicBlock *BB) {
```
This is the only comment I was able to find regarding LoopVectorize's CSE. Is this CSE  only supposed to handle Induction Variable instructions? If so, I'm not sure why `ShuffleVectorInst` is included here.

I'm accepting this patch because CSE'ing simplifies the IR coming out of the LV and the mechanism already exists, but I expect there is some implicit assumption that other passes (in this case ISel) are supposed to solve the problem. If so, that should be mentioned somewhere in the comments of `cse` or `CSEDenseMapInfo::canHandle`.



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


More information about the llvm-commits mailing list