Page MenuHomePhabricator

[SVE] Fix invalid usages of getNumElements in ShuffleVectorInstruction
ClosedPublic

Authored by ctetreau on Jun 16 2020, 2:18 PM.

Details

Summary

Fix invalid usages of getNumElements identified by test case
LLVM.Transforms/InstCombine::vscale_extractelement.ll.

changesLength: Since the length of the llvm::SmallVector shufflemask
is related to the minimum number of elements in a scalable vector, it is
fine to just get the Min field of the ElementCount

isIdentityWithExtract: Since it is not possible to express the mask
needed for this pattern for scalable vectors, we can just bail before
calling getNumElements()

Diff Detail

Event Timeline

ctetreau created this revision.Jun 16 2020, 2:18 PM
Herald added a project: Restricted Project. · View Herald Transcript
This revision is now accepted and ready to land.Jun 17 2020, 9:40 AM
This revision was automatically updated to reflect the committed changes.