This is an archive of the discontinued LLVM Phabricator instance.

[LoopVectorizer] Fix inloop reductions mask placement
ClosedPublic

Authored by dmgreen on Jan 4 2023, 10:46 AM.

Details

Summary

The validation of vplans could fail if an inloop reduction was created with a block-in mask that did not dominate the reduction. This makes sure that the insert point is set when creating the mask, to ensure it dominates the reduction.

Diff Detail

Event Timeline

dmgreen created this revision.Jan 4 2023, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2023, 10:46 AM
dmgreen requested review of this revision.Jan 4 2023, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2023, 10:46 AM
SjoerdMeijer accepted this revision.Jan 5 2023, 1:01 AM

Looks like a good fix to me.
Perhaps wait a day in case there are other ideas about that.

llvm/test/Transforms/LoopVectorize/reduction-inloop.ll
1125

Nit, perhaps: verification -> vplan validation ?

1213

same

This revision is now accepted and ready to land.Jan 5 2023, 1:01 AM
fhahn accepted this revision.Jan 5 2023, 1:07 AM

LGTM, thanks!

llvm/test/Transforms/LoopVectorize/reduction-inloop.ll
1125

I think what fails is the VPlan verifier, so VPlan verification would probably be best.

This revision was landed with ongoing or failed builds.Jan 5 2023, 3:37 AM
This revision was automatically updated to reflect the committed changes.