[PATCH] D18226: Codegen: Tail-duplicate during placement.

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 13:19:23 PDT 2016


iteratee added inline comments.

================
Comment at: lib/CodeGen/BranchFolding.cpp:641
@@ -638,2 +640,3 @@
   // heuristics.
+  // This is broken, as it breaks tail-dup then merge.
   unsigned EffectiveTailLen = CommonTailLen;
----------------
I don't think that there is a way to fix it. The heuristic overcounts fractional tails where one block would end up with a jump, but another would not. It's probably fine to use it early, but during layout we have to be stricter about the thresholds.

================
Comment at: test/CodeGen/PowerPC/tail-dup-analyzable-fallthrough.ll:5
@@ +4,3 @@
+
+%struct.HashBucket = type { %struct.HashBucket*, i64, i64* }
+; CHECK: divdu
----------------
davidxl wrote:
> Please simplify this test case and document what is the expected layout with tailDup. The test as it stands now is hard to read.
This test was reduced from an actual regression that I introduced and then fixed.

I've added comments to explain what went wrong.

================
Comment at: test/CodeGen/PowerPC/tail-dup-layout.ll:2
@@ +1,3 @@
+; RUN: llc -outline-optional-branches -O2 < %s | FileCheck %s
+target datalayout = "e-m:e-i64:64-n32:64"
+target triple = "powerpc64le-grtev4-linux-gnu"
----------------
davidxl wrote:
> Same here : simplify the test case and document the expected output with description. 
I don't see that this test is that complex at all, except for the optional bodies. Unfortunately, they have to a certain size or they won't get outlined. I've added an easier to read expectation of layout, and a description of what the CHECK lines are looking for.


http://reviews.llvm.org/D18226





More information about the llvm-commits mailing list