aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-ivopts.c
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2013-12-11 00:58:35 +0000
committerBin Cheng <amker@gcc.gnu.org>2013-12-11 00:58:35 +0000
commitba8267926cfcaddc979ba021882ba2ff2f50003d (patch)
tree236c3dba6a88690d334b7d85fcc3c68956a01890 /gcc/tree-ssa-loop-ivopts.c
parent748a18534a1e52304770795890c932045312896a (diff)
downloadgcc-ba8267926cfcaddc979ba021882ba2ff2f50003d.zip
gcc-ba8267926cfcaddc979ba021882ba2ff2f50003d.tar.gz
gcc-ba8267926cfcaddc979ba021882ba2ff2f50003d.tar.bz2
revert: re PR tree-optimization/41488 (IVOpts cannot coalesce multiple induction variables)
Reverted: 2013-12-10 Bin Cheng <bin.cheng@arm.com> PR tree-optimization/41488 * tree-ssa-loop-ivopts.c (add_old_iv_candidates): Don't add cand for PEELED_CHREC kind IV. * tree-scalar-evolution.c: Include necessary header files. (peeled_chrec_map, simplify_peeled_chrec): New. (analyze_evolution_in_loop): New static variable. Call simplify_peeled_chrec. (scev_initialize): Initialize peeled_chrec_map. (scev_reset, scev_finalize): Reset and release peeled_chrec_map. Reverted: 2013-12-10 Bin Cheng <bin.cheng@arm.com> PR tree-optimization/41488 * gcc.dg/tree-ssa/scev-7.c: New test. * gcc.dg/pr41488.c: New test. From-SVN: r205880
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r--gcc/tree-ssa-loop-ivopts.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 8d2dfc5..fb3ceb9 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -2526,19 +2526,11 @@ add_old_iv_candidates (struct ivopts_data *data, struct iv *iv)
/* Additionally record the possibility of leaving the original iv
untouched. */
def = PHI_ARG_DEF_FROM_EDGE (phi, loop_latch_edge (data->current_loop));
- /* Don't add candidate if it's from another PHI node because
- it's an affine iv appearing in the form of PEELED_CHREC. */
- phi = SSA_NAME_DEF_STMT (def);
- if (gimple_code (phi) != GIMPLE_PHI)
- {
- cand = add_candidate_1 (data,
- iv->base, iv->step, true, IP_ORIGINAL, NULL,
- SSA_NAME_DEF_STMT (def));
- cand->var_before = iv->ssa_name;
- cand->var_after = def;
- }
- else
- gcc_assert (gimple_bb (phi) == data->current_loop->header);
+ cand = add_candidate_1 (data,
+ iv->base, iv->step, true, IP_ORIGINAL, NULL,
+ SSA_NAME_DEF_STMT (def));
+ cand->var_before = iv->ssa_name;
+ cand->var_after = def;
}
}