(I am resending this, since it's been already 4 hours since I sent it first time, and I don't see it on the list. I apologize for possible duplication.) > > On 14 June 2011 14:27, Richard Guenther wrote: > > > >>>> > >>>>   /* Mark the stmts that are involved in the pattern. */ > >>>> -  gsi_insert_before (&si, pattern_stmt, GSI_SAME_STMT); > >>>>   set_vinfo_for_stmt (pattern_stmt, > >>>>                      new_stmt_vec_info (pattern_stmt, loop_vinfo, NULL)); > >>>> +  gimple_set_bb (pattern_stmt, gimple_bb (stmt)); > >>>> > >>>> do you really need this? > >>> > >>> Yes, there are a lot of uses of gimple_bb (stmt). Otherwise, we'd have > >>> to check there that bb exists (or that this is not a pattern stmt) and > >>> use the bb of the original statement if not. > >> > >> I see.  It's not really uglier than the part where you have to special-case > >> them when walking use-operands, so ... > > > > I think it is uglier, because there are 42 cases to handle instead of > > a single place that you mentioned. (Probably not all the 42 can be > > really reached with a pattern stmt, but still it's a lot). > > Well, yes - I meant setting the BB isn't uglier which means setting BB > is ok. > > Richard. > > > Thanks, > > Ira > > > >> > >> Still a lot better than when inserting them for real. > >> > >>>> Otherwise it looks reasonable.  Btw, > >>>> we can probably remove the simple DCE done in > >>>> slpeel_tree_peel_loop_to_edge (remove_dead_stmts_from_loop) > >>>> with this patch. I committed the attached patch. It also removes remove_dead_stmts_from_loop. Thanks, Ira (See attached file: pattern2.txt)