From 8c2d75302f16b8e073808c3cc9a31bff48a91302 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Wed, 3 Jul 2013 22:50:36 +0000 Subject: [PATCH] scop detection: early return to reduce indentation level No functionality changed. llvm-svn: 185590 --- polly/lib/Analysis/ScopDetection.cpp | 91 ++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index d25e625..3834c06 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -276,53 +276,54 @@ bool ScopDetection::isValidMemoryAccess(Instruction &Inst, if (isa(BaseValue)) INVALID(Other, "Find bad intToptr prt: " << *BaseValue); - if (!IgnoreAliasing) { - // Check if the base pointer of the memory access does alias with - // any other pointer. This cannot be handled at the moment. - AliasSet &AS = Context.AST - .getAliasSetForPointer(BaseValue, AliasAnalysis::UnknownSize, - Inst.getMetadata(LLVMContext::MD_tbaa)); - - // INVALID triggers an assertion in verifying mode, if it detects that a - // SCoP was detected by SCoP detection and that this SCoP was invalidated by - // a pass that stated it would preserve the SCoPs. We disable this check as - // the independent blocks pass may create memory references which seem to - // alias, if -basicaa is not available. They actually do not, but as we can - // not proof this without -basicaa we would fail. We disable this check to - // not cause irrelevant verification failures. - if (!AS.isMustAlias()) { - std::string Message; - raw_string_ostream OS(Message); - - OS << "Possible aliasing: "; - - std::vector Pointers; - - for (AliasSet::iterator AI = AS.begin(), AE = AS.end(); AI != AE; ++AI) - Pointers.push_back(AI.getPointer()); - - std::sort(Pointers.begin(), Pointers.end()); - - for (std::vector::iterator PI = Pointers.begin(), - PE = Pointers.end(); - ;) { - Value *V = *PI; - - if (V->getName().size() == 0) - OS << "\"" << *V << "\""; - else - OS << "\"" << V->getName() << "\""; - - ++PI; - - if (PI != PE) - OS << ", "; - else - break; - } + if (IgnoreAliasing) + return true; + + // Check if the base pointer of the memory access does alias with + // any other pointer. This cannot be handled at the moment. + AliasSet &AS = Context.AST + .getAliasSetForPointer(BaseValue, AliasAnalysis::UnknownSize, + Inst.getMetadata(LLVMContext::MD_tbaa)); + + // INVALID triggers an assertion in verifying mode, if it detects that a + // SCoP was detected by SCoP detection and that this SCoP was invalidated by + // a pass that stated it would preserve the SCoPs. We disable this check as + // the independent blocks pass may create memory references which seem to + // alias, if -basicaa is not available. They actually do not, but as we can + // not proof this without -basicaa we would fail. We disable this check to + // not cause irrelevant verification failures. + if (!AS.isMustAlias()) { + std::string Message; + raw_string_ostream OS(Message); + + OS << "Possible aliasing: "; + + std::vector Pointers; + + for (AliasSet::iterator AI = AS.begin(), AE = AS.end(); AI != AE; ++AI) + Pointers.push_back(AI.getPointer()); + + std::sort(Pointers.begin(), Pointers.end()); - INVALID_NOVERIFY(Alias, OS.str()); + for (std::vector::iterator PI = Pointers.begin(), + PE = Pointers.end(); + ;) { + Value *V = *PI; + + if (V->getName().size() == 0) + OS << "\"" << *V << "\""; + else + OS << "\"" << V->getName() << "\""; + + ++PI; + + if (PI != PE) + OS << ", "; + else + break; } + + INVALID_NOVERIFY(Alias, OS.str()); } return true; -- 2.7.4