[llvm] [Utils][UnifyLoopExits] Avoid costly updates if nothing changed (PR #129179)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 21:13:15 PST 2025


================
@@ -169,8 +169,12 @@ static bool unifyLoopExits(DominatorTree &DT, LoopInfo &LI, Loop *L) {
 
   SmallVector<BasicBlock *, 8> GuardBlocks;
   DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Eager);
-  BasicBlock *LoopExitBlock = CHub.finalize(
+  BasicBlock *LoopExitBlock;
+  bool ChangedCFG;
+  std::tie(LoopExitBlock, ChangedCFG) = CHub.finalize(
       &DTU, GuardBlocks, "loop.exit", MaxBooleansInControlFlowHub.getValue());
+//  if (!ChangedCFG)
+//    return false;
----------------
shiltian wrote:

still leftover

https://github.com/llvm/llvm-project/pull/129179


More information about the llvm-commits mailing list