Hi, I fixed some bug to pass testing on x86-64 and update the patch as 0001-SMS-use-loop-induction-variable-analysis-v1.patch.
Thanks, Shiva -----Original Message----- From: Shiva Chen Sent: Thursday, April 28, 2016 2:07 PM To: GCC Patches <gcc-patches@gcc.gnu.org>; Shiva Chen <shiva0...@gmail.com> Subject: [PATCH][SMS] SMS use loop induction variable analysis instead of depending on doloop optimization 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
0001-SMS-use-loop-induction-variable-analysis-v1.patch
Description: 0001-SMS-use-loop-induction-variable-analysis-v1.patch