This is an archive of the discontinued LLVM Phabricator instance.

[LV] Avoid redundant operations manipulating masks
ClosedPublic

Authored by Ayal on Jul 21 2017, 7:36 AM.

Details

Summary

Avoid generating redundant operations when manipulating masks: AND with true, OR with false, compare equal to true. Model all-one masks as a null (no-mask) following the convention for masked gathers and scatters.

These redundant operations get eliminated by subsequent passes. This patch is preparing for a follow-up VPlan patch in which these operations are modeled using recipes.

Diff Detail

Repository
rL LLVM

Event Timeline

Ayal created this revision.Jul 21 2017, 7:36 AM
mssimpso edited edge metadata.Jul 21 2017, 1:05 PM

Hi Ayal,

This looks fine to me, but I don't quite follow why the patch is needed. Are we just trying to match what the VPlan recipe will eventually do?

Ayal added a comment.Jul 21 2017, 2:25 PM

This looks fine to me, but I don't quite follow why the patch is needed. Are we just trying to match what the VPlan recipe will eventually do?

As we provide patches of VPlan modelling, we're also trying to cleanup ILV's existing functionality, as in the ValueMap case. It's also possible to model ILV's existing functionality as-is, including redundant operations. But such cleanups seem desirable by themselves, and also help simplify the new modelling being introduced.

This patch is independent of D32871 which is still pending; it is preparing for a VPlan patch to follow D32871.

mssimpso accepted this revision.Jul 24 2017, 7:19 AM
In D35725#817619, @Ayal wrote:

As we provide patches of VPlan modelling, we're also trying to cleanup ILV's existing functionality, as in the ValueMap case. It's also possible to model ILV's existing functionality as-is, including redundant operations. But such cleanups seem desirable by themselves, and also help simplify the new modelling being introduced.

I agree.

This revision is now accepted and ready to land.Jul 24 2017, 7:19 AM
This revision was automatically updated to reflect the committed changes.