[PATCH] D45534: Add isl operator overloads for isl::pw_aff (Try II)

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 11 13:52:12 PDT 2018


Meinersbur added inline comments.


================
Comment at: include/polly/Support/ISLOperators.h:110-166
+inline isl::pw_aff operator/(isl::pw_aff Left, isl::pw_aff Right) {
+  return Left.tdiv_q(Right);
+}
+
+inline isl::pw_aff operator/(isl::val ValLeft, isl::pw_aff Right) {
+  isl::pw_aff Left(Right.domain(), ValLeft);
+  return Left.tdiv_q(Right);
----------------
[comment] Using tdiv as basis for division and remainder corresponds to C/C++'s definition of these operators, i.e. the most consistent choice. 
However, in practice this rarely what a user really wants, most often it is modulo (cdiv) or they assume that the divisor is positive or divides the dividend in an integer (divexact). Would not defining a default division/remainder operator an option?


Repository:
  rPLO Polly

https://reviews.llvm.org/D45534





More information about the llvm-commits mailing list