Fix caching of tests for multiple variant runs and update existing target-supports tests.

Currently some target supports checks such as vect_int cache their
results in a manner that would cause them not to be rechecked when
running the same tests against a different variant in a multi variant
run.  This causes tests to be skipped or run when they shouldn't be.

there is already an existing caching mechanism in place that does the
caching correctly, but presumably these weren't used because some of these
tests originally only contained static data. e.g. only checked if the target is
aarch64*-*-* etc.

This patch changes every function that needs to do any caching at all to use
check_cached_effective_target which will cache per variant instead of globally.

For those tests that already parameterize over et_index I have created
check_cached_effective_target_indexed to handle this common case by creating a list
containing the property name and the current value of et_index.

These changes result in a much simpler implementation for most tests and a large
reduction in lines for target-supports.exp.

Regtested on
  aarch64-none-elf
  x86_64-pc-linux-gnu
  powerpc64-unknown-linux-gnu
  arm-none-eabi

and no testsuite errors. Difference would depend on your site.exp.
On arm we get about 4500 new testcases and on aarch64 the low 10s.
On PowerPC and x86_64 no changes as expected since the default exp for these
just test the default configuration.

What this means for new target checks is that they should always use either
check_cached_effective_target or check_cached_effective_target_indexed if the
result of the check is to be cached.

As an example the new vect_int looks like

proc check_effective_target_vect_int { } {
    return [check_cached_effective_target_indexed <name> {
      expr {
         <condition>
	}}]
}

The debug information that was once there is now all hidden in
check_cached_effective_target, (called from check_cached_effective_target_indexed)
and so the only thing you are required to do is give it a unique cache name and a condition.

The condition doesn't need to be an if statement so simple boolean expressions are enough here:

         [istarget i?86-*-*] || [istarget x86_64-*-*]
         || ([istarget powerpc*-*-*]
	     && ![istarget powerpc-*-linux*paired*])
         || ...

From-SVN: r264745
This commit is contained in:
Tamar Christina 2018-10-01 12:34:05 +00:00 committed by Tamar Christina
parent 03cc70b5f1
commit 041bfa6f07
2 changed files with 420 additions and 1278 deletions

View File

@ -1,3 +1,90 @@
2018-10-01 Tamar Christina <tamar.christina@arm.com>
* lib/target-supports.exp (check_cached_effective_target_indexed): New.
(check_cached_effective_target, clear_effective_target_cache): Cleanup.
(check_compile): Support values already Boolean.
(check_alias_available, check_gc_sections_available,
check_profiling_available, check_effective_target_vect_cmdline_needed,
check_effective_target_vect_int,
check_effective_target_vect_intfloat_cvt,
check_effective_target_vect_doubleint_cvt,
check_effective_target_vect_intdouble_cvt,
check_effective_target_vect_uintfloat_cvt,
check_effective_target_vect_floatint_cvt,
check_effective_target_vect_floatuint_cvt,
check_effective_target_vect_peeling_profitable,
check_effective_target_vect_simd_clones,
check_effective_target_vect_peeling_profitable,
check_effective_target_vect_simd_clones,
check_effective_target_vect_shift,
check_effective_target_vect_bswap,
check_effective_target_vect_shift_char,
check_effective_target_vect_float,
check_effective_target_vect_double,
check_effective_target_vect_long_long,
check_effective_target_vect_no_int_min_max,
check_effective_target_vect_no_int_add,
check_effective_target_vect_no_bitwise,
check_effective_target_vect_perm,
check_effective_target_vect_perm_byte,
check_effective_target_vect_perm_short,
check_effective_target_xorsign,
check_effective_target_vect_widen_sum_hi_to_si_pattern,
check_effective_target_vect_widen_sum_hi_to_si,
check_effective_target_vect_widen_sum_qi_to_hi,
check_effective_target_vect_widen_sum_qi_to_si,
check_effective_target_vect_widen_mult_qi_to_hi,
check_effective_target_vect_widen_mult_hi_to_si,
check_effective_target_vect_widen_mult_qi_to_hi_pattern,
check_effective_target_vect_widen_mult_hi_to_si_pattern,
check_effective_target_vect_widen_mult_si_to_di_pattern,
check_effective_target_vect_widen_shift,
check_effective_target_vect_sdot_qi,
check_effective_target_vect_udot_qi,
check_effective_target_vect_sdot_hi,
check_effective_target_vect_udot_hi,
check_effective_target_vect_usad_char,
check_effective_target_vect_pack_trunc,
check_effective_target_vect_unpack,
check_effective_target_unaligned_stack,
check_effective_target_vect_no_align,
check_effective_target_vect_hw_misalign,
check_effective_target_natural_alignment_32,
check_effective_target_natural_alignment_64,
check_effective_target_vect_element_align,
check_effective_target_vect_load_lanes **,
check_effective_target_vect_condition,
check_effective_target_vect_cond_mixed,
check_effective_target_vect_char_mult,
check_effective_target_vect_short_mult,
check_effective_target_vect_int_mult,
check_effective_target_vect_extract_even_odd,
check_effective_target_vect_interleave,
check_effective_target_vect_stridedN,
check_effective_target_vect_call_copysignf,
check_effective_target_sqrt_insn,
check_effective_target_vect_call_sqrtf,
check_effective_target_vect_call_btrunc,
check_effective_target_vect_call_btruncf,
check_effective_target_vect_call_ceil,
check_effective_target_vect_call_ceilf,
check_effective_target_vect_call_floor,
check_effective_target_vect_call_floorf,
check_effective_target_vect_call_lceil,
check_effective_target_vect_call_lfloor,
check_effective_target_vect_call_nearbyint,
check_effective_target_vect_call_nearbyintf,
check_effective_target_vect_call_round,
check_effective_target_vect_call_roundf,
check_effective_target_section_anchors,
check_effective_target_bswap,
check_effective_target_sync_int_long,
check_effective_target_sync_char_short,
check_effective_target_tiny,
check_effective_target_pie_copyreloc,
check_effective_target_got32x_reloc,
check_effective_target_tls_get_addr_via_got): Use new caching.
2018-10-01 MCC CS <deswurstes@users.noreply.github.com>
PR tree-optimization/87261

File diff suppressed because it is too large Load Diff