GBE: Optmize phi elimination
authorRuiling Song <ruiling.song@intel.com>
Tue, 3 Jun 2014 05:53:15 +0000 (13:53 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Wed, 4 Jun 2014 02:15:19 +0000 (10:15 +0800)
commitada63a7258775396d9a2e4935d8284ef1126679d
treea0dd4deb8de1a4968a99d278da9eccf172598b9c
parent38adc9b13bcaacdb0d3e916d9a46cea2ec708b0e
GBE: Optmize phi elimination

During phi elimination, we simply insert 3 MOVs for one phi instruction
to avoid lost copy issue. But in fact, only two of them are needed for
most of time. This patch tries to see whether the move from phiCopy
to phi can be avoided.

The patch basically checks whether the phiCopy and phi have live range
interference. If no, then they can be coalesced, thus one instruction
can be optimized.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
backend/src/ir/value.cpp
backend/src/llvm/llvm_gen_backend.cpp