This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fix worklist management in return combine
ClosedPublic

Authored by nikic on Jan 16 2020, 12:43 PM.

Details

Summary

There are two related bugs here: First, we don't add the operand we're replacing to the worklist, which means it may not get DCEd (see test change). Second, usually this would just get picked up in the next iteration, but we also do not report the instruction as changed. This means that we don't get that extra instcombine iteration, and more importantly, may break the pass pipeline, as the function is not marked as changed.

Diff Detail

Event Timeline

nikic created this revision.Jan 16 2020, 12:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2020, 12:43 PM
spatel accepted this revision.Jan 17 2020, 6:26 AM

LGTM

This revision is now accepted and ready to land.Jan 17 2020, 6:26 AM
This revision was automatically updated to reflect the committed changes.