[llvm] [VPlan] Extend licm to hoist replicate loads (PR #179506)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 01:01:38 PDT 2026


artagnon wrote:

> Would be good to add and check what's going on

Wow, it looks like hoistInvariantLoads had a major bug:

```cpp
      if (auto *RepR = dyn_cast<VPReplicateRecipe>(&R)) {
        if (RepR->isPredicated() || !RepR->isSingleScalar() ||
            RepR->getOpcode() != Instruction::Load)
          continue;
      // ...
      if (R.mayWriteToMemory()) {
```

due to the early continue, we never even collect stores!

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


More information about the llvm-commits mailing list