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]

[PATCH 3/7] SMS remove dependence on doloop: Update loop-versioning for the loop with step != 1


Hi,

To avoid the loop with loop_count < stage_count execute the SMS
version loop, SMS will try to get loop iteration count.
If the loop iteration count can't get by compile time, SMS will
do loop-versioning which will generate original loop and SMS
version loop with runtime checking code.

With doloop optimization, the loop form will transfer to decrease
to 0 with step 1. Therefore, the loop count will hold in
count_reg in the loop entry.

E.g. (for i = 23; i > 3; i = i - 5) => (for i = 4; i > 0; i--)

The loop versioning condition could generate as

    if (count_reg > stage_count)
      execute sms version loop

To remove the dependency on doloop optimization, we need to generate
loop versioning condition without doloop pass.
Without doloop pass, the loop form could be increment/decrement
with step != 1.

The loop versioning condition could generate as

    if (count_reg - loop_end_cond > stage_count * step) for decrement loop
      execute sms version loop


Thanks,
Shiva

Attachment: 0003-Update-loop-versioning-for-the-loop-with-step-1.patch
Description: 0003-Update-loop-versioning-for-the-loop-with-step-1.patch


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