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
590
15年メンテしてきたdotfilesから開発トレンドを振り返る 2011 - 2026
giginet
PRO
2
490
Claude Codeログ基盤の構築
giginet
PRO
7
4.7k
Inside of Swift Export
giginet
PRO
1
3.5k
Swiftビルド弾丸ツアー - Swift Buildが作る新しいエコシステム
giginet
PRO
0
3k
SwiftでMCPサーバーを作ろう!
giginet
PRO
3
480
Creating Intuitive Developer Tool in Swift
giginet
PRO
0
1.7k
Mergeable Libraryで 高速なアプリ起動を実現しよう!
giginet
PRO
2
8.5k
5分でわかるExplicitly Built Modules
giginet
PRO
2
1.9k
Other Decks in Programming
See All in Programming
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.5k
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3.2k
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.8k
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
320
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
170
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
520
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.2k
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
160
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
340
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
400
Webの地図
yosuke_furukawa
PRO
6
4.8k
FreeBSDでZabbixを動かす
kenkino
0
320
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
RailsConf 2023
tenderlove
30
1.6k
Fireside Chat
paigeccino
43
4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Being A Developer After 40
akosma
91
590k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Ethics towards AI in product and experience design
skipperchong
2
380
Making Projects Easy
brettharned
120
6.8k
Google's AI Overviews - The New Search
badams
0
1.6k
Speed Design
sergeychernyshev
33
2.1k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
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