public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* wide-int, ipa
@ 2013-11-23 19:24 Mike Stump
  2014-01-02  4:12 ` Mike Stump
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Stump @ 2013-11-23 19:24 UTC (permalink / raw)
  To: gcc-patches@gcc.gnu.org Patches; +Cc: Kenneth Zadeck

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

Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch.    This patch covers the ipa code.

Ok?


[-- Attachment #2: wide-int-ipa.diffs.txt --]
[-- Type: text/plain, Size: 2094 bytes --]

	* ipa-devirt.c
	(get_polymorphic_call_info): Use wide-int interfaces.
	* ipa-prop.c
	(compute_complex_assign_jump_func): Use wide-int interfaces.
	(get_ancestor_addr_info): Likewise.
	(ipa_modify_call_arguments): Likewise.


diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 38cf378..41e5300 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -968,7 +968,7 @@ get_polymorphic_call_info (tree fndecl,
 		{
 		  base_pointer = TREE_OPERAND (base, 0);
 		  context->offset
-		     += offset2 + mem_ref_offset (base).low * BITS_PER_UNIT;
+		    += offset2 + mem_ref_offset (base).ulow () * BITS_PER_UNIT;
 		  context->outer_type = NULL;
 		}
 	      /* We found base object.  In this case the outer_type
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index d122dd5..3953442 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -1063,7 +1063,7 @@ compute_complex_assign_jump_func (struct ipa_node_params *info,
       || max_size == -1
       || max_size != size)
     return;
-  offset += mem_ref_offset (base).low * BITS_PER_UNIT;
+  offset += mem_ref_offset (base).to_short_addr () * BITS_PER_UNIT;
   ssa = TREE_OPERAND (base, 0);
   if (TREE_CODE (ssa) != SSA_NAME
       || !SSA_NAME_IS_DEFAULT_DEF (ssa)
@@ -1122,7 +1122,7 @@ get_ancestor_addr_info (gimple assign, tree *obj_p, HOST_WIDE_INT *offset)
       || TREE_CODE (SSA_NAME_VAR (parm)) != PARM_DECL)
     return NULL_TREE;
 
-  *offset += mem_ref_offset (expr).low * BITS_PER_UNIT;
+  *offset += mem_ref_offset (expr).to_short_addr () * BITS_PER_UNIT;
   *obj_p = obj;
   return expr;
 }
@@ -3661,9 +3661,8 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
 		  if (TYPE_ALIGN (type) > align)
 		    align = TYPE_ALIGN (type);
 		}
-	      misalign += (tree_to_double_int (off)
-			   .sext (TYPE_PRECISION (TREE_TYPE (off))).low
-			   * BITS_PER_UNIT);
+	      misalign += (offset_int::from (off, SIGNED)
+			   * BITS_PER_UNIT).to_short_addr ();
 	      misalign = misalign & (align - 1);
 	      if (misalign != 0)
 		align = (misalign & -misalign);

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

* Re: wide-int, ipa
  2013-11-23 19:24 wide-int, ipa Mike Stump
@ 2014-01-02  4:12 ` Mike Stump
  2014-01-09 15:20   ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Stump @ 2014-01-02  4:12 UTC (permalink / raw)
  To: gcc-patches@gcc.gnu.org Patches; +Cc: Kenneth Zadeck, Mike Stump

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

On Nov 23, 2013, at 11:22 AM, Mike Stump <mikestump@comcast.net> wrote:
> Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch.    This patch covers the ipa code.
> 
> Ok?

Ping?

I promise, this patch isn't frightening.  Small, easy to read and understand, doesn't require an ipa expert.



[-- Attachment #2: wide-int-ipa.diffs.txt --]
[-- Type: text/plain, Size: 2094 bytes --]

	* ipa-devirt.c
	(get_polymorphic_call_info): Use wide-int interfaces.
	* ipa-prop.c
	(compute_complex_assign_jump_func): Use wide-int interfaces.
	(get_ancestor_addr_info): Likewise.
	(ipa_modify_call_arguments): Likewise.


diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 38cf378..41e5300 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -968,7 +968,7 @@ get_polymorphic_call_info (tree fndecl,
 		{
 		  base_pointer = TREE_OPERAND (base, 0);
 		  context->offset
-		     += offset2 + mem_ref_offset (base).low * BITS_PER_UNIT;
+		    += offset2 + mem_ref_offset (base).ulow () * BITS_PER_UNIT;
 		  context->outer_type = NULL;
 		}
 	      /* We found base object.  In this case the outer_type
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index d122dd5..3953442 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -1063,7 +1063,7 @@ compute_complex_assign_jump_func (struct ipa_node_params *info,
       || max_size == -1
       || max_size != size)
     return;
-  offset += mem_ref_offset (base).low * BITS_PER_UNIT;
+  offset += mem_ref_offset (base).to_short_addr () * BITS_PER_UNIT;
   ssa = TREE_OPERAND (base, 0);
   if (TREE_CODE (ssa) != SSA_NAME
       || !SSA_NAME_IS_DEFAULT_DEF (ssa)
@@ -1122,7 +1122,7 @@ get_ancestor_addr_info (gimple assign, tree *obj_p, HOST_WIDE_INT *offset)
       || TREE_CODE (SSA_NAME_VAR (parm)) != PARM_DECL)
     return NULL_TREE;
 
-  *offset += mem_ref_offset (expr).low * BITS_PER_UNIT;
+  *offset += mem_ref_offset (expr).to_short_addr () * BITS_PER_UNIT;
   *obj_p = obj;
   return expr;
 }
@@ -3661,9 +3661,8 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
 		  if (TYPE_ALIGN (type) > align)
 		    align = TYPE_ALIGN (type);
 		}
-	      misalign += (tree_to_double_int (off)
-			   .sext (TYPE_PRECISION (TREE_TYPE (off))).low
-			   * BITS_PER_UNIT);
+	      misalign += (offset_int::from (off, SIGNED)
+			   * BITS_PER_UNIT).to_short_addr ();
 	      misalign = misalign & (align - 1);
 	      if (misalign != 0)
 		align = (misalign & -misalign);

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

* Re: wide-int, ipa
  2014-01-02  4:12 ` Mike Stump
@ 2014-01-09 15:20   ` Richard Biener
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2014-01-09 15:20 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc-patches@gcc.gnu.org Patches, Kenneth Zadeck

On Thu, Jan 2, 2014 at 5:12 AM, Mike Stump <mikestump@comcast.net> wrote:
> On Nov 23, 2013, at 11:22 AM, Mike Stump <mikestump@comcast.net> wrote:
>> Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch.    This patch covers the ipa code.
>>
>> Ok?
>
> Ping?
>
> I promise, this patch isn't frightening.  Small, easy to read and understand, doesn't require an ipa expert.

Why

@@ -968,7 +968,7 @@ get_polymorphic_call_info (tree fndecl,
                {
                  base_pointer = TREE_OPERAND (base, 0);
                  context->offset
-                    += offset2 + mem_ref_offset (base).low * BITS_PER_UNIT;
+                   += offset2 + mem_ref_offset (base).ulow () * BITS_PER_UNIT;
                  context->outer_type = NULL;
                }
              /* We found base object.  In this case the outer_type

but then

@@ -1063,7 +1063,7 @@ compute_complex_assign_jump_func (struct
ipa_node_params *info,
       || max_size == -1
       || max_size != size)
     return;
-  offset += mem_ref_offset (base).low * BITS_PER_UNIT;
+  offset += mem_ref_offset (base).to_short_addr () * BITS_PER_UNIT;
   ssa = TREE_OPERAND (base, 0);
   if (TREE_CODE (ssa) != SSA_NAME
       || !SSA_NAME_IS_DEFAULT_DEF (ssa)

?  I think it should be to_short_addr () in the first case as well.

Ok with that change.

Richard.

>

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

end of thread, other threads:[~2014-01-09 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-23 19:24 wide-int, ipa Mike Stump
2014-01-02  4:12 ` Mike Stump
2014-01-09 15:20   ` 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).