This patch adds a first test case specifically for LoopInterchange. I am
not sure if MicroBenchmarks is the best place for this, but it seems
like a good way to benchmark/tests a set of loops targeted at loop
interchange.
Details
Diff Detail
Event Timeline
Did you make sure this typically finished in 0.5-1s of time?
MicroBenchmarks/LoopInterchange/main.cpp | ||
---|---|---|
65 | Does this need to be enclosed in #ifdef BENCHMARK_LIB as well? Or alternatively could you just drop all the #ifdefs to simplify the code? |
Thanks. I've dropped the range. On a cortex-a72, it takes around 1 second.
MicroBenchmarks/LoopInterchange/main.cpp | ||
---|---|---|
20 | Fixed, looks like I uploaded an old version of the diff. | |
59–60 | I've added a comment to the code. It's never called with state.range(0), so the printf should be never executed, but ensure the test1 calls cannot be optimized away. | |
65 | I've removed them all. |
MicroBenchmarks/LoopInterchange/main.cpp | ||
---|---|---|
59–60 | Can preventing the call being optimized away be accomplished using benchmark::DoNotOptimize() or benchmark::ClobberMemory()? |
Thanks! I'll submit it in a few days, with DoNotOptimize.
MicroBenchmarks/LoopInterchange/main.cpp | ||
---|---|---|
59–60 | Thanks for pointing me to that function, it looks like it does the same thing in a much clearer way! |
M and N are unused?