Index: lib/Transform/ScheduleOptimizer.cpp =================================================================== --- lib/Transform/ScheduleOptimizer.cpp +++ lib/Transform/ScheduleOptimizer.cpp @@ -768,7 +768,7 @@ /// Check for dependencies corresponding to the matrix multiplication. /// /// Check that there is only true dependence of the form -/// S(..., k, ...) -> S(..., k + 1, …), where S is the SCoP statement +/// S(..., k, ...) -> S(..., k + , …), where S is the SCoP statement /// represented by @p Schedule and k is @p Pos. Such a dependence corresponds /// to the dependency produced by the matrix multiplication. /// @@ -792,10 +792,10 @@ isl_union_map_free(Dep); int DeltasDimNum = isl_set_dim(Deltas, isl_dim_set); for (int i = 0; i < DeltasDimNum; i++) { + // check for any constant delta auto *Val = isl_set_plain_get_val_if_fixed(Deltas, isl_dim_set, i); Pos = Pos < 0 && isl_val_is_one(Val) ? i : Pos; - if (isl_val_is_nan(Val) || - !(isl_val_is_zero(Val) || (i == Pos && isl_val_is_one(Val)))) { + if (!isl_val_is_zero(Val) && i != Pos) { isl_val_free(Val); isl_set_free(Deltas); return false;