This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Try to determine sign bit during div/rem expansion
ClosedPublic

Authored by nikic on May 7 2020, 1:49 PM.

Details

Summary

This is preparation for D79294, which removes an expensive InstSimplify optimization, on the assumption that it will be picked up by InstCombine instead. Of course, this does not hold up if a backend performs non-trivial IR expansions without running a canonicalization pipeline afterwards, which turned up as an issue in the context of AMDGPU div/rem expansion.

This patch mitigates the issue by explicitly performing a known bits calculation where it matters. No test changes, as those would only be visible after the other patch lands.

Diff Detail

Event Timeline

nikic created this revision.May 7 2020, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 7 2020, 1:49 PM
arsenm accepted this revision.May 7 2020, 2:08 PM
This revision is now accepted and ready to land.May 7 2020, 2:08 PM
This revision was automatically updated to reflect the committed changes.