public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH GCC][2/7]Don't rename variables for deleted new preheader
@ 2017-10-05 13:16 Bin Cheng
  2017-10-09 13:30 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Bin Cheng @ 2017-10-05 13:16 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd

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

Hi,
I noticed that new_preheader basic block could be deleted if the copied
loop is added at entry in function slpeel_tree_duplicate_loop_to_edge_cfg.
This simple patch skips new_preheader during variable renaming if it is
deleted.
Bootstrap and test in patch set on x86_64 and AArch64, is it OK?

Thanks,
bin
2017-10-04  Bin Cheng  <bin.cheng@arm.com>

	* tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Skip
	renaming variables in new preheader if it's deleted.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-skip-new_preheader.txt.patch --]
[-- Type: text/x-patch; name="0002-skip-new_preheader.txt.patch", Size: 925 bytes --]

From 9c7719402c9528b517d8408419c2e9b930708772 Mon Sep 17 00:00:00 2001
From: Bin Cheng <binche01@e108451-lin.cambridge.arm.com>
Date: Fri, 22 Sep 2017 16:50:40 +0100
Subject: [PATCH 2/7] skip-new_preheader.txt

---
 gcc/tree-vect-loop-manip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index f78e4b4..2c724a2 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -496,7 +496,8 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop,
 			       loop_preheader_edge (new_loop)->src);
     }
 
-  for (unsigned i = 0; i < scalar_loop->num_nodes + 1; i++)
+  /* Skip new preheader since it's deleted if copy loop is added at entry.  */
+  for (unsigned i = (at_exit ? 0 : 1); i < scalar_loop->num_nodes + 1; i++)
     rename_variables_in_bb (new_bbs[i], duplicate_outer_loop);
 
   if (scalar_loop != loop)
-- 
1.9.1


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

* Re: [PATCH GCC][2/7]Don't rename variables for deleted new preheader
  2017-10-05 13:16 [PATCH GCC][2/7]Don't rename variables for deleted new preheader Bin Cheng
@ 2017-10-09 13:30 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2017-10-09 13:30 UTC (permalink / raw)
  To: Bin Cheng; +Cc: gcc-patches, nd

On Thu, Oct 5, 2017 at 3:15 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> I noticed that new_preheader basic block could be deleted if the copied
> loop is added at entry in function slpeel_tree_duplicate_loop_to_edge_cfg.
> This simple patch skips new_preheader during variable renaming if it is
> deleted.
> Bootstrap and test in patch set on x86_64 and AArch64, is it OK?

Ok.

Richard.

> Thanks,
> bin
> 2017-10-04  Bin Cheng  <bin.cheng@arm.com>
>
>         * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Skip
>         renaming variables in new preheader if it's deleted.

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

end of thread, other threads:[~2017-10-09 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 13:16 [PATCH GCC][2/7]Don't rename variables for deleted new preheader Bin Cheng
2017-10-09 13:30 ` Richard Biener

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).