[PATCH] D101844: [MicroBenchmarks] Add initial loop vectorization benchmarks.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 06:35:05 PDT 2021


fhahn updated this revision to Diff 345858.
fhahn added a comment.

Update to reduce N, add missing include and use ClobberMemory.

In D101844#2760974 <https://reviews.llvm.org/D101844#2760974>, @Meinersbur wrote:

> I tried out the patch myself. It was consistently completing in about 37s, i.e about one second per benchmark.

Thanks for doing a run!

> Number of benchmarks: 36.
> Google Benchmark MinTime default: 0.5s
> Google Benchmark maximum walltime: 2.5s
> That is, the total runtime ranges between 18s and 1.5 minutes.
>
> Reading the minutes-long benchmark time, it seemed that each iteration would take longer than the 2.5s maximum wall clock time default.  In that case, Google Benchmark was unable to get stable statistics, possibly because a single iteration takes longer than 2.5s. This seems to be a good argument to reduce N, to giving Google Benchmark more leeway for statistics. In contrast to e.g. LoopInterchange, there is no need to be sufficiently large to make the cache hierarchy count.  Even on my system (Intel x84_64), it runs only does about 100 iterations per benchmarks, which seems low. Note that autovec and novec are approximately equally fast. `-ffast-math` finishes without error.

I removed one 0 from N, now we should get plenty of iterations even on not so powerful systems. Without a vector library, the runtimes between autovec and novec versions is indded similar. My motivation for the benchmarks is to evaluate & track performance of various vector libraries.

> There is precedence with MemFunctions also running an even larger amount of micro benchmarks not protected by `TEST_SUITE_BENCHMARKING_ONLY`, so it might not be necessary here either.

Sounds good, I'll go without the extra protection then for now. We can adjust if this is a problem. In the future I am planning on adding other vectorization benchmarks, unrelated to math functions. We could add separate binaries for different groups perhaps.


Repository:
  rT test-suite

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101844/new/

https://reviews.llvm.org/D101844

Files:
  MicroBenchmarks/CMakeLists.txt
  MicroBenchmarks/LoopVectorization/CMakeLists.txt
  MicroBenchmarks/LoopVectorization/MathFunctions.cpp
  MicroBenchmarks/LoopVectorization/main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101844.345858.patch
Type: text/x-patch
Size: 5981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210517/15cadc48/attachment.bin>


More information about the llvm-commits mailing list