[FIX] Handle identity mappings in the ScopExpander

If the VMap in the ScopExpander contains identity mappings
  we now ignore the mapping.

Reported-by: Tobias Grosser <tobias@grosser.es>
llvm-svn: 248946
This commit is contained in:
Johannes Doerfert 2015-09-30 21:12:12 +00:00
parent 4c5a4646bf
commit 59984322c3
1 changed files with 2 additions and 1 deletions

View File

@ -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<Instruction>(E->getValue());
if (!Inst || (Inst->getOpcode() != Instruction::SRem &&