This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fix multi-use handling in cttz transform
ClosedPublic

Authored by nikic on Feb 16 2020, 2:03 AM.

Details

Summary

The select-of-cttz transform can currently duplicate cttz intrinsics and zext/trunc ops. The cause is that it unnecessarily duplicates the intrinsic and the zext/trunc when setting the "undef_on_zero" flag to false. However, it's always legal to set the flag from true to false, so we can make this replacement even if there are extra users.

Diff Detail

Event Timeline

nikic created this revision.Feb 16 2020, 2:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2020, 2:03 AM
spatel accepted this revision.Feb 17 2020, 2:05 PM

LGTM

This revision is now accepted and ready to land.Feb 17 2020, 2:05 PM
This revision was automatically updated to reflect the committed changes.