[PATCH] D20505: Codegen: Outline for chains of tail-duplicable blocks.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 14:57:29 PST 2016


davidxl added a comment.

There are two independent problems that this patch tries to address.

1. Enable tail duplication for cases when current layout prefers topological order
2. Handling a sequence of tail-duplicatable blocks.

Please split out 1) and 2) into two different patches.

For patch 1), I don't think it is the right approach to piggy back the implementation on the outline heuristics, please split it out. Ideally, the fix should be simply add one new heuristic checked before hasBetterLayoutSuccessor check or  preserve top order only when tail dup is not good:

  if (hasBetterLayoutSuccessor(... ) ) {
           if (!IsTailDupCandidate(Succ)) {
                 continue;
           }
   }


https://reviews.llvm.org/D20505





More information about the llvm-commits mailing list