[PATCH] D24044: CodeGen: Tail-duplicate longer blocks that end with indirect branches.

David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 16:37:37 PDT 2016

davidxl added a comment.

Need a test case.

Also do you have any performance data?

Comment at: lib/CodeGen/BranchFolding.cpp:709
+        MachineBasicBlock &Block1 = *CurMPIter->getBlock();
+        if (Block1.empty())
+          // Look for indirect local branches, and try to avoid merging them

Comment at: lib/CodeGen/BranchFolding.cpp:713
+          // branches allows for better branch prediction.
+          if (Block1.back().isIndirectBranch() && Block1.succ_size() != 0)
+            MinCommonTailLengthInside = TailDupIndirectBranchSize + 1;
This basically disabled tailMerging for blocks with indirect branch.  Is there a way to override that? If not, why not simply disable TailMerge for such blocks directly?



More information about the llvm-commits mailing list