This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Teach canCreateUndefOrPoison that ctpop does not create undef or poison.
ClosedPublic

Authored by craig.topper on Mar 23 2021, 12:23 PM.

Details

Summary

This select of ctpop with 0 pattern can get left behind after
loop idiom recognize converts a loop to ctpop. LLVM 10 was able
to optimize this, but LLVM 11 and later is not. The difference
seems to be that some select transforms are now limited based
on canCreateUndefOrPoison.

Teaching canCreateUndefOrPoison about ctpop restores the
LLVM 10 codegen.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 23 2021, 12:23 PM
craig.topper requested review of this revision.Mar 23 2021, 12:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2021, 12:23 PM
spatel accepted this revision.Mar 23 2021, 12:34 PM

LGTM - I'd guess that most of our intrinsics should end up in this list.

This revision is now accepted and ready to land.Mar 23 2021, 12:34 PM
This revision was landed with ongoing or failed builds.Mar 23 2021, 12:47 PM
This revision was automatically updated to reflect the committed changes.