aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2014-08-28 08:03:18 +0000
committerBin Cheng <amker@gcc.gnu.org>2014-08-28 08:03:18 +0000
commitf22ae1ecbd724ed01423a2132b5631a5d7c0ee10 (patch)
tree692cb565a3a538c3d3b45e817d9e2960ac0e708a /gcc
parent8a2d2bf000248f89ec12f286cc673fbb279a45b9 (diff)
downloadgcc-f22ae1ecbd724ed01423a2132b5631a5d7c0ee10.zip
gcc-f22ae1ecbd724ed01423a2132b5631a5d7c0ee10.tar.gz
gcc-f22ae1ecbd724ed01423a2132b5631a5d7c0ee10.tar.bz2
tree-ssa-loop-ivopts.c (iv_ca_add_use): Delete parameter important_candidates.
* tree-ssa-loop-ivopts.c (iv_ca_add_use): Delete parameter important_candidates. Consider all important candidates if IVS doesn't give any result. Remove check on ivs->upto. (try_add_cand_for): Call iv_ca_add_use only once. From-SVN: r214674
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-ssa-loop-ivopts.c45
2 files changed, 27 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 10fa23b..28a3219 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2014-08-28 Bin Cheng <bin.cheng@arm.com>
+
+ * tree-ssa-loop-ivopts.c (iv_ca_add_use): Delete parameter
+ important_candidates. Consider all important candidates if
+ IVS doesn't give any result. Remove check on ivs->upto.
+ (try_add_cand_for): Call iv_ca_add_use only once.
+
2014-08-28 Alexander Ivchenko <alexander.ivchenko@intel.com>
Maxim Kuznetsov <maxim.kuznetsov@intel.com>
Anna Tikhonova <anna.tikhonova@intel.com>
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 8f5ecbc..e1ab00c 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -5415,36 +5415,40 @@ iv_ca_set_cp (struct ivopts_data *data, struct iv_ca *ivs,
}
/* Extend set IVS by expressing USE by some of the candidates in it
- if possible. All important candidates will be considered
- if IMPORTANT_CANDIDATES is true. */
+ if possible. Consider all important candidates if candidates in
+ set IVS don't give any result. */
static void
iv_ca_add_use (struct ivopts_data *data, struct iv_ca *ivs,
- struct iv_use *use, bool important_candidates)
+ struct iv_use *use)
{
struct cost_pair *best_cp = NULL, *cp;
bitmap_iterator bi;
- bitmap cands;
unsigned i;
+ struct iv_cand *cand;
gcc_assert (ivs->upto >= use->id);
+ ivs->upto++;
+ ivs->bad_uses++;
- if (ivs->upto == use->id)
- {
- ivs->upto++;
- ivs->bad_uses++;
- }
-
- cands = (important_candidates ? data->important_candidates : ivs->cands);
- EXECUTE_IF_SET_IN_BITMAP (cands, 0, i, bi)
+ EXECUTE_IF_SET_IN_BITMAP (ivs->cands, 0, i, bi)
{
- struct iv_cand *cand = iv_cand (data, i);
-
+ cand = iv_cand (data, i);
cp = get_use_iv_cost (data, use, cand);
-
if (cheaper_cost_pair (cp, best_cp))
best_cp = cp;
}
+
+ if (best_cp == NULL)
+ {
+ EXECUTE_IF_SET_IN_BITMAP (data->important_candidates, 0, i, bi)
+ {
+ cand = iv_cand (data, i);
+ cp = get_use_iv_cost (data, use, cand);
+ if (cheaper_cost_pair (cp, best_cp))
+ best_cp = cp;
+ }
+ }
iv_ca_set_cp (data, ivs, use, best_cp);
}
@@ -5878,18 +5882,9 @@ try_add_cand_for (struct ivopts_data *data, struct iv_ca *ivs,
struct iv_ca_delta *best_delta = NULL, *act_delta;
struct cost_pair *cp;
- iv_ca_add_use (data, ivs, use, false);
+ iv_ca_add_use (data, ivs, use);
best_cost = iv_ca_cost (ivs);
-
cp = iv_ca_cand_for_use (ivs, use);
- if (!cp)
- {
- ivs->upto--;
- ivs->bad_uses--;
- iv_ca_add_use (data, ivs, use, true);
- best_cost = iv_ca_cost (ivs);
- cp = iv_ca_cand_for_use (ivs, use);
- }
if (cp)
{
best_delta = iv_ca_delta_add (use, NULL, cp, NULL);