summaryrefslogtreecommitdiffstats
path: root/polly/lib
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib')
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp10
-rw-r--r--polly/lib/Support/ScopHelper.cpp3
2 files changed, 13 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 14f9e3e08de..910243c9356 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -729,6 +729,16 @@ bool ScopDetection::isValidMemoryAccess(Instruction &Inst,
bool ScopDetection::isValidInstruction(Instruction &Inst,
DetectionContext &Context) const {
+ for (auto &Op : Inst.operands()) {
+ auto *OpInst = dyn_cast<Instruction>(&Op);
+
+ if (!OpInst)
+ continue;
+
+ if (isErrorBlock(*OpInst->getParent(), Context.CurRegion, *LI, *DT))
+ return false;
+ }
+
// We only check the call instruction but not invoke instruction.
if (CallInst *CI = dyn_cast<CallInst>(&Inst)) {
if (isValidCallInst(*CI))
diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp
index b85e8f96e58..49e1e9eab17 100644
--- a/polly/lib/Support/ScopHelper.cpp
+++ b/polly/lib/Support/ScopHelper.cpp
@@ -368,6 +368,9 @@ bool polly::isErrorBlock(BasicBlock &BB, const Region &R, LoopInfo &LI,
for (Instruction &Inst : BB)
if (CallInst *CI = dyn_cast<CallInst>(&Inst)) {
+ if (isIgnoredIntrinsic(CI))
+ return false;
+
if (!CI->doesNotAccessMemory())
return true;
if (CI->doesNotReturn())
OpenPOWER on IntegriCloud