[PATCH] D22551: CodeGen: If Convert blocks that would form a diamond when tail-merged.

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 11:23:44 PDT 2016


davidxl added a comment.

I am torn about this change. While this looks like a useful thing to do, I suspect this is not the right way to approach the problem.

The example actually confirms the fact the pre-layout tailmerging is a good normalization/enabler pass for later optimizations. This is the reason why it should be run with lower threshold enabling as much optimization as possible, and later let TailDup to undo those that do not bring benefit and to improve layout.

Another question is that whether this patch can handle more cases where (tailMerge + ifcvt) can not handle. If not, it seems to me the patch seems to have duplicated logics (e.g, counting dups) in tailMerge which is not the right approach.

Is this patch required to enable your tailDup enhancement patch? I don't think this one is essential for it.   We can probably focus on getting your tailDup patch in first (it is very close to get -- probably just to make your latest tailMerge tuning  to be enabled only in post layout mode?)


https://reviews.llvm.org/D22551





More information about the llvm-commits mailing list