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

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 4 09:45:56 PDT 2021


Meinersbur added a comment.

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

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.

The comparison is part of the time measurements. This doesn't seem useful to be for benchmarking the vectorized and non-vectorized versions together. If the only things we are interested in is the correctness, we don't need Google Benchmark. Use Google test instead?



================
Comment at: MicroBenchmarks/LoopVectorization/MathFunctions.cpp:55
+      if (C[i] != CNovec[i] && !(isnan(C[i]) && isnan(CNovec[i])) &&
+          !(isinf(C[i]) && isinf(CNovec[i]))) {
+        std::cerr << "ERROR: autovec result different to scalar result " << C[i]
----------------
I think the `Inf` case is already tested with `!=`, only NaN needs to be compared separately. Since `NaN != NaN`.


Repository:
  rT test-suite

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

https://reviews.llvm.org/D101844



More information about the llvm-commits mailing list