This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Don't vectorize PHIs in catchswitch blocks
ClosedPublic

Authored by wjschmidt on Jul 18 2022, 2:19 PM.

Details

Summary
We currently assert in vectorizeTree(TreeEntry*) when processing a PHI
bundle in a block containing a catchswitch.  We attempt to set the
IRBuilder insertion point following the catchswitch, which is invalid.
This is done so that ShuffleBuilder.finalize() knows where to insert
a shuffle if one is needed.

To avoid this occurring, watch out for catchswitch blocks during
buildTree_rec() processing, and avoid adding PHIs in such blocks to
the vectorizable tree.  It is unlikely that constraining vectorization
over an exception path will cause a noticeable performance loss, so
this seems preferable to trying to anticipate when a shuffle will and
will not be required.

Diff Detail

Event Timeline

wjschmidt created this revision.Jul 18 2022, 2:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 2:19 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
wjschmidt requested review of this revision.Jul 18 2022, 2:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 2:19 PM
This revision is now accepted and ready to land.Jul 18 2022, 5:29 PM
wjschmidt closed this revision.Sep 20 2022, 5:52 AM

Whoops, I forgot to reference this revision when I committed the patch. This was bccc9aa81c1c1d212acd3314895731ec4de30e35.