[PATCH] D64082: [MemFunctions] Add microbenchmarks for memory functions.
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 05:37:29 PDT 2019
lebedev.ri marked an inline comment as done.
lebedev.ri added inline comments.
================
Comment at: MicroBenchmarks/MemFunctions/main.cpp:50
+ for (int i = 0; i < kNumElements; ++i) {
+ int res = Pred()(memcmp(p + i * kSize, q + i * kSize, kSize));
+ benchmark::DoNotOptimize(res);
----------------
courbet wrote:
> lebedev.ri wrote:
> > I think i'm forgetting about some magic.
> > All the predicates (`EqZero`, ...) take a single argument, how does this work if it passes two args?
> I think you missed that the **result** of calling memcmp is passed to pred. `Pred` just defines which of `==`, `<` or `>` we're benching. I updated the bench comment to make that clearer.
Oh i see, that explains it, thanks!
Repository:
rT test-suite
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64082/new/
https://reviews.llvm.org/D64082
More information about the llvm-commits
mailing list