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

Issue 14262011: PNaCl: Add ReplacePtrsWithInts pass for stripping out pointer types (Closed)

Created:
7 years, 8 months ago by Mark Seaborn
Modified:
7 years, 7 months ago
Reviewers:
Derek Schuff, eliben
CC:
native-client-reviews_googlegroups.com
Base URL:
http://git.chromium.org/native_client/pnacl-llvm.git@master
Visibility:
Public.

Description

PNaCl: Add ReplacePtrsWithInts pass for stripping out pointer types ReplacePtrsWithInts converts IR to a normal form in which functions don't reference any aggregate pointer types and pointer types only appear inside a few instructions. Change BlockAddress::replaceUsesOfWithOnConstant() to handle changing a function's type by replacing a function with a bitcast ConstantExpr of a new function. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343 TEST=replace-ptrs-with-ints.ll + PNaCl toolchain trybots, torture tests, etc. Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-llvm.git;a=commit;h=9f0ec13

Patch Set 1 #

Patch Set 2 : Make run_dwarf_local_var_objdump_test pass #

Patch Set 3 : Cleanup #

Patch Set 4 : Preserve fastcc #

Patch Set 5 : Cleanup #

Patch Set 6 : Cleanup #

Patch Set 7 : Add test for ConstantPointerNull #

Total comments: 14

Patch Set 8 : Review: cleanup and refactor #

Patch Set 9 : Review: cleanup #

Total comments: 10

Patch Set 10 : Fix alloca alignment #

Total comments: 18

Patch Set 11 : Strip out lifetime markers #

Patch Set 12 : Address Eli's review comments #

Total comments: 6

Patch Set 13 : Review nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1081 lines, -6 lines) Patch
M include/llvm/InitializePasses.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M include/llvm/Transforms/NaCl.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -0 lines 0 comments Download
M lib/IR/Constants.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M lib/Transforms/NaCl/CMakeLists.txt View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M lib/Transforms/NaCl/ExpandUtils.cpp View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M lib/Transforms/NaCl/ExpandVarArgs.cpp View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -5 lines 0 comments Download
A lib/Transforms/NaCl/ReplacePtrsWithInts.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +557 lines, -0 lines 0 comments Download
A test/Transforms/NaCl/replace-ptrs-with-ints.ll View 1 2 3 4 5 6 7 8 9 10 1 chunk +511 lines, -0 lines 0 comments Download
M tools/opt/opt.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Mark Seaborn
This pass produces some nice pexe size reductions: It reduces the size of all the ...
7 years, 7 months ago (2013-05-15 20:50:39 UTC) #1
eliben
Some initial comments https://codereview.chromium.org/14262011/diff/17001/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp File lib/Transforms/NaCl/ReplacePtrsWithInts.cpp (right): https://codereview.chromium.org/14262011/diff/17001/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp#newcode70 lib/Transforms/NaCl/ReplacePtrsWithInts.cpp:70: class FunctionConverter { Comment explaining what ...
7 years, 7 months ago (2013-05-15 22:11:21 UTC) #2
Mark Seaborn
https://codereview.chromium.org/14262011/diff/17001/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp File lib/Transforms/NaCl/ReplacePtrsWithInts.cpp (right): https://codereview.chromium.org/14262011/diff/17001/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp#newcode70 lib/Transforms/NaCl/ReplacePtrsWithInts.cpp:70: class FunctionConverter { On 2013/05/15 22:11:21, eliben wrote: > ...
7 years, 7 months ago (2013-05-16 02:08:40 UTC) #3
Derek Schuff
https://codereview.chromium.org/14262011/diff/22002/lib/IR/Constants.cpp File lib/IR/Constants.cpp (right): https://codereview.chromium.org/14262011/diff/22002/lib/IR/Constants.cpp#newcode1374 lib/IR/Constants.cpp:1374: NewF = cast<Function>(To->stripPointerCasts()); LOCALMOD with comment? https://codereview.chromium.org/14262011/diff/22002/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp File lib/Transforms/NaCl/ReplacePtrsWithInts.cpp ...
7 years, 7 months ago (2013-05-17 23:16:05 UTC) #4
Mark Seaborn
I've fixed alloca to preserve alignment when the alignment is implicit. https://codereview.chromium.org/14262011/diff/22002/lib/IR/Constants.cpp File lib/IR/Constants.cpp (right): ...
7 years, 7 months ago (2013-05-20 15:08:12 UTC) #5
Derek Schuff
lgtm
7 years, 7 months ago (2013-05-20 16:05:45 UTC) #6
eliben
https://codereview.chromium.org/14262011/diff/30001/lib/Transforms/NaCl/ExpandUtils.cpp File lib/Transforms/NaCl/ExpandUtils.cpp (right): https://codereview.chromium.org/14262011/diff/30001/lib/Transforms/NaCl/ExpandUtils.cpp#newcode42 lib/Transforms/NaCl/ExpandUtils.cpp:42: Instruction *llvm::CopyDebug(Instruction *NewInst, Instruction *Original) { Somewhere a comment ...
7 years, 7 months ago (2013-05-20 22:18:49 UTC) #7
Mark Seaborn
I've updated this to strip out lifetime markers, because of the problem with PHI nodes ...
7 years, 7 months ago (2013-05-21 23:12:07 UTC) #8
eliben
LGTM with minor nits https://codereview.chromium.org/14262011/diff/41001/include/llvm/Transforms/NaCl.h File include/llvm/Transforms/NaCl.h (right): https://codereview.chromium.org/14262011/diff/41001/include/llvm/Transforms/NaCl.h#newcode41 include/llvm/Transforms/NaCl.h:41: // Copy debug information from ...
7 years, 7 months ago (2013-05-22 16:08:02 UTC) #9
Derek Schuff
lgtm with one nit https://codereview.chromium.org/14262011/diff/41001/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp File lib/Transforms/NaCl/ReplacePtrsWithInts.cpp (right): https://codereview.chromium.org/14262011/diff/41001/lib/Transforms/NaCl/ReplacePtrsWithInts.cpp#newcode367 lib/Transforms/NaCl/ReplacePtrsWithInts.cpp:367: // Remove alloca lifetime markers ...
7 years, 7 months ago (2013-05-22 16:24:08 UTC) #10
Mark Seaborn
https://codereview.chromium.org/14262011/diff/41001/include/llvm/Transforms/NaCl.h File include/llvm/Transforms/NaCl.h (right): https://codereview.chromium.org/14262011/diff/41001/include/llvm/Transforms/NaCl.h#newcode41 include/llvm/Transforms/NaCl.h:41: // Copy debug information from Original to NewInst. On ...
7 years, 7 months ago (2013-05-22 18:29:14 UTC) #11
Mark Seaborn
7 years, 7 months ago (2013-05-22 18:34:48 UTC) #12
Message was sent while issue was closed.
Committed patchset #13 manually as r9f0ec13 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698