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

Issue 15688011: PNaCl: Extend ExpandMulWithOverflow pass to handle uadd.with.overflow too (Closed)

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

Description

PNaCl: Extend ExpandMulWithOverflow pass to handle uadd.with.overflow too It turned out that umul.with.overflow wasn't the only *.with.overflow intrinsic usage introduced by Clang. I knew that Clang's CGExprCXX.cpp generates umul.with.overflow for an overflow check for C++'s "new Foo[]". The same code for handling "new Foo[]" also generates uadd.with.overflow in some cases. This happens if class Foo has a destructor or a delete[] operator that takes a size argument. In those cases, the C++ ABI adds a "cookie" to the allocation which contains the array's size. Rename the pass to "ExpandArithWithOverflow" and rename files accordingly. Also enable the pass. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3434 TEST=*.ll tests + trybots + GCC torture tests Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-llvm.git;a=commit;h=9a6f5fa

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fix #

Patch Set 3 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -248 lines) Patch
M include/llvm/InitializePasses.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M include/llvm/Transforms/NaCl.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M lib/Transforms/NaCl/CMakeLists.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
A + lib/Transforms/NaCl/ExpandArithWithOverflow.cpp View 1 9 chunks +47 lines, -31 lines 0 comments Download
D lib/Transforms/NaCl/ExpandMulWithOverflow.cpp View 1 chunk +0 lines, -141 lines 0 comments Download
M lib/Transforms/NaCl/PNaClABISimplify.cpp View 1 chunk +1 line, -0 lines 0 comments Download
A + test/Transforms/NaCl/expand-arith-with-overflow.ll View 4 chunks +25 lines, -8 lines 0 comments Download
D test/Transforms/NaCl/expand-mul-with-overflow.ll View 1 chunk +0 lines, -64 lines 0 comments Download
M tools/opt/opt.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Mark Seaborn
7 years, 6 months ago (2013-05-28 17:41:48 UTC) #1
eliben
https://codereview.chromium.org/15688011/diff/1/lib/Transforms/NaCl/ExpandArithWithOverflow.cpp File lib/Transforms/NaCl/ExpandArithWithOverflow.cpp (right): https://codereview.chromium.org/15688011/diff/1/lib/Transforms/NaCl/ExpandArithWithOverflow.cpp#newcode56 lib/Transforms/NaCl/ExpandArithWithOverflow.cpp:56: "Expand out some uses of *.with.overflow intrinsics", What does ...
7 years, 6 months ago (2013-05-28 17:59:54 UTC) #2
Mark Seaborn
https://codereview.chromium.org/15688011/diff/1/lib/Transforms/NaCl/ExpandArithWithOverflow.cpp File lib/Transforms/NaCl/ExpandArithWithOverflow.cpp (right): https://codereview.chromium.org/15688011/diff/1/lib/Transforms/NaCl/ExpandArithWithOverflow.cpp#newcode56 lib/Transforms/NaCl/ExpandArithWithOverflow.cpp:56: "Expand out some uses of *.with.overflow intrinsics", On 2013/05/28 ...
7 years, 6 months ago (2013-05-28 18:41:22 UTC) #3
eliben
On 2013/05/28 18:41:22, Mark Seaborn wrote: > https://codereview.chromium.org/15688011/diff/1/lib/Transforms/NaCl/ExpandArithWithOverflow.cpp > File lib/Transforms/NaCl/ExpandArithWithOverflow.cpp (right): > > https://codereview.chromium.org/15688011/diff/1/lib/Transforms/NaCl/ExpandArithWithOverflow.cpp#newcode56 ...
7 years, 6 months ago (2013-05-28 18:45:13 UTC) #4
eliben
lgtm
7 years, 6 months ago (2013-05-28 18:45:20 UTC) #5
Mark Seaborn
7 years, 6 months ago (2013-05-28 18:54:09 UTC) #6
Message was sent while issue was closed.
Committed patchset #3 manually as r9a6f5fa (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698