projects
/
platform
/
upstream
/
isl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
isl_aff_scale: special case scaling by a factor of the denominator
[platform/upstream/isl.git]
/
isl_aff.c
diff --git
a/isl_aff.c
b/isl_aff.c
index
ae57b81
..
3acb3f5
100644
(file)
--- a/
isl_aff.c
+++ b/
isl_aff.c
@@
-1214,6
+1214,11
@@
__isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff, isl_int f)
if (!aff->v)
return isl_aff_free(aff);
if (!aff->v)
return isl_aff_free(aff);
+ if (isl_int_is_pos(f) && isl_int_is_divisible_by(aff->v->el[0], f)) {
+ isl_int_divexact(aff->v->el[0], aff->v->el[0], f);
+ return aff;
+ }
+
isl_int_init(gcd);
isl_int_gcd(gcd, aff->v->el[0], f);
isl_int_divexact(aff->v->el[0], aff->v->el[0], gcd);
isl_int_init(gcd);
isl_int_gcd(gcd, aff->v->el[0], f);
isl_int_divexact(aff->v->el[0], aff->v->el[0], gcd);