comparison gcc/tree-ssa-loop-prefetch.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Array prefetching. 1 /* Array prefetching.
2 Copyright (C) 2005-2017 Free Software Foundation, Inc. 2 Copyright (C) 2005-2018 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it 6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the 7 under the terms of the GNU General Public License as published by the
990 /* Returns true if we should issue prefetch for REF. */ 990 /* Returns true if we should issue prefetch for REF. */
991 991
992 static bool 992 static bool
993 should_issue_prefetch_p (struct mem_ref *ref) 993 should_issue_prefetch_p (struct mem_ref *ref)
994 { 994 {
995 /* Do we want to issue prefetches for non-constant strides? */
996 if (!cst_and_fits_in_hwi (ref->group->step) && PREFETCH_DYNAMIC_STRIDES == 0)
997 {
998 if (dump_file && (dump_flags & TDF_DETAILS))
999 fprintf (dump_file,
1000 "Skipping non-constant step for reference %u:%u\n",
1001 ref->group->uid, ref->uid);
1002 return false;
1003 }
1004
1005 /* Some processors may have a hardware prefetcher that may conflict with
1006 prefetch hints for a range of strides. Make sure we don't issue
1007 prefetches for such cases if the stride is within this particular
1008 range. */
1009 if (cst_and_fits_in_hwi (ref->group->step)
1010 && abs_hwi (int_cst_value (ref->group->step))
1011 < (HOST_WIDE_INT) PREFETCH_MINIMUM_STRIDE)
1012 {
1013 if (dump_file && (dump_flags & TDF_DETAILS))
1014 fprintf (dump_file,
1015 "Step for reference %u:%u (" HOST_WIDE_INT_PRINT_DEC
1016 ") is less than the mininum required stride of %d\n",
1017 ref->group->uid, ref->uid, int_cst_value (ref->group->step),
1018 PREFETCH_MINIMUM_STRIDE);
1019 return false;
1020 }
1021
995 /* For now do not issue prefetches for only first few of the 1022 /* For now do not issue prefetches for only first few of the
996 iterations. */ 1023 iterations. */
997 if (ref->prefetch_before != PREFETCH_ALL) 1024 if (ref->prefetch_before != PREFETCH_ALL)
998 { 1025 {
999 if (dump_file && (dump_flags & TDF_DETAILS)) 1026 if (dump_file && (dump_flags & TDF_DETAILS))