|
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
Total comments: 4
|
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
|
Total messages: 5 (1 generated)
|