public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-2917] var-tracking: Add entry values up to max register mode
Date: Wed, 28 Sep 2022 15:29:22 +0000 (GMT)	[thread overview]
Message-ID: <20220928152922.B43A7385740F@sourceware.org> (raw)

https://gcc.gnu.org/g:5d7be27bf7ef63c770a591f69845c4245522cd76

commit r13-2917-g5d7be27bf7ef63c770a591f69845c4245522cd76
Author: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Date:   Wed Sep 28 17:27:11 2022 +0200

    var-tracking: Add entry values up to max register mode
    
    For parameter of type integer which do not consume a whole register
    (modulo sign/zero extension) this patch adds entry values up to maximal
    register mode.
    
    gcc/ChangeLog:
    
            * var-tracking.cc (vt_add_function_parameter): Add entry values
            up to maximal register mode.

Diff:
---
 gcc/var-tracking.cc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gcc/var-tracking.cc b/gcc/var-tracking.cc
index 235981d100f..9c40ec4fb8b 100644
--- a/gcc/var-tracking.cc
+++ b/gcc/var-tracking.cc
@@ -9906,6 +9906,23 @@ vt_add_function_parameter (tree parm)
 				     VAR_INIT_STATUS_INITIALIZED, NULL, INSERT);
 		}
 	    }
+
+	  if (GET_MODE_CLASS (mode) == MODE_INT)
+	    {
+	      machine_mode wider_mode_iter;
+	      FOR_EACH_WIDER_MODE (wider_mode_iter, mode)
+		{
+		  if (!HWI_COMPUTABLE_MODE_P (wider_mode_iter))
+		    break;
+		  rtx wider_reg
+		    = gen_rtx_REG (wider_mode_iter, REGNO (incoming));
+		  cselib_val *wider_val
+		    = cselib_lookup_from_insn (wider_reg, wider_mode_iter, 1,
+					       VOIDmode, get_insns ());
+		  preserve_value (wider_val);
+		  record_entry_value (wider_val, wider_reg);
+		}
+	    }
 	}
     }
   else if (GET_CODE (incoming) == PARALLEL && !dv_onepart_p (dv))

                 reply	other threads:[~2022-09-28 15:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220928152922.B43A7385740F@sourceware.org \
    --to=stefansf@gcc.gnu.org \
    --cc=gcc-cvs@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).