[PATCH] D70247: [JumpThreading] Thread jumps through two basic blocks
Wei Mi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 6 15:12:59 PST 2020
wmi added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/JumpThreading.cpp:1552
+// Try to evaluate the value of V when the control flows from PredPredBB to
+// BB->getSingleSuccessor() and then on to BB.
+Constant *JumpThreadingPass::EvaluateOnPredecessorEdge(BasicBlock *BB,
----------------
BB->getSingleSuccessor() => BB->getSinglePredecessor() ?
================
Comment at: llvm/lib/Transforms/Scalar/JumpThreading.cpp:2068-2069
+/// Attempt to clone the sole predecessor of BB if doing so increases jump
+/// threading opportunities.
+bool JumpThreadingPass::MaybeThreadThroughTwoBasicBlocks(BasicBlock *BB,
----------------
Now the predecessor of BB will be cloned only if threading through two bb is meant to happen, so it does not just increase the chance of jump threading. Better update the comment to reflect the change.
================
Comment at: llvm/lib/Transforms/Scalar/JumpThreading.cpp:2088-2089
+ //
+ // This function simply duplicates a basic block like PredBB to increase jump
+ // threading opportunities.
+
----------------
Update the comment here.
================
Comment at: llvm/lib/Transforms/Scalar/JumpThreading.cpp:2182
+
+ // Now we are ready to duplicate PredBB.
+
----------------
Can we wrap the following code into a function saying ThreadThroughTwoBasicBlocks?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70247/new/
https://reviews.llvm.org/D70247
More information about the llvm-commits
mailing list