æ¥æ¬ä¸ã®ãã¤ããªã¢ã³ãèã«ãã¦ãã¾ãªã (èªå¼µãã) ã³ã³ãã¤ã©åºç¤æè¡ã§ãã LLVM ã®è¨å¿µãã¹ã第ä¸ååå¼·ä¼ã«åå ãã¦ããã
- http://lucille.atso-net.jp/blog/?p=577
- http://groups.google.co.jp/group/llvm_study/web/%E7%AC%AC%E4%B8%80%E5%9B%9E+llvm+%E5%8B%89%E5%BC%B7%E4%BC%9A
ãã¤ãã®ã©ããæ°ã«ãªã£ãã¨ããã ãã¾ã¨ãã¦ããã
LLVM Intro
- ãã¯ãã«å½ä»¤ã«å¯¾å¿ãã¦ãããã CG ã«æå¹ã§ããã
- iPhone SDK ã§ãå©ç¨ããã¦ããã
- ARM backend ã®å å®ã«ã¤ãªãã£ãã
- ãã¢
% llvm-gcc -emit-llvm ... # çæããã .o ã LLVM bitcode % llvm-dis ... # .o ãã .ll ãçæããã % llc ... # .o ãã .s ãçæããã (-march=... ã§ã¿ã¼ã²ãããå¤æ´ã§ãã) % opt -std-compile-opts ... # bitcode ã§ã®æé©åããã
- llvm-gcc ã¯å é¨çã« GIMPLE ãã LLVM IR ãçæãã¦ãããããllvm-gcj ã®ãããªä»ã®è¨èªã® frontend ãæ¯è¼ç容æã«ã§ãããã
- binutils çãªãã¼ã«ã LLVM ç¨ã®ãã®ãèªåã§æã£ã¦ããã
- ãªã³ã¯ææé©åã®ããï¼
- å®è¡æãããã¡ã¤ã«ããã£ã¼ãããã¯ããæ©è½ã¯æªå®è£
ã
- ãããããããå¢å ´ã¾ã§ãã謳ã£ã¦ããã®ã ãããå°æ¥çã«ã¯å®è£ ããã¯ãã
- C ã¸æ¸ãæ»ãã¨ãä»ã¾ã§äººãç®ã§è¦ã¦ãã£ã¦ããæé©åãããèªååã§ãããã
iPhone ã®ãã¡ã¼ã ã LLVM ã§çæããã a.out ã§ãiPhone ä¸ã§ãããã¡ã¤ã«ãæ¡åãã¦ãiTunes å´ã§ LLVM ãæ¥ç¶æã«ãããã¡ã¤ã«æ
å ±ãå
ã«ãã¡ã¼ã ãæé©åã¨ãããã便å©ãªã®ãï¼ã¨ãå¦æ³ããã
Adding LLVM JIT facility to your program
- JIT ã®ã¡ã¢ãªç®¡ç (emitted code ãç½®ãé å) ãã¦ã¼ã¶ãè¨å®ã§ããã
- ã¨ããå²ãã«è³æºç®¡çãç·©ãã£ã¦ã©ãããæå³ï¼
- ã¡ã¢ãªã足ããªãã¨ããã«è½ã¡ãã¨ãã»ãã¥ã¢ãª API ã«ãªã£ã¦ããªãã¨ããæå³ã
- The Pure Programming Language ãåèã«ãªãã
Partial evaluation with LLVM
LLVM first steps
- IEEE754 ã§ã¯æ£ç¢ºã«è¡¨ç¾ãããã¨ãã§ããªãå¤ãå«ãã³ã¼ã㯠llvm-asm ã§ã¯ã³ã³ãã¤ã«ã¨ã©ã¼ãåºãã
An LLVM benchmark
py2llvm: Python to LLVM translator
- ã¿ã¼ã²ããã¯ã·ã§ã¼ãã
ãã¤ããªã ããåºåãããªã
- Function ã§ã®æé©åã CSE ã¨ãããããå½ä»¤ã¬ãã«ã§ã®æé©åãModule ã§ã®æé©åã¯ã¤ã³ã©ã¤ã³å±éãªã©ã® IPO ã¨ç解ãã¦ããã°è¯ãã®ããªï¼
- phi ã¯ãã assert ã«ããããããã
- bitcode ã¯ã人éãæ¸ããã®ãããªãã
質åã¿ã¤ã (ã¨æ親ä¼)
- C ã®ã©ããã¼ããããããã
- frontend ã¯ãããã©ãpass (æé©åé¨) ã¯ãªãã¿ããã
- æ°å½ä»¤è¿½å ãªã©ã§ã»ãã¥ã¢ãªæ©æ§ãå°å ¥ããæµããããã
- HPC åéã¸ã®å¿ç¨ä¾ã¨ãããï¼
- ä¸ã« Cray ã®äººãããã®ã§ãbackend ããããããããªãã
- pass ã® add ã«è¿½å ããé çªã§æé©åæ©è½ã¯å¼ã°ããã
- ãããããå¿ è¦ãªæ å ± (def-use ã¨ãæ¯é æ¨ã®æ å ±ã®ãã¨ï¼) ã®ä¾åããããããé çªãæ°ã«ããå¿ è¦ãããã(ããã°ãã®ã¾ã¾ããªããã°çæãããããªæ©æ§ã«ããã¹ãã ã¨æããã©ã)