This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Use poly_int tree accessors
- From: Jeff Law <law at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, richard dot sandiford at linaro dot org
- Date: Mon, 30 Apr 2018 10:47:25 -0600
- Subject: Re: Use poly_int tree accessors
- Autocrypt: addr=law at redhat dot com; prefer-encrypt=mutual; keydata= xsBNBFkbIO8BCACVIqDhDVh9ur8C+zNV1J/cXfwvVDAUcphDEFl4jyHqZORK4Pd3Db8oWqLm Q8lOCr/VOS7lrCtdpVMQkLGOGA16oJ8g7hzhnojpjY09UjsoUiG7oKacuxj8skfp6SIx93Zl +iNYPRa4S+za6nY8qiVjyUuiyX04ZPZMrKp2c2sGi+HnBKUZXGhrz/Jdzdox3tjajWZnObyy nhEN6hn9L3KawTtGPE/R6A/1RhHTD9FQmIWIeucpaY5c6GNKXTFpj2VYx57LY5hve1R5vhrJ IZcgwZAiOtmik5lVi96glY5h6bugRwpexjhwORTLPBCkwiYotSxX99mWd6EHL576i5CNABEB AAHNGUplZmYgTGF3IDxsYXdAcmVkaGF0LmNvbT7CwI4EEwEIADgWIQR+niGjtnP5P/8PpRq8 fP682pgzWwUCWRsg7wIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRC8fP682pgzW5QG B/9VATJmx5235RB+8jiDYGXQf3vd9gBfPy/l1tsaK400eFAevDzfGvKmeCKe+uGnlrH3vyT8 rg9zqH+s5a1Y+lDXPOpJAFmmzbOLU4FW4ucbawmtYvBL65PqpQneCTYnC802/OAcxjm/Onem HlgeK6WicNsBTPwYN/0araDFUejyYBIFi9CNqqflwk5Z3brKbQ9bAYIkysVLC/c3njKPmM0c WPFHG91ubLbWCHwTIK0+mAL714eTD74dXzOjO2ZDBPLGlFN/kO3+YjaO6UOD2O8acvAMCivT kWLr7JwRgLIQDN2DkhQDd3LTPqQE/yOcMcXBTO+fxm8KG0iKQBqWMyGJzsBNBFkbIO8BCACy qbOsv7XegSeea8XORt5zMaBVWKoSyhmmcCmlxZFS2cuYOBt79MO13lZE2DlO3Lv5IKikj/D4 ketGVO4+h5psEMH5Yz5P8bx0TmgwbK1GxPZrzeXozUFJDvvCDbIlT0v0pwUXuK3hg8Ieo2h5 uTed/cn1OjySXW5BqLxN0cyr5hL+J6dcsHvKLT/N3nTgCQhoJXK2MrEMhAGgF3jKpMn3CoS4 i/ZbNI2MQR6LWHwdZ95f0fI8NzHSfVzeLtzCKQec7nr9fgd6Ylk1ZpGWQUPlQmKjzYgeCeTK NO04cwt20WIrQWeWiZFPA0U86NDBdSBrYp4kG3dfIXE+wSSvE7qPABEBAAHCwHYEGAEIACAW IQR+niGjtnP5P/8PpRq8fP682pgzWwUCWRsg7wIbDAAKCRC8fP682pgzW3REB/9cT7iKRPg/ OK9bpLlllIEDM90IaKC79DQrv+fRudOR78cdV4XUwPSFnyHUsP3VJ4lDy5FhiKCwGie0BK53 EsxgMrLy1L8hboFdTE4Vi0xzCheMaMVp4hATDU29k1cuxu1VPpCa8E3mYeHjNV7ip0HN5L4D rfs8lRPJE/oM1vGs9DgQFZrCPPNRNGKC97BH+DHccesEJr7tSsQrkPkt0z/FTKr5wIM02vSx OJjgmcVbGB7dc2j/Sx8loXmuKnuKtM35668kUG8jeJvSQk3o/VHpD27bhl0rR68R2jN6G6kQ egMVb6dPu1Ius8rBE5rFw88J4JEb5q4hMNClWWUFHIdP
- Openpgp: preference=signencrypt
- References: <87r2qyc1ww.fsf@linaro.org>
On 01/09/2018 11:39 AM, Richard Sandiford wrote:
> This patch generalises various places that used hwi tree accessors
> so that they can handle poly_ints instead. Earlier patches did
> this while updating interfaces; this patch just mops up some
> left-over pieces that weren't necessary to make things compile,
> but that still make sense.
>
> In many cases these changes are by inspection rather than because
> something had shown them to be necessary.
>
> I think the alias.c part is a minor bug fix: previously we used
> fits_uhwi_p for a signed HOST_WIDE_INT (which the caller does
> treat as signed rather than unsigned). We also checked whether
> each individual offset overflowed but didn't check whether the
> sum did.
>
> Sorry for not posting this earlier. I kept holding it back in case
> more examples showed up.
>
> Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu.
> Also tested by comparing the before-and-after assembly output for at
> least one target per CPU directory. OK to install?
>
> Richard
>
>
> 2018-01-09 Richard Sandiford <richard.sandiford@linaro.org>
>
> gcc/
> * alias.c (adjust_offset_for_component_ref): Use poly_int_tree_p
> and wi::to_poly_offset. Add the current offset and then check
> whether the sum fits, rather than using an unchecked addition of
> a checked term. Check for a shwi rather than a uhwi.
> * expr.c (get_bit_range): Use tree_to_poly_uint64.
> (store_constructor): Use poly_int_tree_p.
> (expand_expr_real_1): Likewise.
> * function.c (assign_temp): Likewise.
> * fold-const.c (const_binop): Use poly_int_tree_p and
> wi::to_poly_offset.
> (fold_indirect_ref_1): Likewise. Use known_in_range_p to test
> for an in-range vector access and multiple_p to attempt an exact
> division.
> * gimplify.c (gimple_add_tmp_var_fn): Use tree_fits_poly_uint64_p.
> (gimple_add_tmp_var): Likewise.
> * ipa-icf-gimple.c (func_checker::compare_operand): Use
> to_poly_offset for MEM offsets.
> * ipa-icf.c (sem_variable::equals): Likewise.
> * stor-layout.c (compute_record_mode): Use poly_int_tree_p.
> * tree-vectorizer.c (get_vec_alignment_for_array_type): Likewise.
> * tree-predcom.c (aff_combination_dr_offset): Use wi::to_poly_widest
> rather than wi::to_widest for DR_INITs.
> * tree-ssa-sccvn.c (ao_ref_init_from_vn_reference): Use
> wi::to_poly_offset for BIT_FIELD_REF offsets.
> (vn_reference_maybe_forwprop_address): Use poly_int_tree_p and
> wi::to_poly_offset.
> * tree-vect-data-refs.c (vect_find_same_alignment_drs): Use
> wi::to_poly_offset for DR_INIT.
> (vect_analyze_data_ref_accesses): Require both DR_INITs to be
> INTEGER_CSTs.
> (vect_analyze_group_access_1): Note that here.
> * var-tracking.c (emit_note_insn_var_location): Use
> tree_to_poly_uint64.
OK. If minor edits are necessary to deal changes since this was
originally posted, consider those pre-approved.
Jeff