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

Issue 1113683002: Subzero: Produce actually correct code in -asm-verbose mode. (Closed)

Created:
5 years, 7 months ago by Jim Stichnoth
Modified:
5 years, 7 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: Produce actually correct code in --asm-verbose mode. The "pnacl-sz --asm-verbose=1" mode annotates the asm output with physical register liveness information, including which registers are live at the beginning and end of each basic block, and which registers' live ranges end at each instruction. Computing this information requires a final liveness analysis pass. One of the side effects of liveness analysis is to remove dead instructions, which happens when the instruction's dest variable is not live and the instruction lacks important side effects. In some cases, direct manipulation of physical registers was missing extra fakedef/fakeuse/etc., and as as result these instructions could be eliminated, leading to incorrect code. Without --asm-verbose, these instructions were being created after the last run of liveness analysis, so they had no chance of being eliminated and everything was fine. But with --asm-verbose, some instructions would be eliminated. This CL fixes the omissions so that the resulting code is runnable. An alternative would be to add a flag to liveness analysis directing it not to dead-code eliminate any more instructions. However, it's better to get the liveness right in case future late-stage optimizations rely on it. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4135 TEST= pydir/szbuild_spec2k.py --filetype=asm -v --sz=--asm-verbose=1 --force R=jvoung@chromium.org, kschimpf@google.com Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=76dcf1a858757e6496bf55a5811ccb56ff06b028

Patch Set 1 #

Total comments: 2

Patch Set 2 : Expand asm-verbose comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -1 line) Patch
M src/IceInstX8632.cpp View 1 1 chunk +9 lines, -1 line 0 comments Download
M src/IceTargetLoweringX8632.cpp View 1 4 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
Jim Stichnoth
5 years, 7 months ago (2015-04-28 21:48:01 UTC) #2
Karl
lgtm
5 years, 7 months ago (2015-04-29 15:46:45 UTC) #3
jvoung (off chromium)
lgtm https://codereview.chromium.org/1113683002/diff/1/src/IceInstX8632.cpp File src/IceInstX8632.cpp (right): https://codereview.chromium.org/1113683002/diff/1/src/IceInstX8632.cpp#newcode326 src/IceInstX8632.cpp:326: // eliminated.) This is needed for asm-verbose mode. ...
5 years, 7 months ago (2015-04-29 16:41:36 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/1113683002/diff/1/src/IceInstX8632.cpp File src/IceInstX8632.cpp (right): https://codereview.chromium.org/1113683002/diff/1/src/IceInstX8632.cpp#newcode326 src/IceInstX8632.cpp:326: // eliminated.) This is needed for asm-verbose mode. On ...
5 years, 7 months ago (2015-04-29 17:15:27 UTC) #5
Jim Stichnoth
5 years, 7 months ago (2015-04-29 17:20:14 UTC) #6
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
76dcf1a858757e6496bf55a5811ccb56ff06b028 (tree was closed).

Powered by Google App Engine
This is Rietveld 408576698