[PATCH] D92608: [JumpThreading] Call eraseBlock when folding a conditional branch

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 21:09:04 PST 2020


yrouban accepted this revision.
yrouban added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Transforms/Scalar/JumpThreading.cpp:1097
                       << "' folding undef terminator: " << *BBTerm << '\n');
     BranchInst::Create(BBTerm->getSuccessor(BestSucc), BBTerm);
     BBTerm->eraseFromParent();
----------------
should not we BPI->eraseBlock(BB) here? another patch?


================
Comment at: llvm/lib/Transforms/Scalar/JumpThreading.cpp:1114
     ConstantFoldTerminator(BB, true, nullptr, DTU);
+    if (HasProfileData)
+      BPI->eraseBlock(BB);
----------------
can we add an assertion on the return value of the ConstantFoldTerminator() call?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92608/new/

https://reviews.llvm.org/D92608



More information about the llvm-commits mailing list