forked from OSchip/llvm-project
Fix a bug in getSCEVAtScope w.r.t. non-canonical loops
The issue is that if we have a loop with multiple predecessors outside the loop, the code was expecting to merge them and only return if equal, but instead returned the first one seen. I have no idea if this actually tripped anywhere. I noticed it by accident when reading the code and have no idea how to go about constructing a test case. llvm-svn: 363112
This commit is contained in:
parent
0e9b1d2a20
commit
02f0b379f5
|
@ -8126,10 +8126,10 @@ const SCEV *ScalarEvolution::computeSCEVAtScope(const SCEV *V, const Loop *L) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!MultipleInitValues && InitValue)
|
||||
return getSCEV(InitValue);
|
||||
}
|
||||
}
|
||||
// Okay, we know how many times the containing loop executes. If
|
||||
// this is a constant evolving PHI node, get the final value at
|
||||
// the specified iteration number.
|
||||
|
|
Loading…
Reference in New Issue