71 points · by IB-I · 4y ago · 8 comments
They can basically rearrange loops (including splitting) to have optimal locality/communication/parallelism/etc.
https://polyhedral.info/ has more.
What is polyhedral compilation? [about six minutes]: https://www.youtube.com/watch?v=iAF-orse4hE
Polyhedral Compilation as a Design Pattern for Compilers - Albert Cohen - PLISS 2019 [about an hour and a half]: https://www.youtube.com/watch?v=mt6pIpt5Wk0
> Eventually, the bitset would get so large that doing a single pass would make more sense as it makes better use of cache, but in a BitmapContainer the length is fixed to 1024 elements, so this is immaterial.
but I think it needs to be called out more explicitly.
As soon as the data doesn't fit in L1, the benefits from better pipelining or vectorization will be negligible compared to the cost of loading the data twice.
In a general case, it is safer to split the data into blocks, large enough to amortize the outer loop but small enough to fit in L1 cache, and perform fission within each block.