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
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
LLVMやっていってる
giginet
PRO
January 29, 2019
More Decks by giginet
See All by giginet
🀄️ on swiftc
giginet
PRO
0
580
15年メンテしてきたdotfilesから開発トレンドを振り返る 2011 - 2026
giginet
PRO
2
450
Claude Codeログ基盤の構築
giginet
PRO
7
4.6k
Inside of Swift Export
giginet
PRO
1
3.5k
Swiftビルド弾丸ツアー - Swift Buildが作る新しいエコシステム
giginet
PRO
0
2.9k
SwiftでMCPサーバーを作ろう!
giginet
PRO
3
480
Creating Intuitive Developer Tool in Swift
giginet
PRO
0
1.6k
Mergeable Libraryで 高速なアプリ起動を実現しよう!
giginet
PRO
2
8.5k
5分でわかるExplicitly Built Modules
giginet
PRO
2
1.9k
Other Decks in Programming
See All in Programming
Foundry Localでエージェント開発
seosoft
0
170
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
340
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
700
Deep dive into the select statement (GopherCon UK)
jespino
0
170
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
130
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
5.8k
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
160
Press start. Python's next generation.
willingc
PRO
3
330
Building an Out-of-Order CPU
latte72
1
750
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
320
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
ラッコキーワード サービス紹介資料
rakko
1
4.8M
Are puppies a ranking factor?
jonoalderson
2
3.9k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
240
Tell your own story through comics
letsgokoyo
1
1.1k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
Believing is Seeing
oripsolob
1
210
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
590
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Transcript
୭ • @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