@@ -628,13 +628,11 @@ function generate_benchmark_definition(
628
628
__prehook_result, __posthook_result, __return_val = $ BenchmarkTools. @noinline (
629
629
function (__evals)
630
630
prehook_result = $ BenchmarkTools. samplefunc_prehook ()
631
- # We'll run it evals times.
632
631
$ BenchmarkTools. @noinline __return_val_2 = $ (invocation)
633
632
for __iter in 2 : __evals
634
633
$ BenchmarkTools. @noinline $ (invocation)
635
634
end
636
635
posthook_result = $ BenchmarkTools. samplefunc_posthook ()
637
- # trick the compiler not to eliminate the code
638
636
return prehook_result, posthook_result, __return_val_2
639
637
end
640
638
)(
@@ -655,8 +653,6 @@ function generate_benchmark_definition(
655
653
__params
656
654
)
657
655
$ BenchmarkTools. @noinline $ (setup)
658
- # Isolate code so that e.g. setup doesn't cause different code to be generated by e.g. changing register allocation
659
- # Unfortunately it still does, e.g. if you define a variable in setup then it's passed into invocation adding a few instructions
660
656
__prehook_result, __posthook_result, __return_val = $ BenchmarkTools. @noinline (
661
657
function (__evals)
662
658
prehook_result = __params. prehook ()
@@ -666,7 +662,6 @@ function generate_benchmark_definition(
666
662
$ BenchmarkTools. @noinline $ (invocation)
667
663
end
668
664
posthook_result = __params. posthook ()
669
- # trick the compiler not to eliminate the code
670
665
return prehook_result, posthook_result, __return_val_2
671
666
end
672
667
)(
0 commit comments