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

Issue 1381563004: Subzero: Fix a bug in register allocator overlap computation. (Closed)

Created:
5 years, 2 months ago by Jim Stichnoth
Modified:
5 years, 2 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: Fix a bug in register allocator overlap computation. When the register allocator decides whether to allow the candidate's live range to overlap its preferred variable's live range (and share their register), it needs to consider whether any redefinitions in one variable occur within the live range of the other variable, in which case overlap should not be allowed. There was a bug in the API for iterating over the defining instructions for a variable, in which the earliest definition might be ignored in some cases. This came from the fact that the first definition and latter definitions are split apart for translation speed reasons, and a particular API is needed for finding an unambiguous first definition, which is possible when all definitions are within a single block but not so possible when definitions cross block boundaries. (This only happens for the simple phi lowering.) Since both semantics are needed, a separate API is added to support both. For spec2k, the asm output is identical to before, so this changes nothing. When translating spec2k with "-O2 -phi-edge-split=0", there is a single minor difference in ammp that actually looks legit in both cases. However, when testing an upcoming CL, -phi-edge-split=0 triggered the bug, causing gcc and crafty to fail with incorrect output. This CL also fixes some minor issues, and adds dump output of the instruction definition list when available. BUG= none R=jpp@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=48e3ae5c62d7e626ed1a0dbbe38a7cc11a356260

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix the asserts() guard #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -38 lines) Patch
M src/IceCfg.cpp View 1 1 chunk +16 lines, -0 lines 0 comments Download
M src/IceCompileServer.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M src/IceOperand.h View 1 4 chunks +14 lines, -9 lines 0 comments Download
M src/IceOperand.cpp View 1 6 chunks +35 lines, -12 lines 0 comments Download
M src/IceRegAlloc.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M src/PNaClTranslator.cpp View 5 chunks +10 lines, -11 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
Jim Stichnoth
This is what I spent 2-3 full days tracking down. :(
5 years, 2 months ago (2015-10-01 06:44:43 UTC) #2
John
lgtm https://chromiumcodereview.appspot.com/1381563004/diff/1/src/IceOperand.cpp File src/IceOperand.cpp (right): https://chromiumcodereview.appspot.com/1381563004/diff/1/src/IceOperand.cpp#newcode217 src/IceOperand.cpp:217: if (!BuildDefs::asserts()) { Maybe if (BuildDefs::asserts()) instead?
5 years, 2 months ago (2015-10-01 20:14:50 UTC) #3
Jim Stichnoth
https://chromiumcodereview.appspot.com/1381563004/diff/1/src/IceOperand.cpp File src/IceOperand.cpp (right): https://chromiumcodereview.appspot.com/1381563004/diff/1/src/IceOperand.cpp#newcode217 src/IceOperand.cpp:217: if (!BuildDefs::asserts()) { On 2015/10/01 20:14:50, John wrote: > ...
5 years, 2 months ago (2015-10-01 20:33:27 UTC) #4
Jim Stichnoth
5 years, 2 months ago (2015-10-01 20:33:39 UTC) #5
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
48e3ae5c62d7e626ed1a0dbbe38a7cc11a356260 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698