This is an archive of the discontinued LLVM Phabricator instance.

[SLP] drop poison-generating flags for shuffle reduction ops (PR44536)
ClosedPublic

Authored by spatel on Jan 30 2020, 10:32 AM.

Details

Summary

We may calculate reassociable math ops in arbitrary order when creating a shuffle reduction, so there's no guarantee that things like 'nsw' hold on those intermediate values. Drop all poison-generating flags for safety.

This change is limited to shuffle reductions because I don't think we have a problem in the general case (where we intersect flags of each scalar op that goes into a vector op), but if there's evidence of other cases being wrong, we can extend this fix to cover those cases.

https://bugs.llvm.org/show_bug.cgi?id=44536

Diff Detail

Event Timeline

spatel created this revision.Jan 30 2020, 10:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 30 2020, 10:32 AM
spatel updated this revision to Diff 241511.Jan 30 2020, 10:38 AM

Patch updated:
Uploaded a wrong draft of the patch initially - the flag-dropping should be done *inside* the loop to apply to all ops in the reduction.

This revision is now accepted and ready to land.Jan 30 2020, 10:42 AM

I see that the tests now pass with alive, thanks!