This is an archive of the discontinued LLVM Phabricator instance.

[JumpThreading] Refactor ThreadEdge
ClosedPublic

Authored by kazu on Nov 15 2019, 1:20 PM.

Details

Summary

This patch moves various checks out of ThreadEdge, making the function
always perform jump threading. The rational behind this is that I'd
like to use ThreadEdge without its checks in my upcoming patch.

Diff Detail

Event Timeline

kazu created this revision.Nov 15 2019, 1:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2019, 1:20 PM
Herald added subscribers: jfb, hiraditya. · View Herald Transcript
wmi added a comment.Nov 19 2019, 11:34 AM

Maybe we can rename current ThreadEdge to TryThreadEdge and let TryThreadEdge call ThreadEdge to do the transformation?

fhahn added a subscriber: fhahn.Nov 19 2019, 12:35 PM

I think it would be good to keep the checks as assertions in ThreadEdge, to make sure the pre-conditions hold if it gets multiple users.

kazu updated this revision to Diff 230464.Nov 21 2019, 8:45 AM

Updated to incorporate the feedback.

wmi accepted this revision.Nov 21 2019, 11:30 AM

LGTM.

This revision is now accepted and ready to land.Nov 21 2019, 11:30 AM
This revision was automatically updated to reflect the committed changes.