[RFC] Extend ipa-bitwise-cp with pointer alignment propagation

Martin Jambor mjambor@suse.cz
Wed Oct 5 14:16:00 GMT 2016


Hi,

sorry, my main desktop disk has died (a slow but certain) death so I
am not particularly responsive either.

On Tue, Oct 04, 2016 at 12:37:38AM +0530, Prathamesh Kulkarni wrote:
> On 22 September 2016 at 17:26, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Yes, can you please verify that alignments it computes are monotonously
> > worse than those your new code computes and include the removal in the
> > next iteration of the patch?
> >>
> > Otherwise the patch seems fine to me (modulo Richard's comments)


> I tried to verify the alignments are monotonously worse with the
> attached patch (verify.diff),
> which asserts that alignment lattice is not better than bits lattice
> during each propagation
> step in propagate_constants_accross_call().
> Does that look OK ?

After propagation, here should be no TOP lattices anywhere.  That
would mean we have not delteted an unreachable node.  Apart from that,
yes.

> 
> ipa-cp-alignment has better alignments than ipa-bit-cp in following cases:
> 
> a) ipa_get_type() returns NULL: ipa-bits-cp sets lattice to bottom if
> ipa_get_type (param) returns NULL,
> for instance in case of K&R function, while ipa-cp-alignment doesn't

What do you mean by "for instance?"  What are the other cases when it
happens?

> look at param types,
> and can propagate alignments.
> The following assert:
> if (bits_lattice.bottom_p ())
>   gcc_assert (align_lattice.bottom_p())
> 
> triggered for 400.perlbench, 403.gcc, 456.hmmer and 481.wrf due to

that is quite many more examples than I have anticipated, so they all
used K&R?   (But thanks for trying benchmarks diligently).

Have also tried this with LTO?

> ipa_get_type()
> returning NULL. I am not really sure how to handle this case, since we
> need to know parameter's
> type during bits propagation for obtaining precision.
> 
> b) This happens for attached test-case (test.i),
> which is a reduced (and slightly modified) test-case from 458.sjeng.
> Bits propagation sets lattice to bottom, while alignment propagation
> propagates <align 1, misalign 0>.

yes, I agree we do not need to worry about the case when alignment is 1.

I am only slightly concerned how often ipa_get_type is NULL, so it
would be nice if you looked into those cases once more to make sure
that we do not miss some bug or something that we could handle easily.
But if it is only K&R, I think it is fine.

Thanks,

Martin



More information about the Gcc-patches mailing list