This is an archive of the discontinued LLVM Phabricator instance.

Scalarize select vector arguments when extracted
ClosedPublic

Authored by arsenm on Aug 27 2013, 6:36 PM.

Details

Reviewers
nadav
arsenm
Summary

When the elements are extracted from a select, do the select on the extracted scalars from the input.

With this, the vectorizer still isn't able to put a vector select back together. It is skipped because some of the insertelements are before the last select being vectorized.

Also fixes some missing CHECK-LABELs in the test that changed, but those are separate.

Diff Detail

Event Timeline

Hi Matt,

I am sorry I missed your first email. Thanks for working on this.

When the elements are extracted from a select, do the select on the extracted scalars from the input.

I am not sure that this is always profitable or that it should be done in InstCombine. It is hard to know at IR-level (during inst-combine) if it is better to extract twice and perform a single select or if it is better to perform an vector select and extract once. I think that this kind of decision should be made in SelectionDAG.

With this, the vectorizer still isn't able to put a vector select back together. It is skipped because some of the insertelements are before the last select being vectorized.

I assume that you mean the SLP-vectorizer. What is the problem ? Do you have a test case ? I’d be happy to take a look.

Also fixes some missing CHECK-LABELs in the test that changed, but those are separate.

Can you commit the label fixes as a separate patch ?

Thanks,
Nadav

arsenm accepted this revision.Nov 4 2013, 12:40 PM

Committed r194013

arsenm closed this revision.Nov 4 2013, 12:40 PM