dongjinBaek / swpp202101-team2

1 stars 0 forks source link

[Sprint 3] SetIsNoInlinePass supported by adaptive llvm pipeline passes #26

Closed whnbaek closed 3 years ago

whnbaek commented 3 years ago

This pull request modifies almost 300 lines, so the rest of the codes including backend optimization will be added in wrap-up phase. I analyze llvm O3 pipelines defined in buildPerModulePipeline and create our adaptive pipelines. These contain inlining process. It is observed that there are some cases where inlining should not occur, i.e. in matmul3 and matmul4. Thus, I add SetIsNoInlinePass which calculates number of colors and decide whether CallInst should be removed by inlining or not. However, there is a problem. After inlining, loop unrolling unrolls loops and increase number of colors of some functions, causing lack of colors. So results of matmul3 and matmul4 looks bad at this point. This would be dealt in wrap-up phase by considering both loop unrolling and pipelines. Moreover, result degradation of rmq1d_naive should be analyzed. Seeming we need an outliner!

Benchmark Results

benchmark improvement benchmark improvement benchmark improvement
anagram 25.41% collatz 63.50% merge_sort 16.61%
binary_tree 20.08% floyd 34.52% prime 33.55%
bitcount1 21.05% gcd 10.72% quick_sort 29.28%
bitcount2 18.76% jenkins_hash 24.19% radix_sort 23.00%
bitcount3 12.44% matmul1 9.44% rmq1d_naive 6.17%
bitcount4 41.78% matmul2 32.06% rmq1d_sparsetable 35.53%
bitcount5 15.25% matmul3 -4.35% rmq2d_naive 13.48%
bubble_sort 29.58% matmul4 29.47% rmq2d_sparsetable 40.96%