I think that the loop is not needed.
I added an assertion to check whether a second iteration succeeds in
vectorizing phi noeds, but it never caused a crash.
Anyway, if this is actually used, we don't have a test for it.
Details
- Reviewers
ABataev
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Do not forget that instructions can mutate during vectorization and if at the first iteration they are not compatible, they might be transformed into extractelement instructions on this first iteration, and become compatible on the second one
So the purpose of this loop is to attempt to vectorize the same PHI seeds that failed previously because the code might have changed in the meantime. But is this something that should be done specifically for PHI nodes? Perhaps we should be doing this for other seed types too ?
Since this is not a complete feature and we don't have any tests for it, shouldn't we remove it and add it again if needed ? Wdyt?
Why not complete? Removing this may affect vectorization. If you mean to the test, I can try to add it.
Why not complete? Removing this may affect vectorization. If you mean to the test, I can try to add it.
It is not complete in the sense that this is just for PHIs and is not supported for other seeds.
It just seems to me that this shouldn't have too much impact, and it is better to have the same logic for all seed types. If we really need this feature we should either enable it for all or completely remove it.
The fact that it is not ready for other seeds, does not make it non-important for PHIs.