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

Issue 483453002: Subzero: Fix the simple register allocation for -Om1. (Closed)

Created:
6 years, 4 months ago by Jim Stichnoth
Modified:
6 years, 4 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Visibility:
Public.

Description

Subzero: Fix the simple register allocation for -Om1. Background: After lowering each high-level ICE instruction, Om1 calls postLower() to do simple register allocation. It only assigns registers where absolutely necessary, specifically for infinite-weight variables, while honoring pre-coloring decisions. The original Om1 register allocation never tried to reuse registers within a lowered sequence, which was generally OK except for very long lowering sequences, such as call instructions or some intrinsics. In these cases, when it ran out of physical registers, it would just reset the free list and hope for the best, but with no guarantee of correctness. The fix involves keeping track of which instruction in the lowered sequence holds the last use of each variable, and releasing each register back to the free list after its last use. This makes much better use of registers. It's not necessarily optimal, at least with respect to pre-colored variables, since those registers are black-listed even if they don't interfere with an infinite-weight variable. BUG= none R=jvoung@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=4d79fe5

Patch Set 1 #

Patch Set 2 : Remove tabs in lit test; make format-diff #

Total comments: 9

Patch Set 3 : Skip FakeKill instructions. Add an assertion. #

Patch Set 4 : Update tests after rebasing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -46 lines) Patch
M src/IceTargetLoweringX8632.cpp View 1 2 3 5 chunks +59 lines, -19 lines 0 comments Download
M tests_lit/llvm2ice_tests/ebp_args.ll View 1 1 chunk +20 lines, -21 lines 0 comments Download
M tests_lit/llvm2ice_tests/nop-insertion.ll View 1 2 3 3 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Jim Stichnoth
Adding Matt as a reviewer for old times' sake. (Also, this is an improvement that ...
6 years, 4 months ago (2014-08-16 06:32:00 UTC) #1
wala
https://codereview.chromium.org/483453002/diff/20001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/483453002/diff/20001/src/IceTargetLoweringX8632.cpp#newcode4156 src/IceTargetLoweringX8632.cpp:4156: std::map<const Variable *, const Inst *> LastUses; How about ...
6 years, 4 months ago (2014-08-18 04:44:54 UTC) #2
wala
https://codereview.chromium.org/483453002/diff/20001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/483453002/diff/20001/src/IceTargetLoweringX8632.cpp#newcode4205 src/IceTargetLoweringX8632.cpp:4205: Srcs[i] = Inst->getSrc(i); On 2014/08/18 04:44:54, wala wrote: > ...
6 years, 4 months ago (2014-08-18 04:46:31 UTC) #3
jvoung (off chromium)
https://codereview.chromium.org/483453002/diff/20001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/483453002/diff/20001/src/IceTargetLoweringX8632.cpp#newcode4166 src/IceTargetLoweringX8632.cpp:4166: continue; The second pass doesn't skip InstFakeKill, could they ...
6 years, 4 months ago (2014-08-18 16:26:08 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/483453002/diff/20001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/483453002/diff/20001/src/IceTargetLoweringX8632.cpp#newcode4156 src/IceTargetLoweringX8632.cpp:4156: std::map<const Variable *, const Inst *> LastUses; On 2014/08/18 ...
6 years, 4 months ago (2014-08-18 17:31:02 UTC) #5
jvoung (off chromium)
lgtm
6 years, 4 months ago (2014-08-18 17:46:50 UTC) #6
Jim Stichnoth
One of the tests needed to be updated after rebasing.
6 years, 4 months ago (2014-08-18 17:54:44 UTC) #7
Jim Stichnoth
6 years, 4 months ago (2014-08-18 17:55:24 UTC) #8
Message was sent while issue was closed.
Committed patchset #4 manually as 4d79fe5 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698