aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-scalar-evolution.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-scalar-evolution.cc')
-rw-r--r--gcc/tree-scalar-evolution.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc
index 385fc64..94250b1 100644
--- a/gcc/tree-scalar-evolution.cc
+++ b/gcc/tree-scalar-evolution.cc
@@ -2050,6 +2050,30 @@ analyze_scalar_evolution (class loop *loop, tree var)
return res;
}
+/* If CHREC doesn't overflow, set the nonwrapping flag. */
+
+void record_nonwrapping_chrec (tree chrec)
+{
+ CHREC_NOWRAP(chrec) = 1;
+
+ if (dump_file && (dump_flags & TDF_SCEV))
+ {
+ fprintf (dump_file, "(record_nonwrapping_chrec: ");
+ print_generic_expr (dump_file, chrec);
+ fprintf (dump_file, ")\n");
+ }
+}
+
+/* Return true if CHREC's nonwrapping flag is set. */
+
+bool nonwrapping_chrec_p (tree chrec)
+{
+ if (!chrec || TREE_CODE(chrec) != POLYNOMIAL_CHREC)
+ return false;
+
+ return CHREC_NOWRAP(chrec);
+}
+
/* Analyzes and returns the scalar evolution of VAR address in LOOP. */
static tree