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

Issue 580903005: Subzero: Add branch optimization. (Closed)

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

Description

Subzero: Add branch optimization. 1. Unconditional branch to the next basic block is removed. 2. For a conditional branch with a "false" edge to the next basic block, remove the unconditional branch to the fallthrough block. 3. For a conditional branch with a "true" edge to the next basic block, invert the condition and do like #2. This is enabled only for O2, particularly because inverting the branch condition is a marginally risky operation. This decreases the instruction count by about 5-6%. Also, --stats prints a final tally to make it easier to post-process the output. BUG= none R=jvoung@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=ff9c7063c674aaf2c96a75155c64f4331e30cecc

Patch Set 1 #

Patch Set 2 : Avoid the !! operator #

Total comments: 4

Patch Set 3 : Code review changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+259 lines, -61 lines) Patch
M src/IceCfg.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/IceCfg.cpp View 1 chunk +8 lines, -0 lines 0 comments Download
M src/IceCfgNode.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/IceCfgNode.cpp View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M src/IceGlobalContext.h View 1 chunk +1 line, -1 line 0 comments Download
M src/IceGlobalContext.cpp View 1 chunk +7 lines, -3 lines 0 comments Download
M src/IceInstX8632.h View 1 2 2 chunks +26 lines, -17 lines 0 comments Download
M src/IceInstX8632.cpp View 1 2 2 chunks +46 lines, -4 lines 0 comments Download
M src/IceInstX8632.def View 1 chunk +14 lines, -14 lines 0 comments Download
M src/IceTargetLowering.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M src/IceTargetLoweringX8632.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/IceTargetLoweringX8632.cpp View 1 2 2 chunks +15 lines, -0 lines 0 comments Download
M src/PNaClTranslator.cpp View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M src/llvm2ice.cpp View 2 chunks +6 lines, -2 lines 0 comments Download
A tests_lit/llvm2ice_tests/branch-opt.ll View 1 chunk +104 lines, -0 lines 0 comments Download
M tests_lit/llvm2ice_tests/ebp_args.ll View 1 chunk +1 line, -1 line 0 comments Download
M tests_lit/llvm2ice_tests/nacl-atomic-cmpxchg-optimization.ll View 5 chunks +5 lines, -5 lines 0 comments Download
M tests_lit/llvm2ice_tests/nacl-atomic-fence-all.ll View 1 chunk +1 line, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/phi.ll View 3 chunks +3 lines, -9 lines 0 comments Download
M tests_lit/llvm2ice_tests/simple-loop.ll View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
Jim Stichnoth
6 years, 3 months ago (2014-09-17 23:17:06 UTC) #2
jvoung (off chromium)
otherwise LGTM https://codereview.chromium.org/580903005/diff/20001/src/IceCfgNode.cpp File src/IceCfgNode.cpp (right): https://codereview.chromium.org/580903005/diff/20001/src/IceCfgNode.cpp#newcode464 src/IceCfgNode.cpp:464: Target->doBranchOpt(*I, NextNode); I wonder if it makes ...
6 years, 3 months ago (2014-09-18 03:56:02 UTC) #3
Jim Stichnoth
https://codereview.chromium.org/580903005/diff/20001/src/IceCfgNode.cpp File src/IceCfgNode.cpp (right): https://codereview.chromium.org/580903005/diff/20001/src/IceCfgNode.cpp#newcode464 src/IceCfgNode.cpp:464: Target->doBranchOpt(*I, NextNode); On 2014/09/18 03:56:02, jvoung wrote: > I ...
6 years, 3 months ago (2014-09-18 11:45:51 UTC) #4
Jim Stichnoth
6 years, 3 months ago (2014-09-18 11:50:54 UTC) #5
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as ff9c706 (tree was closed).

Powered by Google App Engine
This is Rietveld 408576698