Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
LLVMやっていってる
Search
giginet
PRO
January 29, 2019
Programming
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
LLVMやっていってる
giginet
PRO
January 29, 2019
Transcript
16 slides
୭ • @giginet(Twi+er/GitHub) • ւಓവؗࢢग़ • 2009/4 ւಓେֶֶ෦ • 2013/4
ւಓେֶେֶӃɹใՊֶݚڀՊ • 2015/4 ΫοΫύουגࣜձࣾ৽ଔೖࣾ • ϞόΠϧج൫෦ͰiOSͷج൫։ൃ͍ͯ͠·͢ • झຯήʔϜ։ൃͰ͢ • ֶੜ࣌ͷࢥ͍ग़ɿνϟʔɺδϯύɺ࣌ؗ 1
OSSϝϯςφͬͯΔ • fastlane • Carthage ࡞ͬͨͭ • giginet/xcprofiler • giginet/Crossroad
• cookpad/Puree-Swi9 2
࠷ۙڵຯͷ͋Δٕज़ 3
LLVM 4
LLVMͱ • ίϯύΠϥج൫ • ݱࡏͷίϯύΠϥશͯΛ࣮͢Δʹෳࡶ͗͢ΔͷͰɺػց ޠͷੜ࠷దԽͳͲΛڞ௨Խͯ͠࡞ΕΔΑ͏ʹͨ͠Έ • ݱࡏɺଟ͘ͷݴޠͷίϯύΠϥLLVM্Ͱߏங͞Ε͍ͯΔ 5
Θ͍Θ͍swi$c 6
1. ιʔείʔυΛύʔεͯ͠ߏจ(AST)ʹม 2. AST͔ΒLLVM IRΛੜ 3. Ṗͷٕज़ʹΑΓόΠφϦ͕ੜ͞ΕΔ 7
LLVM IR • LLVM Intermediate Representa2on(தؒදݱ) • ࠷ऴతʹ͜ͷܗࣜʹग़ྗ͢Δ͜ͱͰɺLLVMΛ༻͍ͯόΠφϦ͕ੜͰ͖Δ • ଟ͘ͷݴޠͷίϯύΠϥ͕LLVM
IRΛੜ͢ΔLLVM Frontendͱ࣮ͯ͠͞Ε͍ͯΔ 8
#include <stdio.h> int main(void) { printf("Hello World"); return 0; }
$ clang -S -emit-llvm hello.c 9
; ModuleID = 'hello.c' source_filename = "hello.c" target datalayout =
"e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.14.0" @.str = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1 ; Function Attrs: noinline nounwind optnone ssp uwtable define i32 @main() #0 { %1 = alloca i32, align 4 store i32 0, i32* %1, align 4 %2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0)) ret i32 0 } declare i32 @printf(i8*, ...) #1 !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 7, !"PIC Level", i32 2} !2 = !{!"Apple LLVM version 10.0.0 (clang-1000.11.45.5)"} 10
LLVMͷษڧ๏ • LLVM Tutorial • h/ps:/ /llvm.org/docs/tutorial/ • C++ͰՍۭͷؔܕݴޠͷίϯύΠϥΛ࣮͢Δ 11
Kaleidoscope def test(x) 1+2+x; 12
define double @test(double %x) { entry: %addtmp = fadd double
2.000000e+00, 1.000000e+00 %addtmp1 = fadd double %addtmp, %x ret double %addtmp1 } 13
ࢀߟॻ੶ • ͖ͭͶ͞ΜͰΘ͔ΔLLVM • LLVM Cookbook 14
Swi$ίϯύΠϥΠϯλʔϯΓ·͢ʂʂʂ • 3/28 @ ΫοΫύου • Ԡืडதʂʂʂ h"ps:/ /internship.cookpad.com/2019/spring/ 15
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ @giginet 16
More Decks by giginet
See All by giginet
🀄️ on swiftc
giginet
PRO
0
650
15年メンテしてきたdotfilesから開発トレンドを振り返る 2011 - 2026
giginet
PRO
2
520
Claude Codeログ基盤の構築
giginet
PRO
7
4.8k
Inside of Swift Export
giginet
PRO
1
3.6k
Swiftビルド弾丸ツアー - Swift Buildが作る新しいエコシステム
giginet
PRO
0
3.1k
SwiftでMCPサーバーを作ろう!
giginet
PRO
3
510
Creating Intuitive Developer Tool in Swift
giginet
PRO
0
1.7k
Mergeable Libraryで 高速なアプリ起動を実現しよう!
giginet
PRO
2
8.8k
5分でわかるExplicitly Built Modules
giginet
PRO
2
2k
Other Decks in Programming
See All in Programming
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
190
読みやすい!と評判(?)の発表の準備にかける私のこだわり
shoheimitani
0
110
LLM 101
dalinaum
0
520
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
190
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
170
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
310
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.6k
AI Augmentation Techniques with Liberty
ivargrimstad
1
530
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
220
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
340
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
6.1k
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
680
A designer walks into a library…
pauljervisheath
211
25k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
470
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
GitHub's CSS Performance
jonrohan
1033
470k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
580
Digital Ethics as a Driver of Design Innovation
axbom
PRO
2
550
Done Done
chrislema
187
17k
Faster Mobile Websites
deanohume
310
32k
How to Ace a Technical Interview
jacobian
280
24k