public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] vec: remove unreachable code
@ 2020-09-04 12:11 Andrea Corallo
  2020-09-04 12:12 ` Richard Biener
  2020-09-04 15:37 ` Kewen.Lin
  0 siblings, 2 replies; 8+ messages in thread
From: Andrea Corallo @ 2020-09-04 12:11 UTC (permalink / raw)
  To: gcc-patches; +Cc: rguenther, ook, richard.sandiford, nd

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

Hi all,

just a small patch removing a piece of unreachable code in
'vect_estimate_min_profitable_iters' given the condition
(LOOP_VINFO_USING_PARTIAL_VECTORS_P (loop_vinfo)) is always true as
checked just above.
 
Bootstrapped on aarch64-unknown-linux-gnu.

Okay for trunk?

  Andrea


[-- Attachment #2: 0001-vec-dead-code-removal-in-tree-vect-loop.c.patch --]
[-- Type: text/plain, Size: 1469 bytes --]

From 6bd96581410d9847ab78e6761178d4efbc9a5af2 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <andrea.corallo@arm.com>
Date: Fri, 4 Sep 2020 09:56:59 +0100
Subject: [PATCH] vec: dead code removal in tree-vect-loop.c

gcc/ChangeLog

2020-09-04  Andrea Corallo  <andrea.corallo@arm.com>

	* tree-vect-loop.c (vect_estimate_min_profitable_iters): Remove
	dead code as LOOP_VINFO_USING_PARTIAL_VECTORS_P (loop_vinfo) is
	always verified.
---
 gcc/tree-vect-loop.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 362cdc4f1cb..38576382fe7 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -4101,17 +4101,10 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
       if (outside_overhead > 0)
 	min_vec_niters = outside_overhead / saving_per_viter + 1;
 
-      if (LOOP_VINFO_USING_PARTIAL_VECTORS_P (loop_vinfo))
-	{
-	  int threshold = (vec_inside_cost * min_vec_niters
-			   + vec_outside_cost
-			   + scalar_outside_cost);
-	  min_profitable_estimate = threshold / scalar_single_iter_cost + 1;
-	}
-      else
-	min_profitable_estimate = (min_vec_niters * assumed_vf
-				   + peel_iters_prologue
-				   + peel_iters_epilogue);
+      int threshold = (vec_inside_cost * min_vec_niters
+		       + vec_outside_cost
+		       + scalar_outside_cost);
+      min_profitable_estimate = threshold / scalar_single_iter_cost + 1;
     }
   else
     {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-07 17:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-04 12:11 [PATCH] vec: remove unreachable code Andrea Corallo
2020-09-04 12:12 ` Richard Biener
2020-09-04 12:20   ` Andrea Corallo
2020-09-04 15:37 ` Kewen.Lin
2020-09-07 11:16   ` Richard Sandiford
2020-09-07 16:15     ` [PATCH] vec: Revert "dead code removal in tree-vect-loop.c" and add a comment Andrea Corallo
2020-09-07 17:20       ` Richard Sandiford
2020-09-07 17:55         ` Andrea Corallo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).