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

Issue 802183004: Subzero: Use CFG-local arena allocation for relevant containers. (Closed)

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

Description

Subzero: Use CFG-local arena allocation for relevant containers. In particular, node lists for in and out edges of a CfgNode, and the live range segment list in a Variable. This is done by making the Cfg allocator globally available through TLS, and providing the STL containers with an allocator struct that uses this. This also cleans up some other allocation-related issues: * The allocator is now hung off the Cfg via a pointer, rather than being embedded into the Cfg. This allows a const Cfg pointer to be stored in TLS while still allowing its allocator to be mutated. * Cfg is now created via a static create() method. * The redundant Cfg::allocateInst<> methods are removed. * The Variable::asType() method allocates a whole new Variable from the Cfg arena, rather than allocating it on the stack, removing the need for the move constructor in Variable and Operand. This is OK since asType() is only used for textual asm emission. * The same 1MB arena allocator is now used by the assembler as well. The fact that it wasn't changed over to be the same as Cfg and GlobalContext was an oversight. (It turns out this adds ~3MB to the translator memory footprint, so that could be tuned later.) BUG= none R=jfb@chromium.org, jvoung@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=31c955905a2d861a944f1e0ca60cd9e4c6f1b37d

Patch Set 1 #

Patch Set 2 : Disable asType() in the minimal build #

Total comments: 18

Patch Set 3 : Code review changes #

Total comments: 14

Patch Set 4 : Doc update #

Total comments: 4

Patch Set 5 : Typo fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+243 lines, -80 lines) Patch
A ALLOCATION.rst View 1 2 3 4 1 chunk +126 lines, -0 lines 0 comments Download
M src/IceCfg.h View 1 2 5 chunks +27 lines, -21 lines 0 comments Download
M src/IceCfg.cpp View 2 chunks +14 lines, -2 lines 0 comments Download
M src/IceConverter.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/IceDefs.h View 1 2 3 2 chunks +29 lines, -4 lines 0 comments Download
M src/IceGlobalContext.h View 2 chunks +1 line, -3 lines 0 comments Download
M src/IceInst.h View 21 chunks +22 lines, -24 lines 0 comments Download
M src/IceInstX8632.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M src/IceOperand.h View 1 2 6 chunks +7 lines, -10 lines 0 comments Download
M src/IceOperand.cpp View 1 1 chunk +8 lines, -5 lines 0 comments Download
M src/IceTargetLoweringX8632.cpp View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/PNaClTranslator.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/assembler.h View 2 chunks +1 line, -3 lines 0 comments Download

Messages

Total messages: 10 (1 generated)
Jim Stichnoth
This reduces the pnacl-llc.pexe footprint from 33MB to 12MB. Translation time seems as good or ...
6 years ago (2014-12-18 05:27:09 UTC) #2
JF
https://codereview.chromium.org/802183004/diff/20001/src/IceCfg.cpp File src/IceCfg.cpp (right): https://codereview.chromium.org/802183004/diff/20001/src/IceCfg.cpp#newcode26 src/IceCfg.cpp:26: thread_local const Cfg *Cfg::CurrentCfg = NULL; nullptr https://codereview.chromium.org/802183004/diff/20001/src/IceCfg.cpp#newcode30 src/IceCfg.cpp:30: ...
6 years ago (2014-12-18 06:36:53 UTC) #3
jvoung (off chromium)
https://codereview.chromium.org/802183004/diff/20001/src/assembler.h File src/assembler.h (right): https://codereview.chromium.org/802183004/diff/20001/src/assembler.h#newcode233 src/assembler.h:233: ArenaAllocator Allocator; I wonder if the assembler should just ...
6 years ago (2014-12-18 18:40:00 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/802183004/diff/20001/src/IceCfg.cpp File src/IceCfg.cpp (right): https://codereview.chromium.org/802183004/diff/20001/src/IceCfg.cpp#newcode26 src/IceCfg.cpp:26: thread_local const Cfg *Cfg::CurrentCfg = NULL; On 2014/12/18 06:36:53, ...
6 years ago (2014-12-18 23:39:56 UTC) #5
JF
This is pretty much lgtm after some documentation polishing. Gotta make sure that shed is ...
6 years ago (2014-12-19 05:34:41 UTC) #6
Jim Stichnoth
https://codereview.chromium.org/802183004/diff/40001/ALLOCATION.rst File ALLOCATION.rst (right): https://codereview.chromium.org/802183004/diff/40001/ALLOCATION.rst#newcode1 ALLOCATION.rst:1: Object allocation and lifetime in ICE On 2014/12/19 05:34:41, ...
6 years ago (2014-12-19 15:22:28 UTC) #7
jvoung (off chromium)
LGTM https://codereview.chromium.org/802183004/diff/60001/ALLOCATION.rst File ALLOCATION.rst (right): https://codereview.chromium.org/802183004/diff/60001/ALLOCATION.rst#newcode57 ALLOCATION.rst:57: lookup up by translation threads and the parser ...
6 years ago (2014-12-19 17:42:23 UTC) #8
Jim Stichnoth
https://codereview.chromium.org/802183004/diff/60001/ALLOCATION.rst File ALLOCATION.rst (right): https://codereview.chromium.org/802183004/diff/60001/ALLOCATION.rst#newcode57 ALLOCATION.rst:57: lookup up by translation threads and the parser thread, ...
6 years ago (2014-12-19 20:51:25 UTC) #9
Jim Stichnoth
6 years ago (2014-12-19 20:51:50 UTC) #10
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
31c955905a2d861a944f1e0ca60cd9e4c6f1b37d (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698