This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [lno] [PATCH] Loop Versioning



OK this version of patch passes bootstrapped when I enable loop versioning
and supply -ftree-loop-optimize through BOOT_FLAGS with one condition :-)


And one condition is: I need to disable tree_ssa_iv_optimize().
Combination of iv optimization and loop versioning is exposing some bug.
I am not sure how to fix it.

In iv optimization,

2797 static void
2798 create_new_iv (struct iv_cand *cand)
2799 {
...
2854 if (stmts)
2855 bsi_insert_on_edge_immediate (loop_preheader_edge (current_loop), stmts);
2856
2857 stmt = create_phi_node (cand->var_before, current_loop->header);
2858 SSA_NAME_DEF_STMT (cand->var_before) = stmt;
2859 add_phi_arg (&stmt, initial, loop_preheader_edge (current_loop));
2860 add_phi_arg (&stmt, cand->var_after, loop_latch_edge (current_loop));
2861 }


bsi_insert_on_edge_immediate() at line #2855 may case entry edge split using
tree_split_edge(). Which means after that, current_loop's entry edge will
have new basic block as its source. Now this basic block's 'loop_father' is
not set by tree_split_edge() or bsi_insert_on_edge_immediate(). This cause
ICE when someone try to check ifthis new bb is in a loop or not (through
flow_bb_inside_loop_p()).


Any ideas how to fix this?

Meanwhile, OK to check-in loop versioning, disabled by default?
Thank you,
--
Devang

2003-01-29 Devang Patel <dpatel@apple.com>

* cfglayout.h (loopify): Add new bool parameter.
* cfgloopmanip.c (loopify): Support new bool argument.
* loop-unswitch.c (unswitch_loop): Supply additional argument 'true'
to loopify.
* tree-cfg.c (tree_block_label): Make externally visible.
* tree-flow.h (tree_block_label, test_loop_versioning, tree_ssa_loop_version): New
extern decls.
* tree-ssa-loop-manip.c (lv_adjust_loop_entry_edge, lv_udate_pending_stmts,
lv_adjust_loop_header_phi, tree_ssa_loop_version): New functions.
* tree-ssa-loop.c (tree_ssa_loop_opt): Test loop versioning.


Attachment: lv.3.diff
Description: Binary data



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]