[tree-ssa] [PATCH]: Loop invariant code motion for trees
Daniel Berlin
dberlin@dberlin.org
Mon Aug 25 20:20:00 GMT 2003
On Monday, August 25, 2003, at 4:09 PM, Andrew MacLeod wrote:
> On Mon, 2003-08-25 at 15:50, Daniel Berlin wrote:
>>
>
>>> Interesting question :-)
>>>
>>> If there is an abnormal edge on the path from 'going to' to 'in',
>>> its a
>>> hazardous thing to do. I don't suppose we're lucky and your variable
>>> has the SSA_NAME_OCCURS_IN_ABNORMAL_PHI flag set?
>>
>> Nope.
>> Luckily, the pre-header edges are stored in the loop structure, so we
>> can just check their flags.
>>
> And is that in fact the situation? or do we have to deal with a more
> insidious issue that Ive been dreading... ?
It works for this case.
At least,
for (e = loop->pre_header->pred; e; e = e->pred_next)
if (e->flags & EDGE_ABNORMAL)
return true;
does.
Checking just the pre-header edges doesn't work.
I've having it skip optimization on any loop where the pre-header has
an abnormal edge, rather than try to determine whether it will cause a
conflict in each specific case.
--Dan
More information about the Gcc-patches
mailing list