[PATCH][SMS] SMS use loop induction variable analysis instead of depending on doloop optimization

Shiva Chen shivac@marvell.com
Thu Apr 28 06:06:00 GMT 2016


Hi, 

According to Richard's suggestion in
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01240.html
I try to remove the SMS dependency on doloop pass.

SMS would need to adjust kernel loop iteration count
during the transformation.

To adjust loop iteration count, SMS would need to find
count_reg which contain the loop iteration count
and then generate adjustment instruction.

Currently, SMS would find the doloop_end pattern to get
count_reg, and generate adjustment instruction according
to doloop optimization result (tranfer the loop to count
to zero with step = 1).

If can't find doloop_end pattern or the loop form not
the doloop optimization result, the SMS will skip the loop.

Doloop optimization could have benefit for some target
even if the target don't support special loop instruction.

E.g. For arm , doloop optimization could transfer
     the instructions to subs and branch which save the
     comparison instruction.

However, If the loop iteration count computation of
doloop optimization is too complicate, it would drop performance.
(PARAM_MAX_ITERATIONS_COMPUTATION_COST default value is 10
which may too high for the target not support special loop instruction)

This kind loop not suitable for doloop optimization and SMS
can't activate.

To free the SMS dependency on doloop optimization,
I try to use loop induction variable analysis to find count_reg
and generate kernel loop adjustment instruction for the loop
form without doloop optimization(increment/decrement
loop with step != 1).

Without doloop optimization, induction variable could be a
POST_INC/POST_DEC/PRE_INC/PRE_DEC in memory reference which
current implementation won't identify as loop iv. So I modify
relative code in loop-iv.c to identify this case.

With the patch, backend target could active SMS without define
doloop_end pattern.

Could anyone help me to review the patch?
Any suggestion would be very helpful.

Thanks,
Shiva

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-SMS-use-loop-induction-variable-analysis-instead-of-.patch
Type: application/octet-stream
Size: 43501 bytes
Desc: 0001-SMS-use-loop-induction-variable-analysis-instead-of-.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160428/5c87ae34/attachment.obj>


More information about the Gcc-patches mailing list