dongjinBaek / swpp202101-team2

1 stars 0 forks source link

5/4 Meeting summary - make loop unrolling pass #4

Open rorhcdream opened 3 years ago

rorhcdream commented 3 years ago

Summary

I decided to make loop unrolling pass for future vectorization optimizations, instead of constant folding pass.

Problem with the last conclusion

It was concluded yesterday that constant folding will be implemented. But after some research, I found that constant folding can be done arithmetic pass or existing InstCombine pass. So after some discussion, I decided to make vectorization optimization, which is quite important for performance.

LoopVectorize pass research

I tried to apply existing LoopVectorizePass. But code didn't change after applying the pass. After some research, I found that LoopVectorizePass gets informations from other existing analyzing passes, and determine whether applying vectorization is effective. In my case the pass determined that not applying vectorization is better. I couldn't find how to modify the analyzing passes to enable vectorization.

LoopUnroll pass research

So, the second option is to apply loop unrolling and vectorize manually. I tested LoopUnrollPass, which worked well.

Conclusion

After brief meeting with above research results, I've decided to make loop unrolling pass for this sprint. And I will add some existing loop optimizations for loop unrolling pass and performance.

rorhcdream commented 3 years ago

LoadStoreVectorizerPass research

After applying loop unrolling, I tried applying LoadStoreVectorizerPass. The pass didn't work for the same reason as LoopVectorizePass.

Vectorizing should be implemented manually.