ScopDetect: Use INVALID macro to fail in case of aliasing

This simplifies the code and also makes the error message available to
the graphviz scop viewer.

llvm-svn: 144284
This commit is contained in:
Tobias Grosser 2011-11-10 12:47:21 +00:00
parent 4eb7381607
commit 6f24d9d9ee
1 changed files with 2 additions and 16 deletions

View File

@ -241,22 +241,8 @@ bool ScopDetection::isValidMemoryAccess(Instruction &Inst,
AliasSet &AS =
Context.AST.getAliasSetForPointer(BaseValue, AliasAnalysis::UnknownSize,
Inst.getMetadata(LLVMContext::MD_tbaa));
if (!AS.isMustAlias()) {
DEBUG(dbgs() << "Bad pointer alias found:" << *BaseValue << "\nAS:\n" << AS);
// STATSCOP triggers an assertion if we are in verifying mode.
// This is generally good to check that we do not change the SCoP after we
// run the SCoP detection and consequently to ensure that we can still
// represent that SCoP. However, in case of aliasing this does not work.
// The independent blocks pass may create memory references which seem to
// alias, if -basicaa is not available. They actually do not. As we do not
// not know this and we would fail here if we verify it.
if (!Context.Verifying) {
STATSCOP(Alias);
}
return false;
}
if (!AS.isMustAlias())
INVALID(Alias, "Possible aliasing found for value: " << *BaseValue);
return true;
}