OSDN Git Service

Subzero: Consider all instruction variables for register preference.
authorJim Stichnoth <stichnot@chromium.org>
Mon, 12 Oct 2015 22:24:46 +0000 (15:24 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Mon, 12 Oct 2015 22:24:46 +0000 (15:24 -0700)
commit28b71be495bb1eada446ba36b5236914d79cea0e
tree4f75e14fb2eaca55fb5a19759e73ef231556e766
parent4001c9394cade69a60a6b798b7ece891f3b68abb
Subzero: Consider all instruction variables for register preference.

The original code only looked at top-level source operands in the defining instruction, with a TODO to instead consider all inner variables in the instruction.

The primary reason is so that we end up with more instructions like
  mov eax, eax
which are later elided as redundant assignments.

A secondary reason is to foster more instructions like:
  mov ecx, [ecx]
rather than
  mov eax, [ecx]
where ecx's live range ends.  This hopefully keeps eax (in the latter case) free for longer and maybe allow some other variable to get a register.  By considering all instruction variables, we enable this.

BUG= none
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1392383003 .
src/IceInst.cpp
src/IceInst.h
src/IceInstARM32.h
src/IceInstVarIter.h
src/IceInstX86Base.h
src/IceRegAlloc.cpp
src/IceTargetLowering.cpp