mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
[IndVars] Assert that the incoming IR is in LCSSA
Since we already assert that the outgoing IR is in LCSSA, it is easy to get misled into thinking that -indvars broke LCSSA if the incoming IR is non-LCSSA. Checking this pre-condition will make such cases break in more obvious ways. Inspired by (but does _not_ fix) PR26682. llvm-svn: 271196
This commit is contained in:
parent
e6a2988e2b
commit
5581317282
@ -2101,6 +2101,9 @@ void IndVarSimplify::sinkUnusedInvariants(Loop *L) {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
bool IndVarSimplify::run(Loop *L) {
|
||||
// We need (and expect!) the incoming loop to be in LCSSA.
|
||||
assert(L->isRecursivelyLCSSAForm(*DT) && "LCSSA required to run indvars!");
|
||||
|
||||
// If LoopSimplify form is not available, stay out of trouble. Some notes:
|
||||
// - LSR currently only supports LoopSimplify-form loops. Indvars'
|
||||
// canonicalization can be a pessimization without LSR to "clean up"
|
||||
|
Loading…
Reference in New Issue
Block a user