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: [4.5] Doloop improvement patches, 4/7


Zdenek Dvorak wrote:
> Hi,
> 
>> determine_max_iter has code to improve the upper bound for the number of
>> iterations by constructing a condition of the form "iteration_count <
>> bound", and trying to prove it true using simplify_using_initial_values.
>>
>> Currently, it uses an iteration count that has already been passed
>> through the same simplification.  Doing so loses opportunities for using
>> conditions in the simplification.  For example,
>>
>>     R6 = R7;
>>     CC = R6 < -1;
>>     IF !CC jump over the loop;
>>   loop starts here:
>>     decrement R6 and branch if not zero.
>>
>> Here, the number of iterations gets simplified to R7 in the first pass
>> of simplifications, but when trying to prove "R6 < -1" it is better to
>> start again with an expression based on R6, not R7.
>>
>> This patch relies on the previous ones to strengthen
>> simplify_using_initial_values sufficiently for this to be a win in
>> almost all cases.
> 
> Does it really matter, with your patch 2/7?

Hmm.  It certainly used to make a difference at some point while I was
working on the series, but now it appears not to.  Well spotted.

That leaves the change to use simplify_gen_relational instead of
building the rtx manually, which I'll commit as obvious once I get to
this point.


Bernd
-- 
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif


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