1 /* Code for GIMPLE range related routines.
2 Copyright (C) 2019-2022 Free Software Foundation, Inc.
3 Contributed by Andrew MacLeod <amacleod@redhat.com>
4 and Aldy Hernandez <aldyh@redhat.com>.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
24 #include "coretypes.h"
29 #include "gimple-pretty-print.h"
30 #include "gimple-iterator.h"
32 #include "fold-const.h"
35 #include "tree-scalar-evolution.h"
36 #include "gimple-range.h"
37 #include "gimple-fold.h"
38 #include "gimple-walk.h"
40 gimple_ranger::gimple_ranger (bool use_imm_uses) :
41 non_executable_edge_flag (cfun),
42 m_cache (non_executable_edge_flag, use_imm_uses),
46 // If the cache has a relation oracle, use it.
47 m_oracle = m_cache.oracle ();
48 if (dump_file && (param_ranger_debug & RANGER_DEBUG_TRACE))
49 tracer.enable_trace ();
50 m_stmt_list.create (0);
51 m_stmt_list.safe_grow (num_ssa_names);
52 m_stmt_list.truncate (0);
54 // Ensure the not_executable flag is clear everywhere.
58 FOR_ALL_BB_FN (bb, cfun)
62 FOR_EACH_EDGE (e, ei, bb->succs)
63 gcc_checking_assert ((e->flags & non_executable_edge_flag) == 0);
68 gimple_ranger::~gimple_ranger ()
70 m_stmt_list.release ();
74 gimple_ranger::range_of_expr (vrange &r, tree expr, gimple *stmt)
77 if (!gimple_range_ssa_p (expr))
78 return get_tree_range (r, expr, stmt);
80 if ((idx = tracer.header ("range_of_expr(")))
82 print_generic_expr (dump_file, expr, TDF_SLIM);
83 fputs (")", dump_file);
86 fputs (" at stmt ", dump_file);
87 print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
90 fputs ("\n", dump_file);
93 // If there is no statement, just get the global value.
96 Value_Range tmp (TREE_TYPE (expr));
97 m_cache.get_global_range (r, expr);
98 // Pick up implied context information from the on-entry cache
99 // if current_bb is set. Do not attempt any new calculations.
100 if (current_bb && m_cache.block_range (tmp, current_bb, expr, false))
104 sprintf (str, "picked up range from bb %d\n",current_bb->index);
106 tracer.print (idx, str);
109 // For a debug stmt, pick the best value currently available, do not
110 // trigger new value calculations. PR 100781.
111 else if (is_gimple_debug (stmt))
112 m_cache.range_of_expr (r, expr, stmt);
115 basic_block bb = gimple_bb (stmt);
116 gimple *def_stmt = SSA_NAME_DEF_STMT (expr);
118 // If name is defined in this block, try to get an range from S.
119 if (def_stmt && gimple_bb (def_stmt) == bb)
121 // Declared in this block, if it has a global set, check for an
122 // override from a block walk, otherwise calculate it.
123 if (m_cache.get_global_range (r, expr))
124 m_cache.block_range (r, bb, expr, false);
126 range_of_stmt (r, def_stmt, expr);
128 // Otherwise OP comes from outside this block, use range on entry.
130 range_on_entry (r, bb, expr);
133 tracer.trailer (idx, "range_of_expr", true, expr, r);
137 // Return the range of NAME on entry to block BB in R.
140 gimple_ranger::range_on_entry (vrange &r, basic_block bb, tree name)
142 Value_Range entry_range (TREE_TYPE (name));
143 gcc_checking_assert (gimple_range_ssa_p (name));
146 if ((idx = tracer.header ("range_on_entry (")))
148 print_generic_expr (dump_file, name, TDF_SLIM);
149 fprintf (dump_file, ") to BB %d\n", bb->index);
152 // Start with any known range
153 range_of_stmt (r, SSA_NAME_DEF_STMT (name), name);
155 // Now see if there is any on_entry value which may refine it.
156 if (m_cache.block_range (entry_range, bb, name))
157 r.intersect (entry_range);
160 tracer.trailer (idx, "range_on_entry", true, name, r);
163 // Calculate the range for NAME at the end of block BB and return it in R.
164 // Return false if no range can be calculated.
167 gimple_ranger::range_on_exit (vrange &r, basic_block bb, tree name)
169 // on-exit from the exit block?
170 gcc_checking_assert (gimple_range_ssa_p (name));
173 if ((idx = tracer.header ("range_on_exit (")))
175 print_generic_expr (dump_file, name, TDF_SLIM);
176 fprintf (dump_file, ") from BB %d\n", bb->index);
179 gimple *s = SSA_NAME_DEF_STMT (name);
180 basic_block def_bb = gimple_bb (s);
181 // If this is not the definition block, get the range on the last stmt in
182 // the block... if there is one.
185 // If there is no statement provided, get the range_on_entry for this block.
187 range_of_expr (r, name, s);
189 range_on_entry (r, bb, name);
190 gcc_checking_assert (r.undefined_p ()
191 || range_compatible_p (r.type (), TREE_TYPE (name)));
194 tracer.trailer (idx, "range_on_exit", true, name, r);
197 // Calculate a range for NAME on edge E and return it in R.
200 gimple_ranger::range_on_edge (vrange &r, edge e, tree name)
202 Value_Range edge_range (TREE_TYPE (name));
204 if (!r.supports_type_p (TREE_TYPE (name)))
207 // Do not process values along abnormal edges.
208 if (e->flags & EDGE_ABNORMAL)
209 return get_tree_range (r, name, NULL);
212 if ((idx = tracer.header ("range_on_edge (")))
214 print_generic_expr (dump_file, name, TDF_SLIM);
215 fprintf (dump_file, ") on edge %d->%d\n", e->src->index, e->dest->index);
218 // Check to see if the edge is executable.
219 if ((e->flags & non_executable_edge_flag))
223 tracer.trailer (idx, "range_on_edge [Unexecutable] ", true,
229 if (!gimple_range_ssa_p (name))
230 res = get_tree_range (r, name, NULL);
233 range_on_exit (r, e->src, name);
234 // If this is not an abnormal edge, check for a non-null exit .
235 if ((e->flags & (EDGE_EH | EDGE_ABNORMAL)) == 0)
236 m_cache.m_exit.maybe_adjust_range (r, name, e->src);
237 gcc_checking_assert (r.undefined_p ()
238 || range_compatible_p (r.type(), TREE_TYPE (name)));
240 // Check to see if NAME is defined on edge e.
241 if (m_cache.range_on_edge (edge_range, e, name))
242 r.intersect (edge_range);
246 tracer.trailer (idx, "range_on_edge", res, name, r);
250 // fold_range wrapper for range_of_stmt to use as an internal client.
253 gimple_ranger::fold_range_internal (vrange &r, gimple *s, tree name)
256 fur_depend src (s, &(gori ()), this);
257 return f.fold_stmt (r, s, src, name);
260 // Calculate a range for statement S and return it in R. If NAME is
261 // provided it represents the SSA_NAME on the LHS of the statement.
262 // It is only required if there is more than one lhs/output. Check
263 // the global cache for NAME first to see if the evaluation can be
264 // avoided. If a range cannot be calculated, return false and UNDEFINED.
267 gimple_ranger::range_of_stmt (vrange &r, gimple *s, tree name)
273 if ((idx = tracer.header ("range_of_stmt (")))
276 print_generic_expr (dump_file, name, TDF_SLIM);
277 fputs (") at stmt ", dump_file);
278 print_gimple_stmt (dump_file, s, 0, TDF_SLIM);
282 name = gimple_get_lhs (s);
284 // If no name, simply call the base routine.
287 res = fold_range_internal (r, s, NULL_TREE);
288 if (res && is_a <gcond *> (s))
290 // Update any exports in the cache if this is a gimple cond statement.
292 basic_block bb = gimple_bb (s);
293 FOR_EACH_GORI_EXPORT_NAME (m_cache.m_gori, bb, exp)
294 m_cache.propagate_updated_value (exp, bb);
297 else if (!gimple_range_ssa_p (name))
298 res = get_tree_range (r, name, NULL);
302 // Check if the stmt has already been processed.
303 if (m_cache.get_global_range (r, name, current))
305 // If it isn't stale, use this cached value.
309 tracer.trailer (idx, " cached", true, name, r);
314 prefill_stmt_dependencies (name);
316 // Calculate a new value.
317 Value_Range tmp (TREE_TYPE (name));
318 fold_range_internal (tmp, s, name);
320 // Combine the new value with the old value. This is required because
321 // the way value propagation works, when the IL changes on the fly we
322 // can sometimes get different results. See PR 97741.
324 m_cache.set_global_range (name, r);
329 tracer.trailer (idx, "range_of_stmt", res, name, r);
334 // Check if NAME is a dependency that needs resolving, and push it on the
335 // stack if so. R is a scratch range.
338 gimple_ranger::prefill_name (vrange &r, tree name)
340 if (!gimple_range_ssa_p (name))
342 gimple *stmt = SSA_NAME_DEF_STMT (name);
343 if (!gimple_range_op_handler::supported_p (stmt) && !is_a<gphi *> (stmt))
347 // If this op has not been processed yet, then push it on the stack
348 if (!m_cache.get_global_range (r, name, current))
349 m_stmt_list.safe_push (name);
352 // This routine will seed the global cache with most of the depnedencies of
353 // NAME. This prevents excessive call depth through the normal API.
356 gimple_ranger::prefill_stmt_dependencies (tree ssa)
358 if (SSA_NAME_IS_DEFAULT_DEF (ssa))
362 gimple *stmt = SSA_NAME_DEF_STMT (ssa);
363 gcc_checking_assert (stmt && gimple_bb (stmt));
365 // Only pre-process range-ops and phis.
366 if (!gimple_range_op_handler::supported_p (stmt) && !is_a<gphi *> (stmt))
369 // Mark where on the stack we are starting.
370 unsigned start = m_stmt_list.length ();
371 m_stmt_list.safe_push (ssa);
373 idx = tracer.header ("ROS dependence fill\n");
375 // Loop until back at the start point.
376 while (m_stmt_list.length () > start)
378 tree name = m_stmt_list.last ();
379 // NULL is a marker which indicates the next name in the stack has now
380 // been fully resolved, so we can fold it.
383 // Pop the NULL, then pop the name.
385 name = m_stmt_list.pop ();
386 // Don't fold initial request, it will be calculated upon return.
387 if (m_stmt_list.length () > start)
389 // Fold and save the value for NAME.
390 stmt = SSA_NAME_DEF_STMT (name);
391 Value_Range r (TREE_TYPE (name));
392 fold_range_internal (r, stmt, name);
393 // Make sure we don't lose any current global info.
394 Value_Range tmp (TREE_TYPE (name));
395 m_cache.get_global_range (tmp, name);
397 m_cache.set_global_range (name, r);
402 // Add marker indicating previous NAME in list should be folded
403 // when we get to this NULL.
404 m_stmt_list.safe_push (NULL_TREE);
405 stmt = SSA_NAME_DEF_STMT (name);
409 tracer.print (idx, "ROS dep fill (");
410 print_generic_expr (dump_file, name, TDF_SLIM);
411 fputs (") at stmt ", dump_file);
412 print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
415 gphi *phi = dyn_cast <gphi *> (stmt);
418 Value_Range r (TREE_TYPE (gimple_phi_result (phi)));
419 for (unsigned x = 0; x < gimple_phi_num_args (phi); x++)
420 prefill_name (r, gimple_phi_arg_def (phi, x));
424 gimple_range_op_handler handler (stmt);
425 gcc_checking_assert (handler);
426 tree op = handler.operand2 ();
429 Value_Range r (TREE_TYPE (op));
430 prefill_name (r, op);
432 op = handler.operand1 ();
435 Value_Range r (TREE_TYPE (op));
436 prefill_name (r, op);
443 tracer.trailer (idx, "ROS ", false, ssa, r);
448 // This routine will invoke the gimple fold_stmt routine, providing context to
449 // range_of_expr calls via an private interal API.
452 gimple_ranger::fold_stmt (gimple_stmt_iterator *gsi, tree (*valueize) (tree))
454 gimple *stmt = gsi_stmt (*gsi);
455 current_bb = gimple_bb (stmt);
456 bool ret = ::fold_stmt (gsi, valueize);
461 // Called during dominator walks to register any inferred ranges that take
462 // effect from this point forward.
465 gimple_ranger::register_inferred_ranges (gimple *s)
467 // First, export the LHS if it is a new global range.
468 tree lhs = gimple_get_lhs (s);
471 Value_Range tmp (TREE_TYPE (lhs));
472 if (range_of_stmt (tmp, s, lhs) && !tmp.varying_p ()
473 && set_range_info (lhs, tmp) && dump_file)
475 fprintf (dump_file, "Global Exported: ");
476 print_generic_expr (dump_file, lhs, TDF_SLIM);
477 fprintf (dump_file, " = ");
478 tmp.dump (dump_file);
479 fputc ('\n', dump_file);
482 m_cache.apply_inferred_ranges (s);
485 // This function will walk the statements in BB to determine if any
486 // discovered inferred ranges in the block have any transitive effects,
487 // and if so, register those effects in BB.
490 gimple_ranger::register_transitive_inferred_ranges (basic_block bb)
492 // Return if there are no inferred ranges in BB.
493 infer_range_manager &infer = m_cache.m_exit;
494 if (!infer.has_range_p (bb))
497 if (dump_file && (dump_flags & TDF_DETAILS))
498 fprintf (dump_file, "Checking for transitive inferred ranges in BB %d\n",
501 for (gimple_stmt_iterator si = gsi_start_bb (bb); !gsi_end_p (si);
504 gimple *s = gsi_stmt (si);
505 tree lhs = gimple_get_lhs (s);
506 // If the LHS alreayd has an inferred effect, leave it be.
507 if (!gimple_range_ssa_p (lhs) || infer.has_range_p (lhs, bb))
509 // Pick up global value.
510 Value_Range g (TREE_TYPE (lhs));
511 range_of_expr (g, lhs);
513 // If either dependency has an inferred range, check if recalculating
514 // the LHS is different than the global value. If so, register it as
515 // an inferred range as well.
516 Value_Range r (TREE_TYPE (lhs));
518 tree name1 = gori ().depend1 (lhs);
519 tree name2 = gori ().depend2 (lhs);
520 if ((name1 && infer.has_range_p (name1, bb))
521 || (name2 && infer.has_range_p (name2, bb)))
523 // Check if folding S produces a different result.
524 if (fold_range (r, s, this) && g != r)
526 infer.add_range (lhs, bb, r);
527 m_cache.register_inferred_value (r, lhs, bb);
533 // When a statement S has changed since the result was cached, re-evaluate
534 // and update the global cache.
537 gimple_ranger::update_stmt (gimple *s)
539 tree lhs = gimple_get_lhs (s);
540 if (!lhs || !gimple_range_ssa_p (lhs))
542 Value_Range r (TREE_TYPE (lhs));
543 // Only update if it already had a value.
544 if (m_cache.get_global_range (r, lhs))
546 // Re-calculate a new value using just cache values.
547 Value_Range tmp (TREE_TYPE (lhs));
549 fur_stmt src (s, &m_cache);
550 f.fold_stmt (tmp, s, src, lhs);
552 // Combine the new value with the old value to check for a change.
553 if (r.intersect (tmp))
555 if (dump_file && (dump_flags & TDF_DETAILS))
557 print_generic_expr (dump_file, lhs, TDF_SLIM);
558 fprintf (dump_file, " : global value re-evaluated to ");
560 fputc ('\n', dump_file);
562 m_cache.set_global_range (lhs, r);
567 // This routine will export whatever global ranges are known to GCC
568 // SSA_RANGE_NAME_INFO and SSA_NAME_PTR_INFO fields.
571 gimple_ranger::export_global_ranges ()
573 /* Cleared after the table header has been printed. */
574 bool print_header = true;
575 for (unsigned x = 1; x < num_ssa_names; x++)
577 tree name = ssa_name (x);
580 Value_Range r (TREE_TYPE (name));
581 if (name && !SSA_NAME_IN_FREE_LIST (name)
582 && gimple_range_ssa_p (name)
583 && m_cache.get_global_range (r, name)
586 bool updated = set_range_info (name, r);
587 if (!updated || !dump_file)
592 /* Print the header only when there's something else
594 fprintf (dump_file, "Exported global range table:\n");
595 fprintf (dump_file, "============================\n");
596 print_header = false;
599 print_generic_expr (dump_file, name , TDF_SLIM);
600 fprintf (dump_file, " : ");
602 fprintf (dump_file, "\n");
607 // Print the known table values to file F.
610 gimple_ranger::dump_bb (FILE *f, basic_block bb)
615 fprintf (f, "\n=========== BB %d ============\n", bb->index);
616 m_cache.dump_bb (f, bb);
618 ::dump_bb (f, bb, 4, TDF_NONE);
620 // Now find any globals defined in this block.
621 for (x = 1; x < num_ssa_names; x++)
623 tree name = ssa_name (x);
624 if (!gimple_range_ssa_p (name) || !SSA_NAME_DEF_STMT (name))
626 Value_Range range (TREE_TYPE (name));
627 if (gimple_bb (SSA_NAME_DEF_STMT (name)) == bb
628 && m_cache.get_global_range (range, name))
630 if (!range.varying_p ())
632 print_generic_expr (f, name, TDF_SLIM);
641 // And now outgoing edges, if they define anything.
642 FOR_EACH_EDGE (e, ei, bb->succs)
644 for (x = 1; x < num_ssa_names; x++)
646 tree name = gimple_range_ssa_p (ssa_name (x));
647 if (!name || !gori ().has_edge_range_p (name, e))
650 Value_Range range (TREE_TYPE (name));
651 if (m_cache.range_on_edge (range, e, name))
653 gimple *s = SSA_NAME_DEF_STMT (name);
654 Value_Range tmp_range (TREE_TYPE (name));
655 // Only print the range if this is the def block, or
656 // the on entry cache for either end of the edge is
658 if ((s && bb == gimple_bb (s)) ||
659 m_cache.block_range (tmp_range, bb, name, false) ||
660 m_cache.block_range (tmp_range, e->dest, name, false))
662 if (!range.varying_p ())
664 fprintf (f, "%d->%d ", e->src->index,
667 if (e->flags & EDGE_TRUE_VALUE)
668 fprintf (f, " (T)%c", c);
669 else if (e->flags & EDGE_FALSE_VALUE)
670 fprintf (f, " (F)%c", c);
673 print_generic_expr (f, name, TDF_SLIM);
684 // Print the known table values to file F.
687 gimple_ranger::dump (FILE *f)
691 FOR_EACH_BB_FN (bb, cfun)
698 gimple_ranger::debug ()
703 /* Create a new ranger instance and associate it with function FUN.
704 Each call must be paired with a call to disable_ranger to release
708 enable_ranger (struct function *fun, bool use_imm_uses)
712 gcc_checking_assert (!fun->x_range_query);
713 r = new gimple_ranger (use_imm_uses);
714 fun->x_range_query = r;
719 /* Destroy and release the ranger instance associated with function FUN
720 and replace it the global ranger. */
723 disable_ranger (struct function *fun)
725 gcc_checking_assert (fun->x_range_query);
726 delete fun->x_range_query;
727 fun->x_range_query = NULL;
730 // ------------------------------------------------------------------------
732 // If there is a non-varying value associated with NAME, return true and the
736 assume_query::assume_range_p (vrange &r, tree name)
738 if (global.get_global_range (r, name))
739 return !r.varying_p ();
743 // Query used by GORI to pick up any known value on entry to a block.
746 assume_query::range_of_expr (vrange &r, tree expr, gimple *stmt)
748 if (!gimple_range_ssa_p (expr))
749 return get_tree_range (r, expr, stmt);
751 if (!global.get_global_range (r, expr))
752 r.set_varying (TREE_TYPE (expr));
756 // If the current function returns an integral value, and has a single return
757 // statement, it will calculate any SSA_NAMES is can determine ranges forr
758 // assuming the function returns 1.
760 assume_query::assume_query ()
762 basic_block exit_bb = EXIT_BLOCK_PTR_FOR_FN (cfun);
763 if (single_pred_p (exit_bb))
765 basic_block bb = single_pred (exit_bb);
766 gimple_stmt_iterator gsi = gsi_last_nondebug_bb (bb);
769 gimple *s = gsi_stmt (gsi);
770 if (!is_a<greturn *> (s))
772 greturn *gret = as_a<greturn *> (s);
773 tree op = gimple_return_retval (gret);
774 if (!gimple_range_ssa_p (op))
776 tree lhs_type = TREE_TYPE (op);
777 if (!irange::supports_p (lhs_type))
780 unsigned prec = TYPE_PRECISION (lhs_type);
781 int_range<2> lhs_range (lhs_type, wi::one (prec), wi::one (prec));
782 global.set_global_range (op, lhs_range);
784 gimple *def = SSA_NAME_DEF_STMT (op);
785 if (!def || gimple_get_lhs (def) != op)
787 fur_stmt src (gret, this);
788 calculate_stmt (def, lhs_range, src);
792 // Evaluate operand OP on statement S, using the provided LHS range.
793 // If successful, set the range in the global table, then visit OP's def stmt.
796 assume_query::calculate_op (tree op, gimple *s, vrange &lhs, fur_source &src)
798 Value_Range op_range (TREE_TYPE (op));
799 if (m_gori.compute_operand_range (op_range, s, lhs, op, src)
800 && !op_range.varying_p ())
802 Value_Range range (TREE_TYPE (op));
803 if (global.get_global_range (range, op))
804 op_range.intersect (range);
805 global.set_global_range (op, op_range);
806 gimple *def_stmt = SSA_NAME_DEF_STMT (op);
807 if (def_stmt && gimple_get_lhs (def_stmt) == op)
808 calculate_stmt (def_stmt, op_range, src);
812 // Evaluate PHI statement, using the provided LHS range.
813 // Check each constant argument predecessor if it can be taken
814 // provide LHS to any symbolic argmeuents, and process their def statements.
817 assume_query::calculate_phi (gphi *phi, vrange &lhs_range, fur_source &src)
819 for (unsigned x= 0; x < gimple_phi_num_args (phi); x++)
821 tree arg = gimple_phi_arg_def (phi, x);
822 Value_Range arg_range (TREE_TYPE (arg));
823 if (gimple_range_ssa_p (arg))
825 // A symbol arg will be the LHS value.
826 arg_range = lhs_range;
827 range_cast (arg_range, TREE_TYPE (arg));
828 if (!global.get_global_range (arg_range, arg))
830 global.set_global_range (arg, arg_range);
831 gimple *def_stmt = SSA_NAME_DEF_STMT (arg);
832 if (def_stmt && gimple_get_lhs (def_stmt) == arg)
833 calculate_stmt (def_stmt, arg_range, src);
836 else if (get_tree_range (arg_range, arg, NULL))
838 // If this is a constant value that differs from LHS, this
839 // edge cannot be taken.
840 arg_range.intersect (lhs_range);
841 if (arg_range.undefined_p ())
843 // Otherwise check the condition feeding this edge.
844 edge e = gimple_phi_arg_edge (phi, x);
845 check_taken_edge (e, src);
850 // If an edge is known to be taken, examine the outgoing edge to see
851 // if it carries any range information that can also be evaluated.
854 assume_query::check_taken_edge (edge e, fur_source &src)
856 gimple *stmt = gimple_outgoing_range_stmt_p (e->src);
857 if (stmt && is_a<gcond *> (stmt))
860 gcond_edge_range (cond, e);
861 calculate_stmt (stmt, cond, src);
865 // Evaluate statement S which produces range LHS_RANGE.
868 assume_query::calculate_stmt (gimple *s, vrange &lhs_range, fur_source &src)
870 gimple_range_op_handler handler (s);
873 tree op = gimple_range_ssa_p (handler.operand1 ());
875 calculate_op (op, s, lhs_range, src);
876 op = gimple_range_ssa_p (handler.operand2 ());
878 calculate_op (op, s, lhs_range, src);
880 else if (is_a<gphi *> (s))
882 calculate_phi (as_a<gphi *> (s), lhs_range, src);
883 // Don't further check predecessors of blocks with PHIs.
887 // Even if the walk back terminates before the top, if this is a single
888 // predecessor block, see if the predecessor provided any ranges to get here.
889 if (single_pred_p (gimple_bb (s)))
890 check_taken_edge (single_pred_edge (gimple_bb (s)), src);
893 // Show everything that was calculated.
896 assume_query::dump (FILE *f)
898 fprintf (f, "Assumption details calculated:\n");
899 for (unsigned i = 0; i < num_ssa_names; i++)
901 tree name = ssa_name (i);
902 if (!name || !gimple_range_ssa_p (name))
904 tree type = TREE_TYPE (name);
905 if (!Value_Range::supports_type_p (type))
908 Value_Range assume_range (type);
909 if (assume_range_p (assume_range, name))
911 print_generic_expr (f, name, TDF_SLIM);
913 assume_range.dump (f);
917 fprintf (f, "------------------------------\n");