Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree-ssa-loop-unswitch.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
1 /* Loop unswitching. | 1 /* Loop unswitching. |
2 Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. | 2 Copyright (C) 2004, 2005, 2007, 2008 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 |
8 Free Software Foundation; either version 3, or (at your option) any | 8 Free Software Foundation; either version 3, or (at your option) any |
9 later version. | 9 later version. |
10 | 10 |
11 GCC is distributed in the hope that it will be useful, but WITHOUT | 11 GCC is distributed in the hope that it will be useful, but WITHOUT |
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
14 for more details. | 14 for more details. |
15 | 15 |
16 You should have received a copy of the GNU General Public License | 16 You should have received a copy of the GNU General Public License |
17 along with GCC; see the file COPYING3. If not see | 17 along with GCC; see the file COPYING3. If not see |
18 <http://www.gnu.org/licenses/>. */ | 18 <http://www.gnu.org/licenses/>. */ |
19 | 19 |
20 #include "config.h" | 20 #include "config.h" |
30 #include "diagnostic.h" | 30 #include "diagnostic.h" |
31 #include "tree-flow.h" | 31 #include "tree-flow.h" |
32 #include "tree-dump.h" | 32 #include "tree-dump.h" |
33 #include "timevar.h" | 33 #include "timevar.h" |
34 #include "cfgloop.h" | 34 #include "cfgloop.h" |
35 #include "domwalk.h" | |
36 #include "params.h" | 35 #include "params.h" |
37 #include "tree-pass.h" | 36 #include "tree-pass.h" |
38 #include "tree-inline.h" | 37 #include "tree-inline.h" |
39 | 38 |
40 /* This file implements the loop unswitching, i.e. transformation of loops like | 39 /* This file implements the loop unswitching, i.e. transformation of loops like |
215 return false; | 214 return false; |
216 } | 215 } |
217 | 216 |
218 i = 0; | 217 i = 0; |
219 bbs = get_loop_body (loop); | 218 bbs = get_loop_body (loop); |
220 | 219 |
221 while (1) | 220 while (1) |
222 { | 221 { |
223 /* Find a bb to unswitch on. */ | 222 /* Find a bb to unswitch on. */ |
224 for (; i < loop->num_nodes; i++) | 223 for (; i < loop->num_nodes; i++) |
225 if ((cond = tree_may_unswitch_on (bbs[i], loop))) | 224 if ((cond = tree_may_unswitch_on (bbs[i], loop))) |
293 gcc_assert (EDGE_COUNT (unswitch_on->succs) == 2); | 292 gcc_assert (EDGE_COUNT (unswitch_on->succs) == 2); |
294 gcc_assert (loop->inner == NULL); | 293 gcc_assert (loop->inner == NULL); |
295 | 294 |
296 extract_true_false_edges_from_block (unswitch_on, &edge_true, &edge_false); | 295 extract_true_false_edges_from_block (unswitch_on, &edge_true, &edge_false); |
297 prob_true = edge_true->probability; | 296 prob_true = edge_true->probability; |
298 return loop_version (loop, unshare_expr (cond), | 297 return loop_version (loop, unshare_expr (cond), |
299 NULL, prob_true, prob_true, | 298 NULL, prob_true, prob_true, |
300 REG_BR_PROB_BASE - prob_true, false); | 299 REG_BR_PROB_BASE - prob_true, false); |
301 } | 300 } |