This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: #SW2600
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Stan Cox <scox at redhat dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Fri, 16 May 2008 12:36:06 -0400
- Subject: Re: #SW2600
- References: <1210953714.20107.64.camel@multics.rdu.redhat.com>
Stan Cox <scox@redhat.com> writes:
> Here is a proposed patch for the array index piece of #SW2600[..]
> optimize away assignments in other contexts). For example: arr2[i = 1]
> = 10 can potentially become arr2[1] = 10
Great. Two more bits:
> @@ -1714,6 +1716,8 @@ dead_assignment_remover::visit_assignment (assignment* e)
> *current_expr == e && // we're not nested any deeper than expected
> leftvar) // not unresolved $target; intended sideeffect cannot be elided
> {
> + e->left->visit (this);
> + e->right->visit (this);
Should current_expr be set/reset around these calls?
> +void
> +dead_assignment_remover::visit_arrayindex (arrayindex *e)
> [...]
And a sibling function for visit_functioncall() would be nice, to
potentially elide assignments that occur within parameter lists; then
something similar with if's and while's, and maybe
unary/binary_expressions. That should do it all.
Nice job with the test case!
- FChE