diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp index 70c1f13047e7..9acfed661d82 100644 --- a/polly/lib/Support/ScopHelper.cpp +++ b/polly/lib/Support/ScopHelper.cpp @@ -260,7 +260,8 @@ private: // If a value mapping was given try if the underlying value is remapped. if (VMap) if (Value *NewVal = VMap->lookup(E->getValue())) - return visit(SE.getSCEV(NewVal)); + if (NewVal != E->getValue()) + return visit(SE.getSCEV(NewVal)); Instruction *Inst = dyn_cast(E->getValue()); if (!Inst || (Inst->getOpcode() != Instruction::SRem &&