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: RFC: Incomplete Draft Patches to Correct Errors in Loop Unrolling Frequencies (bugzilla problem 68212)


On November 9, 2015 6:35:20 PM GMT+01:00, Bernd Schmidt <bschmidt@redhat.com> wrote:
>On 11/07/2015 03:44 PM, Kelvin Nilsen wrote:

>> +bool
>> +in_loop_p (basic_block block, struct loop *loop_ptr)
>> +{
>> +  basic_block *bbs = get_loop_body (loop_ptr);
>> +  bool result = false;
>> +
>> +  for (unsigned int i = 0; i < loop_ptr->num_nodes; i++)
>> +    {
>> +      if (bbs[i] == block)
>> +	result = true;
>> +    }
>
>I think something that starts with bb->loop_father and iterates
>outwards 
>would be more efficient.

flow_bb_inside_loop_p() ?

Cheers,


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