[Patch][Review Requested][Compilation Time] Avoid frequent copy of elements in LoopStrengthReduce

Hello,

This patch aims to improve compile time performance by increasing the SCEV vector size in LoopStrengthReduce. It is observed that the BaseRegs vector size is 4 in most cases, and elements are frequently copied when it is initialized as SmallVector<const SCEV *, 2> BaseRegs.

Our benchmark results show that the compilation time performance improved by ~0.5%.

Patch by Wan Xiaofei.

Thanks

Sriram

loopStrengthReduce.patch (3.85 KB)

Just an FYI that I think patches are supposed to be sent to llvm-commits. – John T.

That's fairly small; what was the standard deviation, confidence interval, etc?

-- Sean Silva

The compilation time is measured for different benchmarks while compiling a .bc file into a shared object. The improvement across the range of benchmarks is listed in following table. If the reason behind the need for other performance metrics is to identify possible measurement errors, then I think this table would be of some help. However, we do not have the standard deviation and confidence interval at the moment.

Could you just include your raw data? (i.e. all of the raw timings that you
did for each benchmark).

-- Sean Silva

Sriram,

This patch looks good. Please commit.

...and thanks for the data.

-Andy