Page MenuHomePhabricator

[LoopVectorize] Use available masked vector functions when required
Needs ReviewPublic

Authored by huntergr on Oct 19 2022, 5:34 AM.

Details

Summary

This patch builds on D132458 (use masked vector functions with a dummy mask when no unmasked variant is available) and D134422 (scalarize function calls when masking is required), adding support for actually using the masked functions when masking is required, either due to the control flow in the scalar loop or because we're performing tail folding.

Diff Detail

Event Timeline

huntergr created this revision.Oct 19 2022, 5:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 5:34 AM
huntergr requested review of this revision.Oct 19 2022, 5:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 5:34 AM
huntergr updated this revision to Diff 477898.Nov 25 2022, 2:31 AM

Rebased on top of the latest version of D132458, which incorporates the vector function into the vplan recipe instead of looking it up again.

tschuett added inline comments.
llvm/include/llvm/Analysis/VectorUtils.h
291
if (Info.isMasked())
  return true;


return false;
tschuett added inline comments.Nov 25 2022, 3:00 AM
llvm/include/llvm/Analysis/VectorUtils.h
291
  if (!VF || Info.Shape.VF == *VF)
    if (Info.isMasked())


return false;
huntergr updated this revision to Diff 477908.Nov 25 2022, 3:50 AM

Tidied up hasMaskedVariant as requested.

huntergr marked 2 inline comments as done.Nov 25 2022, 3:51 AM
Matt added a subscriber: Matt.Thu, Feb 2, 1:15 PM