[PATCH] D31821: Remove redundant copy in recurrences

Taewook Oh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 13:25:04 PDT 2017


twoh added a comment.

@qcolombet Actually you're right. Having tied operands, this can be done within SSA. Do you have a suggestion for a better place to implement this? I thought what `isRevCopyChain` does is most close to what this patch does.

I'm afraid that I couldn't quite understand your side question. This patch commutes operands of an instruction if the instruction is inside the recurrence that meets certain conditions. In line 846-850, it checks if the recurrence pattern is formulated around regC, and returns true to commute operands. If not, it checks same for regB, and returns false to not to commute if it observes the pattern. If the pattern is observed for both regB and regC, it is possible that not to commute the operands generates better result, but as the logic checks regC first, it'll commute the operands.

@MatzeB Below is a compile time difference in percentage for spec2006

400.perlbench	1.80
401.bzip2	0.66
403.gcc	0.77
429.mcf	2.61
433.milc	-1.70
444.namd	0.31
445.gobmk	-0.05
447.dealII	-0.22
450.soplex	0.48
453.povray	1.34
456.hmmer	0.49
458.sjeng	1.30
462.libquantum	1.90
464.h264ref	0.52
470.lbm	-3.01
471.omnetpp	2.50
473.astar	0.27
482.sphinx3	1.01
483.xalncbmk	-0.47


https://reviews.llvm.org/D31821





More information about the llvm-commits mailing list