Revert "SimplifyCFG: fix an infinite jump-threading loop."

This reverts commit fe928d57ac.

This causes an ASAN failure. Reverting until it can be debugged.
This commit is contained in:
Andrew Trick
2021-01-28 23:46:23 -08:00
parent 0b2a6267f6
commit 67863c55b6

View File

@@ -318,8 +318,6 @@ bool SimplifyCFG::threadEdge(const ThreadInfo &ti) {
return false;
Cloner.cloneBranchTarget(SrcTerm);
JumpThreadingCost[Cloner.getNewBB()] = JumpThreadingCost[SrcTerm->getDestBB()];
// We have copied the threaded block into the edge.
auto *clonedSrc = Cloner.getNewBB();
@@ -1133,10 +1131,6 @@ bool SimplifyCFG::tryJumpThreading(BranchInst *BI) {
Cloner.cloneBranchTarget(BI);
Cloner.updateSSAAfterCloning();
// Also account the costs to the cloned DestBB, so the jump threading cannot
// loop by cloning the cloned block again.
JumpThreadingCost[Cloner.getNewBB()] += copyCosts;
// Once all the instructions are copied, we can nuke BI itself. We also add
// the threaded and edge block to the worklist now that they (likely) can be
// simplified.
@@ -2879,8 +2873,6 @@ bool SimplifyCFG::tailDuplicateObjCMethodCallSuccessorBlocks() {
Cloner.cloneBranchTarget(Branch);
Cloner.updateSSAAfterCloning();
JumpThreadingCost[Cloner.getNewBB()] = JumpThreadingCost[DestBB];
Changed = true;
// Simplify the cloned block and continue tail duplicating through its new
// successors edges.