diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-05-28 11:54:06 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-05-28 11:54:06 -0700 |
commit | 9a6f5fa4707744e76c4c89e6c569fea7b9f81fac (patch) | |
tree | 7cdcefa3960c8a641ae05baf572f57450f029fe5 /tools/opt | |
parent | 7b1d0b48c95f7b9861b890c650f039d5cc636e89 (diff) |
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
Review URL: https://codereview.chromium.org/15688011
Diffstat (limited to 'tools/opt')
-rw-r--r-- | tools/opt/opt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index f12c36a7c7..e44cfe06f4 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -599,11 +599,11 @@ int main(int argc, char **argv) { initializeTarget(Registry); // @LOCALMOD-BEGIN initializeAddPNaClExternalDeclsPass(Registry); + initializeExpandArithWithOverflowPass(Registry); initializeExpandByValPass(Registry); initializeExpandConstantExprPass(Registry); initializeExpandCtorsPass(Registry); initializeExpandGetElementPtrPass(Registry); - initializeExpandMulWithOverflowPass(Registry); initializeExpandTlsPass(Registry); initializeExpandTlsConstantExprPass(Registry); initializeExpandVarArgsPass(Registry); |