[PATCH] D34583: [LSR] Narrow search space by filtering non-optimal formulae with the same ScaledReg and Scale.
Evgeny Astigeevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 3 04:36:23 PDT 2017
eastig reopened this revision.
eastig added a comment.
This revision is now accepted and ready to land.
F4171725: test.ll <https://reviews.llvm.org/F4171725>
F4171724: test.good.ll <https://reviews.llvm.org/F4171724>
F4171723: test.bad.ll <https://reviews.llvm.org/F4171723>
This patch caused regressions from 5% to 23% in two our internal benchmarks on Cortex-M23 and Cortex-M0+. I attached test.ll which is reduced from the benchmarks. I used LLVM revision 309830. 'test.good.ll' is a result when filtering is disabled. 'test.bad.ll' is a result when filtering is enabled.
Comparing them I can see that this optimization changes how an induction variable is changed. Originally it is incremented from 0 to 256. The optimization changes this into decrementing from 0 to -256. This induction variable is also used as an offset to memory. So to preserve this semantic conversion of the induction variable from a negative value to a positive value is inserted. This is lowered to additional instructions which causes performance regressions.
Could you please have a look at this issue?
Thanks,
Evgeny Astigeevich
The ARM Compiler Optimization team leader
Repository:
rL LLVM
https://reviews.llvm.org/D34583
More information about the llvm-commits
mailing list