[polly] r287270 - [FIX] Do not try to hoist memory intrinsic
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 17 14:11:56 PST 2016
Author: jdoerfert
Date: Thu Nov 17 16:11:56 2016
New Revision: 287270
URL: http://llvm.org/viewvc/llvm-project?rev=287270&view=rev
Log:
[FIX] Do not try to hoist memory intrinsic
Since we do not necessarily treat memory intrinsics as non-affine
anymore, we have to check for them explicitly before we try to hoist an
access.
Modified:
polly/trunk/include/polly/ScopInfo.h
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=287270&r1=287269&r2=287270&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Thu Nov 17 16:11:56 2016
@@ -747,6 +747,11 @@ public:
/// Is this a write memory access?
bool isWrite() const { return isMustWrite() || isMayWrite(); }
+ /// Is this a memory intrinsic access (memcpy, memset, memmove)?
+ bool isMemoryIntrinsic() const {
+ return isa<MemIntrinsic>(getAccessInstruction());
+ }
+
/// Check if a new access relation was imported or set by a pass.
bool hasNewAccessRelation() const { return NewAccessRelation; }
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=287270&r1=287269&r2=287270&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Nov 17 16:11:56 2016
@@ -676,7 +676,7 @@ void MemoryAccess::assumeNoOutOfBound()
}
void MemoryAccess::buildMemIntrinsicAccessRelation() {
- assert(isa<MemIntrinsic>(getAccessInstruction()));
+ assert(isMemoryIntrinsic());
assert(Subscripts.size() == 2 && Sizes.size() == 1);
auto *SubscriptPWA = getPwAff(Subscripts[0]);
@@ -3487,7 +3487,8 @@ __isl_give isl_set *Scop::getNonHoistabl
auto &Stmt = *Access->getStatement();
BasicBlock *BB = Stmt.getEntryBlock();
- if (Access->isScalarKind() || Access->isWrite() || !Access->isAffine())
+ if (Access->isScalarKind() || Access->isWrite() || !Access->isAffine() ||
+ Access->isMemoryIntrinsic())
return nullptr;
// Skip accesses that have an invariant base pointer which is defined but
More information about the llvm-commits
mailing list