On Fri, Jun 23, 2017 at 12:32 PM, Jakub Jelinek <ja...@redhat.com> wrote: > On Fri, Jun 23, 2017 at 12:24:25PM +0200, Richard Biener wrote: >> > void >> > set_nonzero_bits (tree name, const wide_int_ref &mask) >> > { >> > gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name))); >> > if (SSA_NAME_RANGE_INFO (name) == NULL) >> > set_range_info (name, VR_RANGE, >> > TYPE_MIN_VALUE (TREE_TYPE (name)), >> > TYPE_MAX_VALUE (TREE_TYPE (name))); >> > range_info_def *ri = SSA_NAME_RANGE_INFO (name); >> > ri->set_nonzero_bits (mask); >> > } >> > >> > Let me know how you'd like me to proceed. >> >> Just factor out a set_range_info_raw and call that then from here. > > And don't call it if the mask is all ones. Perhaps set_range_info > and set_nonzero_bits even should ggc_free and clear earlier range_info_def > if the range is all values and nonzero bit mask is all ones. > Or do we share range_info_def between multiple SSA_NAMEs? If yes, of course > we shouldn't use ggc_free.
We shouldn't as we don't copy on change. We do for points-to but only for the bitmap pointer IIRC. Richard, > > Jakub