This is an archive of the discontinued LLVM Phabricator instance.

[VP] Condition in vp.select|merge not a VP mask
ClosedPublic

Authored by simoll on Feb 4 2022, 2:45 AM.

Details

Summary

vp.select|merge both select lanes based on a condition mask. Unlike other VP intrinsics the lanes are defined where the condition mask is false. Hence, the condition mask in vp.select|mask is not a mask in the sense of VP intrinsics.
By doing not treating the condition mask specially, vp.select becomes the canonical VP translation of the select instruction.

Diff Detail

Event Timeline

simoll created this revision.Feb 4 2022, 2:45 AM
simoll requested review of this revision.Feb 4 2022, 2:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2022, 2:45 AM

Makes sense to me: it's not a mask. I was looking around to see what knock-on effects this has, and good news is that I think this fixes a bug we're not testing where an all-zeros "mask" will DAGCombine to undef (visitVPOp). Could you maybe pre-commit a test for that and show this patch fixing it?

On that note: I don't know if this is truly a child of D105283. Can't we merge it right away?

Makes sense to me: it's not a mask. I was looking around to see what knock-on effects this has, and good news is that I think this fixes a bug we're not testing where an all-zeros "mask" will DAGCombine to undef (visitVPOp). Could you maybe pre-commit a test for that and show this patch fixing it?

On that note: I don't know if this is truly a child of D105283. Can't we merge it right away?

I'll commit an XFAIL test for VE and update with this patch to a passing test. D105283 only depends on this patch (no other way to add dependence edges) - we can merge this.

Makes sense to me: it's not a mask. I was looking around to see what knock-on effects this has, and good news is that I think this fixes a bug we're not testing where an all-zeros "mask" will DAGCombine to undef (visitVPOp). Could you maybe pre-commit a test for that and show this patch fixing it?

On that note: I don't know if this is truly a child of D105283. Can't we merge it right away?

Actually, DAGCombine won't do that because it only folds bvp inary operators mem ops and reduction. So, also nothing to test.

frasercrmck accepted this revision.Feb 15 2022, 7:41 AM

Makes sense to me: it's not a mask. I was looking around to see what knock-on effects this has, and good news is that I think this fixes a bug we're not testing where an all-zeros "mask" will DAGCombine to undef (visitVPOp). Could you maybe pre-commit a test for that and show this patch fixing it?

On that note: I don't know if this is truly a child of D105283. Can't we merge it right away?

Actually, DAGCombine won't do that because it only folds bvp inary operators mem ops and reduction. So, also nothing to test.

Yes, you're right, sorry. visitVPOp is more careful than I thought.

LGTM.

This revision is now accepted and ready to land.Feb 15 2022, 7:41 AM
This revision was landed with ongoing or failed builds.Feb 15 2022, 9:19 AM
This revision was automatically updated to reflect the committed changes.