diff options
| author | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-02-04 15:46:25 +0000 |
|---|---|---|
| committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-02-04 15:46:25 +0000 |
| commit | 428b3e48e209dd459f4cfa42c49425c0dc549b11 (patch) | |
| tree | 6c6882ec4811749204e51a5457493869b3baa88a | |
| parent | 24937c12ebbc4d1128618d0f0ff7b1e638a5471d (diff) | |
| download | bcm5719-llvm-428b3e48e209dd459f4cfa42c49425c0dc549b11.tar.gz bcm5719-llvm-428b3e48e209dd459f4cfa42c49425c0dc549b11.zip | |
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
| -rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index d7f75b04484..be7feeef735 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<Value*> 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<Value*>::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; } |

