This is an archive of the discontinued LLVM Phabricator instance.

[ReachingDefs] Make isSafeToMove more strict.
ClosedPublic

Authored by samparker on Feb 5 2020, 8:15 AM.

Details

Summary

Test that we're not moving the instruction through instructions with side-effects.

Diff Detail

Event Timeline

samparker created this revision.Feb 5 2020, 8:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2020, 8:15 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
SjoerdMeijer added inline comments.Feb 6 2020, 1:16 AM
llvm/lib/CodeGen/ReachingDefAnalysis.cpp
404

I was just looking at the similar (but not the same) check in isSafeToRemove.
Just quickly checking: that one is also checking for isReturn, do we need that here? And here we check for isCall, do we need that there?

Yeah, I'll move these out into a helper function.

samparker updated this revision to Diff 242838.Feb 6 2020, 2:00 AM

Created a helper which queries all the suspicious flags.

SjoerdMeijer accepted this revision.Feb 6 2020, 2:11 AM

Cheers, nice one

This revision is now accepted and ready to land.Feb 6 2020, 2:11 AM
This revision was automatically updated to reflect the committed changes.