This is an archive of the discontinued LLVM Phabricator instance.

[InstSimplify] Fold division by zero to poison
ClosedPublic

Authored by nikic on Jan 3 2021, 9:39 AM.

Details

Summary

Div/rem by zero is immediate undefined behavior and anything goes. Currently we fold it to undef, this patch changes it to fold to poison instead, which is slightly stronger.

Diff Detail

Event Timeline

nikic created this revision.Jan 3 2021, 9:39 AM
nikic requested review of this revision.Jan 3 2021, 9:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 3 2021, 9:39 AM
aqjune accepted this revision.Jan 3 2021, 11:51 AM

LGTM - Thanks!

This revision is now accepted and ready to land.Jan 3 2021, 11:51 AM
This revision was automatically updated to reflect the committed changes.