This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fold abs with dominating condition
ClosedPublic

Authored by nikic on Sep 5 2020, 2:12 AM.

Details

Summary

Similar to D87168, but for abs. If we have a dominating x >= 0 condition, then we know that abs(x) is x. This fold is in InstCombine, because we need to create a sub instruction for the x < 0 case.

Diff Detail

Event Timeline

nikic created this revision.Sep 5 2020, 2:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2020, 2:12 AM
nikic requested review of this revision.Sep 5 2020, 2:12 AM
spatel accepted this revision.Sep 5 2020, 6:11 AM

LGTM

This revision is now accepted and ready to land.Sep 5 2020, 6:11 AM
This revision was automatically updated to reflect the committed changes.