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
610
15年メンテしてきたdotfilesから開発トレンドを振り返る 2011 - 2026
giginet
PRO
2
500
Claude Codeログ基盤の構築
giginet
PRO
7
4.7k
Inside of Swift Export
giginet
PRO
1
3.6k
Swiftビルド弾丸ツアー - Swift Buildが作る新しいエコシステム
giginet
PRO
0
3k
SwiftでMCPサーバーを作ろう!
giginet
PRO
3
490
Creating Intuitive Developer Tool in Swift
giginet
PRO
0
1.7k
Mergeable Libraryで 高速なアプリ起動を実現しよう!
giginet
PRO
2
8.6k
5分でわかるExplicitly Built Modules
giginet
PRO
2
1.9k
Other Decks in Programming
See All in Programming
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
JIS keyboard support in Omarchy
lef237
0
110
カツオ、ご期待ください
suneo3476
0
190
Jetpack Compose Mechanisms
skydoves
3
820
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
Kotlinの15年とServer-Side Kotlin
n_takehata
1
150
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
440
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
460
We Have a Design System, Now What?
morganepeng
55
8.4k
Writing Fast Ruby
sferik
630
63k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Leo the Paperboy
mayatellez
10
2.4k
エンジニアに許された特別な時間の終わり
watany
109
250k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
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