[PATCH] D55110: call dependencies between BranchFolder::replaceTailWithBranchTo and BranchFolder::mergeCommonTails

Pierrick via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 30 02:47:49 PST 2018


pbrunet created this revision.
pbrunet added a reviewer: MatzeB.
Herald added a subscriber: llvm-commits.

Both functions use LiveRegs but init is only done in mergeCommonTails. It creates a dependency between this function while an init instead of clear in replaceTailWithBranchTo would do the job.

Also, if MBB->predecessors is empty (I don't know if it is possible), the initialization would not be done.


Repository:
  rL LLVM

https://reviews.llvm.org/D55110

Files:
  lib/CodeGen/BranchFolding.cpp


Index: lib/CodeGen/BranchFolding.cpp
===================================================================
--- lib/CodeGen/BranchFolding.cpp
+++ lib/CodeGen/BranchFolding.cpp
@@ -376,7 +376,7 @@
   if (UpdateLiveIns) {
     // OldInst should always point to an instruction.
     MachineBasicBlock &OldMBB = *OldInst->getParent();
-    LiveRegs.clear();
+    LiveRegs.init(*TRI);
     LiveRegs.addLiveOuts(OldMBB);
     // Move backward to the place where will insert the jump.
     MachineBasicBlock::iterator I = OldMBB.end();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55110.176069.patch
Type: text/x-patch
Size: 526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181130/29198be9/attachment.bin>


More information about the llvm-commits mailing list