From 428b3e48e209dd459f4cfa42c49425c0dc549b11 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Mon, 4 Feb 2013 15:46:25 +0000 Subject: [PATCH] ScopDetection: Improve printing of alias sets We now show the all members of the alias set that may couse possible aliasing. In case a alias set member is not a named instruction (unnamed instructions or constant expressions), we show the expression itself. This improves our error message from: Possible aliasing for value: .reg2mem to: Possible aliasing: ".reg2mem", "[0 x double]* inttoptr (i64 47255179264 to [0 x double]*) llvm-svn: 174329 --- polly/lib/Analysis/ScopDetection.cpp | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index d7f75b0..be7feeef 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -277,10 +277,38 @@ bool ScopDetection::isValidMemoryAccess(Instruction &Inst, // 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() && !IgnoreAliasing) - INVALID_NOVERIFY(Alias, - "Possible aliasing for value: " << BaseValue->getName() - << "\n"); + if (!AS.isMustAlias() && !IgnoreAliasing) { + 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; + } + + INVALID_NOVERIFY(Alias, OS.str()) + } return true; } -- 2.7.4