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

Issue 1798243002: Fix the block stack used by the bitstream cursor. (Closed)

Created:
4 years, 9 months ago by Karl
Modified:
4 years, 9 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix the block stack used by the bitstream cursor. The previous implementation of the bitstream cursor copied global abbreviations for each block into its own vector, and deleted the vector when the vector went out of scope. Further aggrevating the situation is that function blocks can have hundreds of global abbreviations that need to be copied. This results in over 500k calls to malloc during parsing. Since PNaCl compiles using newlib, and uses multiple threads, this introduces a noticeable slowdown. This CL fixes this problem by refering to the collected global abbreviations directly, thereby removing these abbreviation copies. BUG=None R=dschuff@chromium.org Committed: https://chromium.googlesource.com/native_client/pnacl-llvm/+/a65844702e4a122c89225a94f8edf01941fb8e02

Patch Set 1 #

Total comments: 26

Patch Set 2 : Fix issues raised in CL. #

Total comments: 2

Patch Set 3 : Clean up issues with appendUnique and appendShared #

Patch Set 4 : Fix nits. #

Total comments: 4

Patch Set 5 : Fix nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+193 lines, -105 lines) Patch
M include/llvm/Bitcode/NaCl/NaClBitCodes.h View 1 2 chunks +6 lines, -3 lines 0 comments Download
M include/llvm/Bitcode/NaCl/NaClBitstreamReader.h View 1 2 3 4 13 chunks +165 lines, -59 lines 0 comments Download
M lib/Bitcode/NaCl/Reader/NaClBitstreamReader.cpp View 1 2 7 chunks +22 lines, -43 lines 0 comments Download

Messages

Total messages: 15 (4 generated)
Karl
4 years, 9 months ago (2016-03-14 21:59:13 UTC) #3
Jim Stichnoth
https://codereview.chromium.org/1798243002/diff/1/include/llvm/Bitcode/NaCl/NaClBitCodes.h File include/llvm/Bitcode/NaCl/NaClBitCodes.h (right): https://codereview.chromium.org/1798243002/diff/1/include/llvm/Bitcode/NaCl/NaClBitCodes.h#newcode25 include/llvm/Bitcode/NaCl/NaClBitCodes.h:25: #include <climits> Should includes be sorted? https://codereview.chromium.org/1798243002/diff/1/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h File include/llvm/Bitcode/NaCl/NaClBitstreamReader.h ...
4 years, 9 months ago (2016-03-14 22:46:49 UTC) #5
Derek Schuff
https://codereview.chromium.org/1798243002/diff/1/include/llvm/Bitcode/NaCl/NaClBitCodes.h File include/llvm/Bitcode/NaCl/NaClBitCodes.h (right): https://codereview.chromium.org/1798243002/diff/1/include/llvm/Bitcode/NaCl/NaClBitCodes.h#newcode89 include/llvm/Bitcode/NaCl/NaClBitCodes.h:89: TOP_LEVEL_BLOCKID = UINT_MAX Does it matter that this block ...
4 years, 9 months ago (2016-03-15 17:47:04 UTC) #6
Karl
https://codereview.chromium.org/1798243002/diff/1/include/llvm/Bitcode/NaCl/NaClBitCodes.h File include/llvm/Bitcode/NaCl/NaClBitCodes.h (right): https://codereview.chromium.org/1798243002/diff/1/include/llvm/Bitcode/NaCl/NaClBitCodes.h#newcode25 include/llvm/Bitcode/NaCl/NaClBitCodes.h:25: #include <climits> On 2016/03/14 22:46:49, stichnot wrote: > Should ...
4 years, 9 months ago (2016-03-15 20:29:41 UTC) #7
Derek Schuff
https://codereview.chromium.org/1798243002/diff/20001/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h File include/llvm/Bitcode/NaCl/NaClBitstreamReader.h (right): https://codereview.chromium.org/1798243002/diff/20001/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h#newcode80 include/llvm/Bitcode/NaCl/NaClBitstreamReader.h:80: void appendUnique(NaClBitCodeAbbrev *Abbv) { Does appendUnique mean that nothing ...
4 years, 9 months ago (2016-03-17 16:20:17 UTC) #8
Karl
https://codereview.chromium.org/1798243002/diff/20001/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h File include/llvm/Bitcode/NaCl/NaClBitstreamReader.h (right): https://codereview.chromium.org/1798243002/diff/20001/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h#newcode80 include/llvm/Bitcode/NaCl/NaClBitstreamReader.h:80: void appendUnique(NaClBitCodeAbbrev *Abbv) { On 2016/03/17 16:20:17, Derek Schuff ...
4 years, 9 months ago (2016-03-17 18:37:08 UTC) #9
Karl
Ping?
4 years, 9 months ago (2016-03-21 17:32:35 UTC) #10
Derek Schuff
https://codereview.chromium.org/1798243002/diff/60001/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h File include/llvm/Bitcode/NaCl/NaClBitstreamReader.h (right): https://codereview.chromium.org/1798243002/diff/60001/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h#newcode95 include/llvm/Bitcode/NaCl/NaClBitstreamReader.h:95: // Returns last abbreviation on list, and returns an ...
4 years, 9 months ago (2016-03-21 17:54:54 UTC) #11
Karl
https://codereview.chromium.org/1798243002/diff/60001/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h File include/llvm/Bitcode/NaCl/NaClBitstreamReader.h (right): https://codereview.chromium.org/1798243002/diff/60001/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h#newcode95 include/llvm/Bitcode/NaCl/NaClBitstreamReader.h:95: // Returns last abbreviation on list, and returns an ...
4 years, 9 months ago (2016-03-21 19:27:56 UTC) #12
Derek Schuff
lgtm
4 years, 9 months ago (2016-03-21 19:36:48 UTC) #13
Karl
4 years, 9 months ago (2016-03-21 19:38:15 UTC) #15
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
a65844702e4a122c89225a94f8edf01941fb8e02 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698