Index: lib/Analysis/ScopInfo.cpp =================================================================== --- lib/Analysis/ScopInfo.cpp +++ lib/Analysis/ScopInfo.cpp @@ -2262,7 +2262,7 @@ SmallVector ConditionSets; auto *TI = InScop ? CI->getParent()->getTerminator() : nullptr; - auto &Stmt = InScop ? *getStmtFor(CI->getParent()) : *Stmts.begin(); + auto &Stmt = InScop ? *getStmtFor(CI) : *Stmts.begin(); auto *Dom = InScop ? getDomainConditions(&Stmt) : isl_set_copy(Context); bool Valid = buildConditionSets(*this, Stmt.getEntryBlock(), Val, TI, L, Dom, InvalidDomainMap, ConditionSets);