public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Cc: "hernandez, aldy" <aldyh@redhat.com>
Subject: [PATCH 01/17] Replace another snippet with a call to, gimple_range_ssa_names.
Date: Thu, 22 Sep 2022 14:53:24 -0400	[thread overview]
Message-ID: <b17227f0-cdcf-f25b-58fb-4ad2751ff772@redhat.com> (raw)
In-Reply-To: <571782f9-72e6-5c30-da55-b8d62d3a153e@redhat.com>

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

When the original patch was applied, I missed a spot which could
also be rewritten to use gimple_range_ssa_names.

Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed.

Andrew

[-- Attachment #2: 0001-Replace-another-snippet-with-a-call-to-gimple_range_.patch --]
[-- Type: text/x-patch, Size: 1911 bytes --]

From 3cba5cd6e019182dbff756f621af048d55cdda98 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@redhat.com>
Date: Wed, 31 Aug 2022 17:28:09 -0400
Subject: [PATCH 01/17] Replace another snippet with a call to
 gimple_range_ssa_names.

When the original patch was applied, I missed a spot which could
also be rewritten to use gimple_range_ssa_names.

	* tree-ssa-threadbackward.cc
	  (back_threader::find_paths_to_names): Replace sequence with
	  a call to gimple_range_ssa_names.
---
 gcc/tree-ssa-threadbackward.cc | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/gcc/tree-ssa-threadbackward.cc b/gcc/tree-ssa-threadbackward.cc
index 9725f50e639..2a8cfa3ee01 100644
--- a/gcc/tree-ssa-threadbackward.cc
+++ b/gcc/tree-ssa-threadbackward.cc
@@ -435,28 +435,14 @@ back_threader::find_paths_to_names (basic_block bb, bitmap interesting,
 		}
 	      /* For other local defs process their uses, amending
 		 imports on the way.  */
-	      else if (gassign *ass = dyn_cast <gassign *> (def_stmt))
+	      else
 		{
 		  tree ssa[3];
-		  if (range_op_handler (ass))
-		    {
-		      ssa[0] = gimple_range_ssa_p (gimple_range_operand1 (ass));
-		      ssa[1] = gimple_range_ssa_p (gimple_range_operand2 (ass));
-		      ssa[2] = NULL_TREE;
-		    }
-		  else if (gimple_assign_rhs_code (ass) == COND_EXPR)
-		    {
-		      ssa[0] = gimple_range_ssa_p (gimple_assign_rhs1 (ass));
-		      ssa[1] = gimple_range_ssa_p (gimple_assign_rhs2 (ass));
-		      ssa[2] = gimple_range_ssa_p (gimple_assign_rhs3 (ass));
-		    }
-		  else
-		    continue;
-		  for (unsigned j = 0; j < 3; ++j)
+		  unsigned lim = gimple_range_ssa_names (ssa, 3, def_stmt);
+		  for (unsigned j = 0; j < lim; ++j)
 		    {
 		      tree rhs = ssa[j];
 		      if (rhs
-			  && TREE_CODE (rhs) == SSA_NAME
 			  && bitmap_set_bit (m_imports,
 					     SSA_NAME_VERSION (rhs)))
 			{
-- 
2.37.3


  reply	other threads:[~2022-09-22 18:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 18:49 [PATCH 00/17] Move builtin functions to range-ops Andrew MacLeod
2022-09-22 18:53 ` Andrew MacLeod [this message]
2022-09-22 18:55 ` [PATCH 02/17] Adjust range_op_handler to store the handler directly Andrew MacLeod
2022-09-22 18:56 ` [PATCH 03/17] Create gimple_range_op_handler in a new source file Andrew MacLeod
2022-09-22 18:58 ` [PATCH 04/17] Fix calc_op1 for undefined op2_range Andrew MacLeod
2022-09-22 18:59 ` [PATCH 05/17] Add missing float fold_range prototype for floats Andrew MacLeod
2022-09-22 19:00 ` [PATCH 06/17] Always check the return value of fold_range Andrew MacLeod
2022-09-22 19:01 ` [PATCH 07/17] Add range-ops support for builtin functions Andrew MacLeod
2022-09-22 19:02 ` [PATCH 08/17] Convert CFN_BUILT_IN_SIGNBIT to range-ops Andrew MacLeod
2022-09-22 19:05 ` [PATCH 09/17] Convert CFN_BUILT_IN_TOUPPER and TOLOWER " Andrew MacLeod
2022-09-22 19:05 ` [PATCH 10/17] Convert CFN_BUILT_FFS and CFN_POPCOUNT " Andrew MacLeod
2022-09-22 19:05 ` [PATCH 11/17] Convert CFN_CLZ builtins " Andrew MacLeod
2022-09-22 19:05 ` [PATCH 12/17] Convert CFN_CTZ " Andrew MacLeod
2022-09-22 19:06 ` [PATCH 13/17] Convert CFN_BUILT_IN_CLRSB " Andrew MacLeod
2022-09-22 19:06 ` [PATCH 14/17] Convert CFN_BUILT_IN_UBSAN_CHECK_* " Andrew MacLeod
2022-09-22 19:08 ` [PATCH 15/17] Convert CFN_BUILT_IN_STRLEN " Andrew MacLeod
2022-09-22 19:10 ` [PATCH 16/17] Convert CFN_BUILT_IN_GOACC_DIM_* " Andrew MacLeod
2022-09-22 19:10 ` [PATCH 17/17] Convert CFN_BUILT_IN_PARITY " Andrew MacLeod

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b17227f0-cdcf-f25b-58fb-4ad2751ff772@redhat.com \
    --to=amacleod@redhat.com \
    --cc=aldyh@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).