[PATCH] D76056: [MemFunctions] Add validity check.

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 05:13:54 PDT 2020


gchatelet added a comment.

A few nits.



================
Comment at: MicroBenchmarks/MemFunctions/main.cpp:27
 
+// This calls the real memcmp to check the reuslts.
+int RealMemCmp(const char *p, const char *q, size_t s)
----------------
It's not super clear what "the real memcmp" means here. Maybe something along those lines:
```
// This function prevents the compiler from interfering with `memcmp` and makes sure the function is called.
```


================
Comment at: MicroBenchmarks/MemFunctions/main.cpp:56
+  // First check the validity of the results.
+  if (Pred()(RealMemCmp(p, q, kSize)) != Pred()(memcmp(p, q, kSize))) {
+    std::cerr << "invalid results for Pred=" << Pred::kDisplay
----------------
Maybe it's worth instantiating the predicate object and use it as a functor.
It would help readability.


Repository:
  rT test-suite

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

https://reviews.llvm.org/D76056





More information about the llvm-commits mailing list