File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -609,21 +609,25 @@ function generate_benchmark_definition(
609609 )
610610
611611 try
612- @noinline $ (setup)
612+ $ BenchmarkTools . @noinline $ (setup)
613613 __evals = __params. evals
614614 # Isolate code so that e.g. setup doesn't cause different code to be generated by e.g. changing register allocation
615615 # Unfortunately it still does, e.g. if you define a variable in setup then it's passed into invocation adding a few instructions
616- @noinline (function (__evals)
617- $ LinuxPerf. enable_all! ()
618- # We'll run it evals times.
619- @noinline __return_val_2 = $ (invocation)
620- for __iter in 2 : __evals
621- @noinline $ (invocation)
616+ $ BenchmarkTools. @noinline (
617+ function (__evals)
618+ $ LinuxPerf. enable_all! ()
619+ # We'll run it evals times.
620+ $ BenchmarkTools. @noinline __return_val_2 = $ (invocation)
621+ for __iter in 2 : __evals
622+ $ BenchmarkTools. @noinline $ (invocation)
623+ end
624+ $ LinuxPerf. disable_all! ()
625+ # trick the compiler not to eliminate the code
626+ return __return_val_2
622627 end
623- $ LinuxPerf. disable_all! ()
624- # trick the compiler not to eliminate the code
625- return __return_val_2
626- end )(__evals)
628+ )(
629+ __evals
630+ )
627631 return $ LinuxPerf. Stats (__linux_perf_bench)
628632 finally
629633 close (__linux_perf_bench)
You can’t perform that action at this time.
0 commit comments