COSCUP2021
Skilled
en
COSCUP2021
System Software
TR309
歡迎來到 https://hackmd.io/@coscup/2021 共筆
請從這裡開始
講者背景:
Pre-LLVM era:
LLVM 除了大家常聽到的 pass manager 之外,LLVM 以及 clang 前端本身是一般的函式庫,有模組化方便使用者使用任何一部分 – 前端、中間最佳化、後端等等 – 的功能。
隨著各個軟體規模擴大,專案建置需要的時間也開始影響到開發者。
在 code generation 的時候, instruction selection 傳統輸入為 machine-independent 、線性的 IR 表示法,經過 instruction selection 演算法轉成 DAG,最後再轉成線性的 machine-level IR。這些不同 IR 變換消耗非常多的時間。
LLVM 引進了新的 MLIR 解決後端這部分的問題。
Linker 因為需要將所有 object file 鏈結成單一輸出檔,難以將不同工作分配給不同 thread 平行化。同時,近來 linker 也需負責 LTO,為 whole-program optimiztaion,更加難以平行。
LLVM 的改進: ThinLTO,分開不同的地方平行最佳化,並且在不同的 process 之間以 IPC 交換 function summary 高通。
組織:沒有集中的組織作技術決策,整個社群是很扁平的架構。Code owner 只有義務在沒有人 review 程式碼的時候負責處理。
貢獻流程:專案只有單一的 main branch。PR 作者直接 與 reviewer 溝通後 commit 到 Tip of Tree (ToT)。
struct
定義增加新的 field)LLVM 插件不保證 stability
MLIR 是個框架,讓人更容易的創造新的 domain-specific IR。因此講者很喜歡。
買講者的書
如果只是"看"SSA form是怎麼樣的話 用 LLVM/clang dump IR 就好了。如果是想要研究非SSA form轉SSA演算法的話,自己寫應該是不錯的idea
我會覺得第一當然就是大型專案編譯速度真的很慘,這邊提到的 Rust compiler 也是一個原因之一 (Rust 產生出來的 LLVM IR量以及複雜度遠高於 clang 產出的 LLVM IR)。另外一個有趣的例子是 game developer:PlayStation (他們也是用 clang/LLVM) compiler team近幾年來一直在改進編譯速度的原因就在於 game development 很在意「改動code -> 顯示到畫面」的時間 (他們稱為"turnaround time"),更別提遊戲的複雜度往往比一般軟體高。
並沒有一定但是很常發生XDDD。我記得 LLVM 有用一個變數來防止你用 ABI incompatible的 plugin: 只要你用那種 plugin 他在載入 plugin 的時候會跳出一個 dlopen (或是 ld.so 的,我忘記了) error。
我不太清楚這邊講的權力架構是什麼,但就我知道的目前沒這計劃。我知道有一個相關的東西是 LLVM incubator,基本上他的概念跟 Apache incubator 很像:如果你想要在 LLVM project 裡面做某個很大的改動 – 通常是加入某個新的子計劃像是一個 language frontend – 那我們可以先把他丟到 LLVM incubator 讓他"熟成"。
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing