On Tue, Jun 28, 2022 at 9:36 AM Richard Biener
<richard.guent...@gmail.com> wrote:
>
> On Mon, Jun 27, 2022 at 9:00 PM Aldy Hernandez <al...@redhat.com> wrote:
> >
> > The conversion for loop-ch is trivial, since the range of a
> > GIMPLE_COND is always an integer.
>
> Yes - but doesn't this hint at the fact that the irange::supports_p is
> useless because it checks on the type of the comparison operand
> rather than the type of the comparison (boolean_type_node)?
>
> So .. instead of replacing it, remove it?

You're absolutely right.

OK pending tests?

Aldy
From 6a37eec1ccc4f9d648156bc1eaf99ba73a6ccce2 Mon Sep 17 00:00:00 2001
From: Aldy Hernandez <al...@redhat.com>
Date: Mon, 27 Jun 2022 20:50:03 +0200
Subject: [PATCH] Allow all types supported by ranger in loop-ch.

This converts the ranger use in loop-ch to allow any types allowed by
the ranger infrastructure.  Since the range of a GIMPLE_COND is always an
integer we can remove the check because the only temporary is already
an int_range.

gcc/ChangeLog:

	* tree-ssa-loop-ch.cc (entry_loop_condition_is_static): Remove
	irange::supports_p.
---
 gcc/tree-ssa-loop-ch.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc
index 26d96c0c21a..b74f1d7b612 100644
--- a/gcc/tree-ssa-loop-ch.cc
+++ b/gcc/tree-ssa-loop-ch.cc
@@ -54,8 +54,7 @@ entry_loop_condition_is_static (class loop *l, path_range_query *query)
   edge e = loop_preheader_edge (l);
   gcond *last = safe_dyn_cast <gcond *> (last_stmt (e->dest));
 
-  if (!last
-      || !irange::supports_p (TREE_TYPE (gimple_cond_lhs (last))))
+  if (!last)
     return false;
 
   edge true_e, false_e;
-- 
2.36.1

Reply via email to