This is an archive of the discontinued LLVM Phabricator instance.

[CodeMoverUtils]Add option to skip control flow equivalence checks when sure
Needs RevisionPublic

Authored by RithikSharma on Sep 3 2020, 9:03 AM.

Details

Summary

This patch adds option to skip control flow equivalence checks, there are passes which has code-motion in control flow equivalent blocks and due to unavailability of PDT, it doesn't allow us to use CodeMoverUtils in it. The code-motion client can pass true for skipping control flow equivalence and can also pass PDT as an argument instead of true/false if it is available.

Diff Detail

Unit TestsFailed

Event Timeline

RithikSharma created this revision.Sep 3 2020, 9:03 AM
RithikSharma requested review of this revision.Sep 3 2020, 9:03 AM
bmahjour requested changes to this revision.Sep 3 2020, 9:20 AM
bmahjour added inline comments.
llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
313

PDT could be nullptr and *PDT could cause a segfault.

We don't need yet another version of isSafeToMoveBefore. Can you add bool skipControlFlowEquivalence to the existing isSafeToMoveBefore functions? If the boolean flag is on, then PDT is used, otherwise PDT will be unused. If a nullptr PDT is provided and the flag is on, then it returns unsafe to move.

This revision now requires changes to proceed.Sep 3 2020, 9:20 AM