Reuse lowered phi nodes.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 16 Dec 2009 18:55:53 +0000 (18:55 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 16 Dec 2009 18:55:53 +0000 (18:55 +0000)
commit74215fc29fa748e006c0309671555d5873bac56a
tree32d042de9167f3c098769bec680e3d3f83b11549
parent4eeeb4767ca4e020e7d9aff1be671d2fc6f74b81
Reuse lowered phi nodes.

Tail duplication produces lots of identical phi nodes in different basic
blocks. Teach PHIElimination to reuse the join registers when lowering a phi
node that is identical to an already lowered node. This saves virtual
registers, and more importantly it avoids creating copies the the coalescer
doesn't know how to eliminate.

Teach LiveIntervalAnalysis about the phi joins with multiple uses.

This patch significantly reduces code size produced by -pre-regalloc-taildup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91549 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/PHIElimination.cpp
lib/CodeGen/PHIElimination.h