mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-16 02:57:52 +00: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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271196 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9aaeb83f58
commit
285ed3c6e4
@ -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…
x
Reference in New Issue
Block a user