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

Unified Diff: lib/Analysis/NaCl/PNaClABIVerifyModule.cpp

Issue 16042011: PNaCl: Disable parts of InstCombine that introduce *.with.overflow intrinsics (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/Transforms/InstCombine/InstCombineCompares.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
index 2b29c196f1cb88dceb3905027fd4928df5560f8f..d651e7bda7ac4d4242971faef07745b520b7f777 100644
--- a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
+++ b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
@@ -199,6 +199,17 @@ bool PNaClABIVerifyModule::isWhitelistedIntrinsic(const Function *F,
case Intrinsic::vacopy:
case Intrinsic::vaend:
case Intrinsic::vastart:
+ // Disallow the *_with_overflow intrinsics because they return
+ // struct types. All of them can be introduced by passing -ftrapv
+ // to Clang, which we do not support for now. umul_with_overflow
+ // and uadd_with_overflow are introduced by Clang for C++'s new[],
+ // but ExpandArithWithOverflow expands out this use.
+ case Intrinsic::sadd_with_overflow:
+ case Intrinsic::ssub_with_overflow:
+ case Intrinsic::uadd_with_overflow:
+ case Intrinsic::usub_with_overflow:
+ case Intrinsic::smul_with_overflow:
+ case Intrinsic::umul_with_overflow:
return false;
// (3) Dev intrinsics.
@@ -226,13 +237,6 @@ bool PNaClABIVerifyModule::isWhitelistedIntrinsic(const Function *F,
case Intrinsic::sqrt: // Rounding is defined, but setting errno up to libm.
case Intrinsic::stackrestore: // Used to support C99 VLAs.
case Intrinsic::stacksave: // Used to support C99 VLAs.
- // the *_with_overflow return struct types, so we'll need to fix these.
- case Intrinsic::sadd_with_overflow: // Introduced by -ftrapv
- case Intrinsic::ssub_with_overflow:
- case Intrinsic::uadd_with_overflow:
- case Intrinsic::usub_with_overflow:
- case Intrinsic::smul_with_overflow:
- case Intrinsic::umul_with_overflow: // Introduced by c++ new[x * y].
return PNaClABIAllowDevIntrinsics;
}
}
« no previous file with comments | « no previous file | lib/Transforms/InstCombine/InstCombineCompares.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698