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

Issue 1275953002: Fix translator handling of basic block indices. (Closed)

Created:
5 years, 4 months ago by Karl
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

Fix translator handling of basic block indices. The code used to use a vector to hold basic blocks associated with indices. This had two problem: 1) The "number of blocks" record would generate a vector of the given size (even if very large); and 2) Indices would expand the vector to define the index (even if very large). In most cases, such large values are incorrect. To fix this, this patch uses a map from block index, to the corresponding basic block. Only after all basic block indices have been processed, we check that the size makes sense, and convert it to a vector. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4261 R=jpp@chromium.org, stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=ac7d73441e1c599108b20c4702a96db0e956889e

Patch Set 1 #

Total comments: 22

Patch Set 2 : Fix issues in patch set 1. #

Total comments: 4

Patch Set 3 : Fix nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -49 lines) Patch
M src/IceCfg.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/IceCfg.cpp View 1 3 chunks +19 lines, -14 lines 0 comments Download
M src/IceDefs.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/IceGlobalContext.cpp View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M src/IceTargetLoweringX86Base.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M src/PNaClTranslator.cpp View 1 2 7 chunks +65 lines, -33 lines 0 comments Download

Messages

Total messages: 9 (1 generated)
Karl
5 years, 4 months ago (2015-08-06 16:21:52 UTC) #2
John
lgtm Just suggestions. LGMT otherwise. https://codereview.chromium.org/1275953002/diff/1/src/IceCfg.cpp File src/IceCfg.cpp (right): https://codereview.chromium.org/1275953002/diff/1/src/IceCfg.cpp#newcode65 src/IceCfg.cpp:65: Nodes = NewNodes; The ...
5 years, 4 months ago (2015-08-06 17:22:54 UTC) #3
Jim Stichnoth
I'm finding differences in BB names when translating spec2k, still investigating... https://codereview.chromium.org/1275953002/diff/1/src/IceCfg.cpp File src/IceCfg.cpp (left): ...
5 years, 4 months ago (2015-08-06 17:24:33 UTC) #4
Jim Stichnoth
On 2015/08/06 17:24:33, stichnot wrote: > I'm finding differences in BB names when translating spec2k, ...
5 years, 4 months ago (2015-08-06 18:17:09 UTC) #5
Karl
Sent out for re-review just to verify changes have been met. https://codereview.chromium.org/1275953002/diff/1/src/IceCfg.cpp File src/IceCfg.cpp (left): ...
5 years, 4 months ago (2015-08-06 18:55:52 UTC) #6
Jim Stichnoth
Otherwise lgtm https://codereview.chromium.org/1275953002/diff/20001/src/PNaClTranslator.cpp File src/PNaClTranslator.cpp (right): https://codereview.chromium.org/1275953002/diff/20001/src/PNaClTranslator.cpp#newcode39 src/PNaClTranslator.cpp:39: #include <unordered_map> Could you move this include ...
5 years, 4 months ago (2015-08-06 19:41:21 UTC) #7
Karl
Committed patchset #3 (id:40001) manually as ac7d73441e1c599108b20c4702a96db0e956889e (presubmit successful).
5 years, 4 months ago (2015-08-06 19:55:29 UTC) #8
Karl
5 years, 4 months ago (2015-08-06 19:55:41 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/1275953002/diff/20001/src/PNaClTranslator.cpp
File src/PNaClTranslator.cpp (right):

https://codereview.chromium.org/1275953002/diff/20001/src/PNaClTranslator.cpp...
src/PNaClTranslator.cpp:39: #include <unordered_map>
On 2015/08/06 19:41:21, stichnot wrote:
> Could you move this include into IceDefs.h, and remove it from the other two
> places that #include it?

Done.

https://codereview.chromium.org/1275953002/diff/20001/src/PNaClTranslator.cpp...
src/PNaClTranslator.cpp:2899: if (isIRGenerationDisabled() ||
!Ice::BuildDefs::dump())
On 2015/08/06 19:41:21, stichnot wrote:
> Test for BuildDefs::dump() very first, even before isIRGenerationDisabled(),
so
> that the function is *completely* empty if dump is not defined.  E.g., swap
the
> || operand order.

Done.

Powered by Google App Engine
This is Rietveld 408576698