This is an archive of the discontinued LLVM Phabricator instance.

[ADCE] Fix incorrect reporting of CFG changes
ClosedPublic

Authored by mkazantsev on Apr 14 2020, 6:03 AM.

Details

Summary

This patch fixes 2 related bugs in ADCE:

  • performDeadCodeElimination does not report changes if it did ONLY CFG changes (affects both old and new pass managers);
  • When control flow removal is enabled, new pass manager does not drop CFG analyses.

Both can lead to incorrect loop info after ADCE that does only CFG changes.

Diff Detail

Event Timeline

mkazantsev created this revision.Apr 14 2020, 6:03 AM
dantrushin accepted this revision.Apr 14 2020, 6:07 AM

Good catch!
LGTM

This revision is now accepted and ready to land.Apr 14 2020, 6:07 AM

Made preservation logic tad smarter (do not preserve DT analyzes twice)

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2020, 6:55 AM