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

Issue 14607004: Insert denominator zero checks for NaCl (Closed)

Created:
7 years, 7 months ago by sehr
Modified:
7 years, 7 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
http://git.chromium.org/native_client/pnacl-llvm.git@master
Visibility:
Public.

Description

Insert denominator zero checks for NaCl This IR pass for ARM inserts a comparison and a branch to trap if the denominator of a DIV or REM instruction is zero. This makes ARM fault identically to x86 in this case. BUG= https://code.google.com/p/nativeclient/issues/detail?id=2833 R=eliben@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-llvm.git;a=commit;h=8c9803a

Patch Set 1 #

Total comments: 12

Patch Set 2 : Incorporate review comments and add test #

Total comments: 29

Patch Set 3 : Moved to Transforms/NaCl, added opt invocation to test #

Total comments: 2

Patch Set 4 : Add more complex control flow test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+320 lines, -0 lines) Patch
M include/llvm/InitializePasses.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M include/llvm/Transforms/NaCl.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M lib/Target/ARM/ARMTargetMachine.cpp View 1 2 3 chunks +15 lines, -0 lines 0 comments Download
M lib/Transforms/NaCl/CMakeLists.txt View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A lib/Transforms/NaCl/InsertDivideCheck.cpp View 1 2 1 chunk +112 lines, -0 lines 0 comments Download
A test/NaCl/ARM/divrem-guards.ll View 1 2 1 chunk +104 lines, -0 lines 0 comments Download
A test/NaCl/ARM/divrem-guards-complex.ll View 1 2 3 1 chunk +85 lines, -0 lines 0 comments Download
M tools/opt/opt.cpp View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
sehr
PTAL.
7 years, 7 months ago (2013-05-02 21:16:52 UTC) #1
Jim Stichnoth
https://codereview.chromium.org/14607004/diff/1/lib/Target/ARM/ARMNaClDivideCheck.cpp File lib/Target/ARM/ARMNaClDivideCheck.cpp (right): https://codereview.chromium.org/14607004/diff/1/lib/Target/ARM/ARMNaClDivideCheck.cpp#newcode61 lib/Target/ARM/ARMNaClDivideCheck.cpp:61: // Create a single trap block. You might want ...
7 years, 7 months ago (2013-05-02 21:37:16 UTC) #2
eliben
Add tests, and also Mark and/or Derek should take a look since they've written a ...
7 years, 7 months ago (2013-05-02 21:47:31 UTC) #3
sehr
Optimization, tests, and review comments added. PTAL. https://codereview.chromium.org/14607004/diff/1/lib/Target/ARM/ARMNaClDivideCheck.cpp File lib/Target/ARM/ARMNaClDivideCheck.cpp (right): https://codereview.chromium.org/14607004/diff/1/lib/Target/ARM/ARMNaClDivideCheck.cpp#newcode10 lib/Target/ARM/ARMNaClDivideCheck.cpp:10: // This ...
7 years, 7 months ago (2013-05-03 20:33:06 UTC) #4
sehr
More reviewers. PTAL.
7 years, 7 months ago (2013-05-03 20:33:44 UTC) #5
eliben
https://codereview.chromium.org/14607004/diff/6001/lib/Target/ARM/ARMNaClDivideCheck.cpp File lib/Target/ARM/ARMNaClDivideCheck.cpp (right): https://codereview.chromium.org/14607004/diff/6001/lib/Target/ARM/ARMNaClDivideCheck.cpp#newcode10 lib/Target/ARM/ARMNaClDivideCheck.cpp:10: // This pass adds a check for divide by ...
7 years, 7 months ago (2013-05-03 21:18:55 UTC) #6
Mark Seaborn
https://codereview.chromium.org/14607004/diff/6001/lib/Target/ARM/ARMNaClDivideCheck.cpp File lib/Target/ARM/ARMNaClDivideCheck.cpp (right): https://codereview.chromium.org/14607004/diff/6001/lib/Target/ARM/ARMNaClDivideCheck.cpp#newcode1 lib/Target/ARM/ARMNaClDivideCheck.cpp:1: //===- ARMNaClDivideCheck.cpp - Add divide by zero checks ----------------===// ...
7 years, 7 months ago (2013-05-03 21:25:36 UTC) #7
sehr
I have moved the transformation to Transforms/NaCl. This allowed calling it from opt also, and ...
7 years, 7 months ago (2013-05-03 23:29:05 UTC) #8
eliben
On 2013/05/03 23:29:05, sehr1 wrote: > I have moved the transformation to Transforms/NaCl. This allowed ...
7 years, 7 months ago (2013-05-06 16:09:38 UTC) #9
Derek Schuff
https://codereview.chromium.org/14607004/diff/14001/tools/opt/opt.cpp File tools/opt/opt.cpp (right): https://codereview.chromium.org/14607004/diff/14001/tools/opt/opt.cpp#newcode589 tools/opt/opt.cpp:589: initializeInsertDivideCheckPass(Registry); we want to add an initialization for this ...
7 years, 7 months ago (2013-05-06 16:18:49 UTC) #10
sehr
More complex test added. PTAL. https://codereview.chromium.org/14607004/diff/14001/tools/opt/opt.cpp File tools/opt/opt.cpp (right): https://codereview.chromium.org/14607004/diff/14001/tools/opt/opt.cpp#newcode589 tools/opt/opt.cpp:589: initializeInsertDivideCheckPass(Registry); On 2013/05/06 16:18:49, ...
7 years, 7 months ago (2013-05-07 23:53:17 UTC) #11
eliben
lgtm
7 years, 7 months ago (2013-05-08 15:26:53 UTC) #12
sehr
Committed patchset #4 manually as r8c9803a (presubmit successful).
7 years, 7 months ago (2013-05-08 16:28:35 UTC) #13
jvoung (off chromium)
7 years, 7 months ago (2013-05-08 18:36:43 UTC) #14
Message was sent while issue was closed.
Does lib/Target/ARM need to depend on the NaClTransforms library now? 
(somewhere in the LLVMBuild.txt and/or CMakeLists.txt)

I'm seeing:

.../pnacl/build/translator-armv7/llvm-sb/Release/lib/libLLVMARMCodeGen.a: error:
undefined reference to 'llvm::createInsertDivideCheckPass()'

Powered by Google App Engine
This is Rietveld 408576698