[PATCH] D90284: [JumpThreading] Remove extraneous calls to setEdgeProbability

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 21:02:18 PDT 2020


kazu created this revision.
kazu added reviewers: wmi, MaskRay, efriedma.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
kazu requested review of this revision.

This patch removes extraneous calls to setEdgeProbability introduced
in c91487769d80487eba1712a7a172a1c8977a9b4f <https://reviews.llvm.org/rGc91487769d80487eba1712a7a172a1c8977a9b4f>.

The follow-up patch, a7b662d0f4098371b96ce4446fb0eba79b0b649f <https://reviews.llvm.org/rGa7b662d0f4098371b96ce4446fb0eba79b0b649f>, 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90284

Files:
  llvm/lib/Transforms/Scalar/JumpThreading.cpp
  llvm/test/Transforms/JumpThreading/thread-prob-1.ll
  llvm/test/Transforms/JumpThreading/thread-prob-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90284.301173.patch
Type: text/x-patch
Size: 4222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201028/c644bf67/attachment.bin>


More information about the llvm-commits mailing list