This is an archive of the discontinued LLVM Phabricator instance.

[VectorCombine] Scalarize vector GEP if that isn't more costly
AbandonedPublic

Authored by lebedev.ri on Oct 7 2021, 3:22 PM.

Details

Summary

As noted in https://reviews.llvm.org/D111220#3048397,
after masked memory intrinsic has been scalarized,
we may have an opportunity to improve the IR,
because the pointers were scalarized via extractelement,
but we might be able to fold them into getelementptr's.

We'd also need to schedule another VectorCombine run
somewhere after ScalarizeMaskedMemIntrin in backend IR phase.

Diff Detail

Event Timeline

lebedev.ri created this revision.Oct 7 2021, 3:22 PM

Have you considered handling basic vector support in X86DAGToDAGISel::matchAddressRecursively ?

Should vector

Have you considered handling basic vector support in X86DAGToDAGISel::matchAddressRecursively ?

Hm, i have not. In addition to this or instead of? I'm not too familiar with that function,
so i'm not quite sure what you have in mind, with what/how it would help improve the patterns in question?

Did you consider teaching ScalarizeMaskedMemIntrinsic to special case GEPs? Then you wouldn't need to schedule another run of VectorCombine?

lebedev.ri planned changes to this revision.Oct 8 2021, 1:00 PM

I think we mostly won't need this after all, i've found the real problem - D111460.