OSDN Git Service

Subzero: Refactor tracking of Defs and block-local Variables.
authorJim Stichnoth <stichnot@chromium.org>
Mon, 22 Sep 2014 23:02:59 +0000 (16:02 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Mon, 22 Sep 2014 23:02:59 +0000 (16:02 -0700)
commit144cdceaebc730d39e35861e4cc9577545e26bce
treefafb8de3111f363bd2763119572822505a5a22a2
parentcff9dae72be7c5c762bbc26333cd1464812836ef
Subzero: Refactor tracking of Defs and block-local Variables.

This affects tracking of two kinds of Variable metadata: whether a
Variable is block-local (i.e., all uses are in a single block) and if
so, which CfgNode that is; and whether a Variable has a single defining
instruction, and if so, which Inst that is.

Originally, this metadata was constructed incrementally, which was
quite fragile and most likely inaccurate under many circumstances.

In the new approach, this metadata is reconstructed in a separate pass
as needed.

As a side benefit, the metadata fields are removed from each Variable
and pulled into a separate structure, shrinking the size of Variable.

There should be no functional changes, except that simple stack slot
coalescing is turned off under Om1, since it takes a separate pass to
calculate block-local variables, and passes are minimized under Om1.
As a result, a couple of the lit tests needed to be changed.

There are a few non-mechanical changes, generally to tighten up
Variable tracking for liveness analysis.

This is being done mainly to get precise Variable definition
information so that register allocation can infer the best register
preferences as well as when overlapping live ranges are allowable.

BUG=none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/589003002
19 files changed:
src/IceCfg.cpp
src/IceCfg.h
src/IceCfgNode.cpp
src/IceConverter.cpp
src/IceDefs.h
src/IceInst.cpp
src/IceInst.h
src/IceInstX8632.cpp
src/IceInstX8632.h
src/IceLiveness.cpp
src/IceOperand.cpp
src/IceOperand.h
src/IceTargetLowering.cpp
src/IceTargetLowering.h
src/IceTargetLoweringX8632.cpp
src/IceTargetLoweringX8632.h
src/PNaClTranslator.cpp
tests_lit/llvm2ice_tests/align-spill-locations.ll
tests_lit/llvm2ice_tests/returns_twice_no_coalesce.ll