From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1075) id 042993858D1E; Mon, 1 May 2023 22:19:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 042993858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682979550; bh=SKv3d9trbo00wiWkPDyHQg6TBZXC4ps+kTQo3ywcaes=; h=From:To:Subject:Date:From; b=DIWLmSAIsofr5H9Xge9bpLJPLAqblDgImTaHvUN64pf7RUHgYE2QXArM6zyfwlpi3 7CEI+Smz1/5KacNaeamqB6DOJ3NK+Qi4JhzbX+t8h3SNow1y3QJBJJu6k1mfckHtIZ QIfcSJnxX1bTs8ZkFKy+2FwpANjMnycyAWacKpiU= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jan Hubicka To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/kubaneko/heads/histogram)] Fix use of estimates. X-Act-Checkin: gcc X-Git-Author: Honza X-Git-Refname: refs/users/kubaneko/heads/histogram X-Git-Oldrev: e4287fa88d78d5569ad8948378bf7d4395b6f157 X-Git-Newrev: e3bc373e2bf65039a7f5f11a2b49a742ac1caa09 Message-Id: <20230501221910.042993858D1E@sourceware.org> Date: Mon, 1 May 2023 22:19:10 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e3bc373e2bf65039a7f5f11a2b49a742ac1caa09 commit e3bc373e2bf65039a7f5f11a2b49a742ac1caa09 Author: Honza Date: Tue May 2 00:18:57 2023 +0200 Fix use of estimates. Diff: --- gcc/tree-vect-loop.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 140bafad28c..ba068af264c 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -2109,9 +2109,10 @@ vect_analyze_loop_costing (loop_vec_info loop_vinfo, if (LOOP_VINFO_EPILOGUE_P (loop_vinfo)) estimated_niter = vect_vf_for_cost (LOOP_VINFO_ORIG_LOOP_INFO (loop_vinfo)) - 1; - else if (use_estimate) + else { - estimated_niter = estimated_stmt_executions_int (loop); + if (use_estimate) + estimated_niter = estimated_stmt_executions_int (loop); if (estimated_niter == -1) estimated_niter = likely_max_stmt_executions_int (loop); }