If insertelement, extracted from vectorized bundle, is intermediate,
i.e. not the last one, then shuffle vectorized value with original
vector to get correct value for external use.
Fixes PR52275 (#51617)
Paths
| Differential D119536
[SLP] Extract intermediate insertelement for external use AbandonedPublic Authored by anton-afanasyev on Feb 11 2022, 2:58 AM.
Details
Summary If insertelement, extracted from vectorized bundle, is intermediate, Fixes PR52275 (#51617)
Diff Detail
Event Timeline
Comment Actions Hmm, looks like the problem appears only if we have insertelements to be vectorized not from vectorizeInsertElementInst, where we have a proper check. Maybe just add a check for insertelements in other functions and just expect them from vectorizeInsertElementInst?
anton-afanasyev added inline comments.
anton-afanasyev marked 3 inline comments as done. Comment ActionsAddress some comments, rebase against D119623 Comment Actions
Well, that would definitely solve the problem. There is also another way: on the contrary, remove hasOneUse() check from vectorizeInsertElementInst. This patch allows it. anton-afanasyev added inline comments.
Comment Actions
Yes, sure, but it will require some extra stuff and some time to polish and fix all corner cases. If we’d like to fix it in 14.0, better to start with a simple fix and then try to implement more complex feature.
Comment Actions
Sounds reasonable, thanks! Please take a look at the simple fix: D119679 .
anton-afanasyev marked 2 inline comments as done. Comment ActionsAbandoning this. PR52275 was solved by D119679 and following patches.
Revision Contents
Diff 408166 llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/pr52275.ll
|
Make it a separate NFC patch