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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 03:56:30 PDT 2021


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

Updated to fall back to fpclassify if there's a value mis-compare, disable verification with `-DTEST_SUITE_BENCHMARKING_ONLY=On` or `-ffast-math`.

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

> Do you have an example output? How long does it take to execute the benchmark?

Unfortunately I cannot share any detailed absolute numbers about runtime. Also, the total runtime will depend on how long it takes for google-benchmark to determine that the results are stable.

> The validation uses a floating-point comparison using `==`, could you add a comment that this is intended? I am a bit worried that if I compile the test-suite with `CMAKE_CXX_FLAGS=-ffast-math` (mostly to measure performance), this will fail.

That's a good point! I adopted the code to use fpclassify as suggested by @lebedev.ri. In addition I tried to disable verification, if either ` -DTEST_SUITE_BENCHMARKING_ONLY=On` is  used or `-ffast-math` is passed. I hope that's a solid enough start, as I think the verification is quite useful in the general case (without -ffast-math).


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.344347.patch
Type: text/x-patch
Size: 5930 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210511/0374c8d4/attachment.bin>


More information about the llvm-commits mailing list