This is an archive of the discontinued LLVM Phabricator instance.

[LV] A unified scalarizeInstruction() for Vectorizer and Unroller
ClosedPublic

Authored by gilr on Mar 7 2017, 1:34 PM.

Details

Summary

Unroller's specialized scalarizeInstruction() is mostly duplicating Vectorizer's variant. OTOH Vectorizer's scalarizeInstruction() already supports the special case of VF==1 except for avoiding mask-bit extraction in that case. This patch removes Unroller's specialized version in favor of a unified method.

The only functional difference between the two variants seems to be setting memcheck metadata for loads and stores only in the Vectorizer's variant, which seems like a bug in Unroller (correct?). To keep this patch an NFC Vecotrizer's variant doesn't set memcheck metadata for VF==1. If memcheck metadata is indeed relevant for Unroller I'll remove the VF == 1 check in a separate patch as a bug fix.

Follows https://reviews.llvm.org/D28975 and its tentative breakdown.

Joint work with Ayal.

Diff Detail

Repository
rL LLVM

Event Timeline

gilr created this revision.Mar 7 2017, 1:34 PM
mkuper accepted this revision.Mar 8 2017, 5:29 PM

LGTM, Thanks!
(If you're not committing the addMetaData fix immediately after this, please put a FIXME above the "if (VF > 1)")

This revision is now accepted and ready to land.Mar 8 2017, 5:29 PM
gilr added a comment.Mar 12 2017, 4:47 AM

(If you're not committing the addMetaData fix immediately after this, please put a FIXME above the "if (VF > 1)")

Right, will add a FIXME to make the commit self-contained. Thanks!

This revision was automatically updated to reflect the committed changes.