Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Issue 1253833002: Subzero: Cleanly implement register allocation after phi lowering. (Closed)

Created:
5 years, 5 months ago by Jim Stichnoth
Modified:
5 years, 4 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Subzero: Cleanly implement register allocation after phi lowering. After finding a valid linearization of phi assignments, the old approach calls a complicated target-specific method that lowers and ad-hoc register allocates the phi assignments. In the new approach, we use existing target lowering to lower assignments into mov/whatever instructions, and enhance the register allocator to be able to forcibly spill and reload a register if one is needed but none are available. The new approach incrementally updates liveness and live ranges for newly added nodes and variable uses, to avoid having to expensively recompute it all. Advanced phi lowering is enabled now on ARM, and constant blinding no longer needs to be disabled during phi lowering. Some of the metadata regarding which CfgNode a local variable belongs to, needed to be made non-const, in order to add spill/fill instructions to a CfgNode during register allocation. Most of the testing came from spec2k. There are some minor differences in the output regarding stack frame offsets, probably related to the order that new nodes are phi-lowered. The changes related to constant blinding were tested by running spec with "-randomize-pool-immediates=randomize -randomize-pool-threshold=8". Unfortunately, this appears to add about 10% to the translation time for 176.gcc. The cost is clear in the -timing output so it can be investigated later. There is a TODO suggesting the possible cause and solution, for later investigation. BUG= none R=jvoung@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=a3f57b9a6c7dbd3be7bf86dba697e9219c3413b2

Patch Set 1 #

Patch Set 2 : Cleanup #

Total comments: 21

Patch Set 3 : Code review changes #

Patch Set 4 : Improve translation-time performance #

Unified diffs Side-by-side diffs Delta from patch set Stats (+312 lines, -340 lines) Patch
M src/IceCfg.cpp View 1 2 3 1 chunk +39 lines, -0 lines 0 comments Download
M src/IceCfgNode.cpp View 10 chunks +54 lines, -44 lines 0 comments Download
M src/IceClFlags.cpp View 1 chunk +1 line, -9 lines 0 comments Download
M src/IceDefs.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/IceLiveness.h View 2 chunks +4 lines, -0 lines 0 comments Download
M src/IceLiveness.cpp View 1 4 chunks +44 lines, -19 lines 0 comments Download
M src/IceOperand.h View 1 3 chunks +10 lines, -8 lines 0 comments Download
M src/IceOperand.cpp View 1 8 chunks +14 lines, -20 lines 0 comments Download
M src/IceRegAlloc.h View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M src/IceRegAlloc.cpp View 1 2 3 14 chunks +104 lines, -13 lines 0 comments Download
M src/IceTargetLowering.h View 2 chunks +5 lines, -4 lines 0 comments Download
M src/IceTargetLowering.cpp View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
M src/IceTargetLoweringARM32.h View 1 chunk +0 lines, -2 lines 0 comments Download
M src/IceTargetLoweringARM32.cpp View 1 2 2 chunks +7 lines, -20 lines 0 comments Download
M src/IceTargetLoweringMIPS32.h View 1 chunk +0 lines, -2 lines 0 comments Download
M src/IceTargetLoweringMIPS32.cpp View 1 chunk +0 lines, -9 lines 0 comments Download
M src/IceTargetLoweringX86Base.h View 1 chunk +0 lines, -2 lines 0 comments Download
M src/IceTargetLoweringX86BaseImpl.h View 1 2 3 3 chunks +9 lines, -184 lines 0 comments Download
M src/IceTimerTree.def View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
Jim Stichnoth
Anthony (and others) - please check that I've removed all the hacks that were needed ...
5 years, 5 months ago (2015-07-24 13:55:03 UTC) #2
jvoung (off chromium)
https://codereview.chromium.org/1253833002/diff/20001/src/IceClFlags.cpp File src/IceClFlags.cpp (left): https://codereview.chromium.org/1253833002/diff/20001/src/IceClFlags.cpp#oldcode405 src/IceClFlags.cpp:405: // TODO(jvoung): We need lowerPhiAssignments to handle spilling Thanks! ...
5 years, 5 months ago (2015-07-24 19:43:09 UTC) #3
Jim Stichnoth
https://codereview.chromium.org/1253833002/diff/20001/src/IceRegAlloc.cpp File src/IceRegAlloc.cpp (right): https://codereview.chromium.org/1253833002/diff/20001/src/IceRegAlloc.cpp#newcode78 src/IceRegAlloc.cpp:78: Str << "R=" << buf << " V="; On ...
5 years, 5 months ago (2015-07-26 04:47:50 UTC) #4
jvoung (off chromium)
LGTM for my comments https://codereview.chromium.org/1253833002/diff/20001/src/IceRegAlloc.cpp File src/IceRegAlloc.cpp (right): https://codereview.chromium.org/1253833002/diff/20001/src/IceRegAlloc.cpp#newcode106 src/IceRegAlloc.cpp:106: // infinite-weight and pre-colored variables. ...
5 years, 4 months ago (2015-07-27 22:28:15 UTC) #5
Jim Stichnoth
On 2015/07/27 22:28:15, jvoung wrote: > LGTM for my comments Thanks! I decided to hold ...
5 years, 4 months ago (2015-07-28 18:30:43 UTC) #6
Jim Stichnoth
A fairly simple change ends up recovering about half of the translation-time performance loss on ...
5 years, 4 months ago (2015-07-30 07:22:18 UTC) #7
Jim Stichnoth
5 years, 4 months ago (2015-07-30 19:46:11 UTC) #8
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
a3f57b9a6c7dbd3be7bf86dba697e9219c3413b2 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698