This is an archive of the discontinued LLVM Phabricator instance.

[Polly] Fix a if condition in isl_coalesce.ci
AbandonedPublic

Authored by xgupta on Jan 22 2023, 8:35 AM.

Details

Summary

info->bmap is a pointer to an isl_basic_map struct and n_eq is a
member of that struct, which represents the number of equality
constraints in the basic map. It should not be less than zero.
Previously it waas performing "pointer < 0" check.

Diff Detail

Event Timeline

xgupta created this revision.Jan 22 2023, 8:35 AM
Herald added a project: Restricted Project. · View Herald Transcript
xgupta requested review of this revision.Jan 22 2023, 8:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2023, 8:35 AM

Thank you for the patch. However, we do not patch ISL in the LLVM directly, but instead report upstream to isl-development@googlegroups.com and then update the LLVM copy.

I think this has already been fixed upstream in https://repo.or.cz/isl.git/blobdiff/f7b0ef95845d57fc839090d5075b84fa706eeb15..f035f41be325a5e173d6531f384ded9799943d87:/isl_coalesce.c . I just updated the LLVM copy. The funcion now reads

	if (any) {
		if (isl_tab_rollback(info->tab, snap) < 0)
			return isl_stat_error;
		info->bmap = isl_basic_map_cow(info->bmap);
		info->bmap = isl_basic_map_free_inequality(info->bmap, 2 * n);
		if (!info->bmap)
			return isl_stat_error;

		return fix_constant_divs(info, n, expanded);
	}

Please check whether the problem still occurs. I cannot check without a test case.

Thank you for the patch. However, we do not patch ISL in the LLVM directly, but instead report upstream to isl-development@googlegroups.com and then update the LLVM copy.

I think this has already been fixed upstream in https://repo.or.cz/isl.git/blobdiff/f7b0ef95845d57fc839090d5075b84fa706eeb15..f035f41be325a5e173d6531f384ded9799943d87:/isl_coalesce.c . I just updated the LLVM copy. The funcion now reads

	if (any) {
		if (isl_tab_rollback(info->tab, snap) < 0)
			return isl_stat_error;
		info->bmap = isl_basic_map_cow(info->bmap);
		info->bmap = isl_basic_map_free_inequality(info->bmap, 2 * n);
		if (!info->bmap)
			return isl_stat_error;

		return fix_constant_divs(info, n, expanded);
	}

Please check whether the problem still occurs. I cannot check without a test case.

Ah, Thanks. Then it is fine. I will drop this revision since fixed is already there.

xgupta abandoned this revision.Jan 26 2023, 9:28 AM