summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2017-12-22 17:44:53 +0000
committerMichael Kruse <llvm@meinersbur.de>2017-12-22 17:44:53 +0000
commit271deb17b04a4b2b99cc038014b26a96ef461366 (patch)
tree11633afe5efb559f66724457f2c592cadc5aad58 /polly/lib/CodeGen
parentb2368fbdf4e153e1b920cddd6f393434b3245f84 (diff)
downloadbcm5719-llvm-271deb17b04a4b2b99cc038014b26a96ef461366.tar.gz
bcm5719-llvm-271deb17b04a4b2b99cc038014b26a96ef461366.zip
[CodeGen] Fix noalias annotations for memcpy/memmove.
Memory transfer instructions take two pointers. It is not defined to which of those a noalias annotation applies. To ensure correctness, do not add noalias annotations to memcpy/memmove instructions anymore. The caused a miscompile with test-suite's MultiSource/Applications/obsequi. Since r321138, the MemCpyOpt pass would remove memcpy/memmove calls if known to copy uninitialized memory. In that case, it was initialized by another memcpy, but the annotation for the target pointer said it would not alias. The annotation was actually meant for the source pointer, which was was an alloca and could not alias with the target pointer. llvm-svn: 321371
Diffstat (limited to 'polly/lib/CodeGen')
-rw-r--r--polly/lib/CodeGen/IRBuilder.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/IRBuilder.cpp b/polly/lib/CodeGen/IRBuilder.cpp
index be808851ca7..3efa7c88389 100644
--- a/polly/lib/CodeGen/IRBuilder.cpp
+++ b/polly/lib/CodeGen/IRBuilder.cpp
@@ -201,6 +201,12 @@ void ScopAnnotator::annotate(Instruction *Inst) {
if (!AliasScopeDomain)
return;
+ // Do not apply annotations on memory operations that take more than one
+ // pointer. It would be ambiguous to which pointer the annotation applies.
+ // FIXME: How can we specify annotations for all pointer arguments?
+ if (isa<CallInst>(Inst) && !isa<MemSetInst>(Inst))
+ return;
+
auto *Ptr = getMemAccInstPointerOperand(Inst);
if (!Ptr)
return;
OpenPOWER on IntegriCloud