This is an archive of the discontinued LLVM Phabricator instance.

[SLPVectorizer] Do not assume extracelement idx is a ConstantInt.
ClosedPublic

Authored by fhahn on Feb 18 2020, 3:16 AM.

Details

Summary

The index of an ExtractElementInst is not guaranteed to be a
ConstantInt. It can be any integer value. Check explicitly for
ConstantInts.

The new test cases illustrate scenarios where we crash without
this patch. I've also added another test case to check the matching
of extractelement vector ops works.

Diff Detail

Event Timeline

fhahn created this revision.Feb 18 2020, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2020, 3:16 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
simoll added a subscriber: simoll.Feb 18 2020, 4:43 AM
This revision is now accepted and ready to land.Feb 18 2020, 6:43 AM
This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Feb 18 2020, 9:27 AM

Thanks! I think we might want to pick this on the 10.0 release branch. I've filed https://bugs.llvm.org/show_bug.cgi?id=44950