llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Runtime of internal test case increased dramatically after SLP change

Open ormris opened this issue 4 years ago • 4 comments

An internal test case (C++ and LLVM IR attached), takes over 78 min to run after the following commit. Previously, it completed in about 2 min. On current master, the situation has improved substantially, but is still dramatically slower at just over 15 min. I noticed that there's been performance-related discussions on the original review, so I hope the attached test case will be useful for further investigation. It isn't small, but its structure is regular: test.zip

  commit 7ea03f0b4e4ec5d91d48ba2976f5adc299089ffd
  Author: Alexey Bataev <[email protected]>
  Date:   Thu Nov 18 08:08:01 2021 -0800

      [SLP]Improve reductions analysis and emission, part 1.
After 7ea03f0b:
$ time opt -slp-vectorizer -o out.ll test.ll
real    78m7.682s
user    78m7.299s
sys     0m0.236s
$
Before 7ea03f0b:
$ time opt -S -slp-vectorizer test.ll -o slp-opt.ll
real    1m42.031s
user    1m41.980s
sys     0m0.048s
$
Current master:
$ time opt -S -slp-vectorizer test.ll -o slp-opt.ll
real    15m34.115s
user    15m33.978s
sys     0m0.096s
$

ormris avatar Oct 19 '22 17:10 ormris

@alexey-bataev

EugeneZelenko avatar Oct 19 '22 17:10 EugeneZelenko

Have a fix, my time for the provided test after the fix is 0.312 s. Hope to commit it today or next week as NFC patch.

alexey-bataev avatar Oct 21 '22 19:10 alexey-bataev

Must be fixed in da4e0f7ac58711ddeaf86943ae82c1928e26801f

alexey-bataev avatar Oct 24 '22 17:10 alexey-bataev

Looks good. Thanks so much!

ormris avatar Oct 25 '22 20:10 ormris