有趣的编译器项目 [英] Interesting compiler projects

查看:112
本文介绍了有趣的编译器项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在选择一个项目,以便在接下来的8周内完成一个Grad级别的编译器课程。我想做一些与优化相关的事情,因为我没有在这方面做得很多,但在该领域的任何东西都是公平的游戏。



你最感兴趣的编译器相关项目是什么?






编辑:感谢您的宝贵建议。非常抱歉没有更新这么久。



我最后做的一个项目是一个简单的自动向量化优化LLVM。 LLVM有矢量类型,但似乎没有任何方式利用它们没有前端的支持。这个优化将正常的标量代码转换为向量代码。



由于自动向量化是一个相当困难的优化实现,我们尽可能限制我们的范围。首先,为了在代码中暴露指令级并行性,我们寻找与我们的标准匹配的单块循环,然后展开它们特定的次数,以便它们可以方便地向量化。然后,我们实施了多媒体教学中利用超级词并行化



即使这个优化的简化版本也相当复杂。有很多约束;例如,你不想矢量化一个生活在循环外的变量,因为程序的其余部分期望它是标量。我们在过去几个星期里投入了很多时间。该项目是一个很多的乐趣,但我们学到了很多。

解决方案

如果你对优化感兴趣,使用SSE和MMX指令集的循环向量化可能很有趣。

I'm currently in the process of choosing a project for a grad-level compiler course to be done over the next 8 weeks. I'd like to do something related to optimization since I haven't worked much in that area before, but anything in the field is fair game.

What was the most interesting compiler-related project you've done? What did you learn the most from?


Edit: Thank you all for your great suggestions. I apologize for not updating this for so long.

The project I ended up doing was a simple autovectorization optimization on LLVM. LLVM has vector types, but there didn't seem to be any way to take advantage of them without support for the front-end. This optimization converted normal scalar code into vector code.

Since auto-vectorization is a fairly difficult optimization to implement, we limited our scope as much as we could. First, in order to expose instruction level parallelism in the code, we looked for one-block loops that matched our criteria, then unrolled them a specific number of times so they would be conveniently vectorizable. We then implemented the packing algorithm laid out in Exploiting Superword Level Parallelism with Multimedia Instruction Sets by Larsen and Amarasinghe.

Even a simplified version of this optimization is pretty complicated. There are a lot of constraints; for instance, you don't want to vectorize a variable that lives out of the loop, since the rest of the program expects it to be scalar. We put in a lot of hours in the last few weeks. The project was a lot of fun though, and we learned a lot.

解决方案

If you're interested in optimization, Vectorization of loops using SSE and MMX instruction sets could be interesting.

这篇关于有趣的编译器项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆