[llvm] r277066 - range
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 28 15:50:43 PDT 2016
Author: vitalybuka
Date: Thu Jul 28 17:50:43 2016
New Revision: 277066
URL: http://llvm.org/viewvc/llvm-project?rev=277066&view=rev
Log:
range
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=277066&r1=277065&r2=277066&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Thu Jul 28 17:50:43 2016
@@ -30,6 +30,8 @@ using namespace PatternMatch;
STATISTIC(NumSimplified, "Number of library calls simplified");
+extern cl::opt<bool> ClUseAfterScope;
+
/// Return the specified type promoted as it would be to pass though a va_arg
/// area.
static Type *getPromotedType(Type *Ty) {
@@ -1209,6 +1211,10 @@ static bool removeTriviallyEmptyRange(In
unsigned EndID, InstCombiner &IC) {
assert(I.getIntrinsicID() == StartID &&
"Start intrinsic does not have expected ID");
+ // Even if the range is empty asan need to poison memory to detect invalid
+ // access latter.
+ if (ClUseAfterScope)
+ return false;
BasicBlock::iterator BI(I), BE(I.getParent()->end());
for (++BI; BI != BE; ++BI) {
if (auto *E = dyn_cast<IntrinsicInst>(BI)) {
More information about the llvm-commits
mailing list