[llvm] [LV] Bundle partial reductions inside VPExpressionRecipe (PR #147302)
Sam Tebbs via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 14 08:58:28 PDT 2025
SamTebbs33 wrote:
> > It looks like this is causing a new crash on the IR below at the moment. I've not looked at the details yet, but may be related to #162530
>
> Thank you, it looks like the reproducer is crashing on main as well, but with a different symptom:
>
> > opt: /home/sam/repos/llvm-project/llvm/include/llvm/Support/Casting.h:109: static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = llvm::VPWidenCastRecipe; From = llvm::VPRecipeBase]: Assertion `Val && "isa<> used on a null pointer"' failed.
>
> It still crashes with the current head of #162822 as well.
I think the offending code is the part that tries to optimise the extends [here](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp#L3606). It changes the type of the mul to the outer extend type, which messes up any other users of the mul since the type has changed. In this case it messes up the `or`.
I've added a `hasOneUse` check and that combined with the fixes from https://github.com/llvm/llvm-project/pull/163175 (along with my suggestions in its review) stops the crash.
https://github.com/llvm/llvm-project/pull/147302
More information about the llvm-commits
mailing list