This is an archive of the discontinued LLVM Phabricator instance.

[InstSimplify] Report "Changed" also when only deleting dead instructions
ClosedPublic

Authored by bjope on Aug 8 2019, 2:12 PM.

Details

Summary

Make sure that we report that changes has been made
by InstSimplify also in situations when only trivially
dead instructions has been removed. If for example a call
is removed the call graph must be updated.

Bug seem to have been introduced by llvm-svn r367173
(commit 02b9e45a7e4b81), since the code in question
was rewritten in that commit.

Diff Detail

Repository
rL LLVM

Event Timeline

bjope created this revision.Aug 8 2019, 2:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2019, 2:12 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
spatel accepted this revision.Aug 8 2019, 2:28 PM

LGTM.

I stepped through this example, and wouldInstructionBeTriviallyDead() returns true because the call has neither uses nor side effects. So we mark it as dead, and then it gets deleted. I'm not sure if that explains the other bug reports mentioned in D65336 though.

This revision is now accepted and ready to land.Aug 8 2019, 2:28 PM
This revision was automatically updated to reflect the committed changes.