This is an archive of the discontinued LLVM Phabricator instance.

[JumpThreading] Remove extraneous calls to setEdgeProbability
ClosedPublic

Authored by kazu on Oct 27 2020, 9:02 PM.

Details

Summary

This patch removes extraneous calls to setEdgeProbability introduced
in c91487769d80487eba1712a7a172a1c8977a9b4f.

The follow-up patch, a7b662d0f4098371b96ce4446fb0eba79b0b649f, has
since fixed BranchProbabilityInfo::eraseBlock, so we don't need to
worry about getting stale values from getEdgeProbability.

Also, since getEdgeProbability(BB, BB->getSingleSuccessor()) returns
edge probability 1/1 by default for BB with exactly one successor
edge, we don't need to explicitly call setEdgeProbability.

This patch introduces almost no functional change, but we do end up
reducing debug messages from setEdgeProbability.

Diff Detail

Event Timeline

kazu created this revision.Oct 27 2020, 9:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2020, 9:02 PM
kazu requested review of this revision.Oct 27 2020, 9:02 PM
MaskRay accepted this revision.Oct 27 2020, 9:08 PM

Should thread-prob-3.ll be renumbered?

LGTM but I hope other reviews can confirm.

This revision is now accepted and ready to land.Oct 27 2020, 9:08 PM
kazu added a comment.Oct 27 2020, 9:12 PM

Should thread-prob-3.ll be renumbered?

LGTM but I hope other reviews can confirm.

Thank you for the review. Yes, I am going to rename thread-prob-3.ll in a separate patch.

This revision was landed with ongoing or failed builds.Oct 27 2020, 9:13 PM
This revision was automatically updated to reflect the committed changes.
llvm/lib/Transforms/Scalar/JumpThreading.cpp