This is an archive of the discontinued LLVM Phabricator instance.

[TLI] SimplifyDemandedVectorElts(): handle SCALAR_TO_VECTOR(EXTRACT_VECTOR_ELT(?, 0))
ClosedPublic

Authored by lebedev.ri on Jun 14 2021, 11:25 AM.

Details

Summary

Iff we have SCALAR_TO_VECTOR (and we demand it's only defined 0'th element),
and said scalar was produced by EXTRACT_VECTOR_ELT from the 0'th element
of some vector, then we can just continue traversal into said source vector.

This comes up in X86 vector uniform shift lowering.

Diff Detail

Event Timeline

lebedev.ri created this revision.Jun 14 2021, 11:25 AM

Thanks for looking into this!

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
2437

isNullConstant ?

lebedev.ri marked an inline comment as done.

Use isNullConstant()

RKSimon accepted this revision.Jun 14 2021, 1:45 PM

LGTM - cheers

This revision is now accepted and ready to land.Jun 14 2021, 1:45 PM

LGTM - cheers

Thank you for the review!

This revision was landed with ongoing or failed builds.Jun 14 2021, 2:05 PM
This revision was automatically updated to reflect the committed changes.