Fix an assert introduced in 41ed5d856c1: a phi with a single predecessor and a mask is a valid case, already supported.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I think this is related to PR44800, which has similarly redundant phis, but with 2 incoming values from the same block. Relaxing the assertion seems a fine workaround for now, but I think ideally we would eliminate such redundant PHIs in VPlan later on.
LGTM, with some suggestions for the test. It would be good to wait with committing a day or so, in case there are additional comments.
llvm/test/Transforms/LoopVectorize/pr45525.ll | ||
---|---|---|
3 | Should this have -force-vector-width=4 or something, to not rely on the cost model? | |
45 | it would be nice to rename the values to have a bit more compact/descriptive names, e.g. %iv and %iv.next and so on instead of the longer names. | |
46 | Branch on undef is UB, please use a different branch condition (e.g. through a parameter). | |
49 | Better to also have a concrete value instead of undef. Also, might be good to have a user of the value to make the test more robust (in case we decide to remove unused values in a VP2VP transform later on). |
Oh and it would be great if you could add a bit more details to the commit message title :)
Addressed comments and narrowed LIT checks to the relevant vectorized instructions.
Thanks @fhahn !
Should this have -force-vector-width=4 or something, to not rely on the cost model?