status of arm platform support in llvm and more anton
TRANSCRIPT
![Page 2: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/2.jpg)
Outline
1. LLVM Compiler Infrastructure
2. Status:
1. Clang
2. Compiler-RT
3. Backend
3. Track, Use & Contribute
4. Interoperability Problems
![Page 3: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/3.jpg)
LLVM: What is it?
Language independent optimizer and code generator
- Many optimizations, many targets
- Modern and library-based design
![Page 4: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/4.jpg)
LLVM: What is it?
Language independent optimizer and code generator
- Many optimizations, many targets
- Modern and library-based design
Clang C/C++/ObjectiveC frontend
- Designed for speed, reusability, compatibility with GCC (not only!) extensions
- Good also as indexing, analysis, refactoring tool
![Page 5: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/5.jpg)
LLVM: other subprojects
1. MC: operations on “machine code”- Assemblers, disassemblers, direct object code emission
![Page 6: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/6.jpg)
LLVM: other subprojects
1. MC: operations on “machine code”- Assemblers, disassemblers, direct object code emission
2. LLDB: low level debugger- Command line debugger- Reuses Clang parser, some JIT bits, MC disassemblers
![Page 7: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/7.jpg)
LLVM: other subprojects
1. MC: operations on “machine code”- Assemblers, disassemblers, direct object code emission
2. LLDB: low level debugger- Command line debugger- Reuses Clang parser, some JIT bits, MC disassemblers
3. libc++: C++ standard runtime library- Full support for C++11- Designed for performance
![Page 8: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/8.jpg)
Clang: status as of 2.9
1. Production quality C, ObjC, C++, ObjC++ compiler on:
• X86 (-32 and -64)
• (some) ARM cores
![Page 9: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/9.jpg)
Clang: status as of 2.9
1. Production quality C, ObjC, C++, ObjC++ compiler on:
• X86 (-32 and -64)
• (some) ARM cores
2. Can bootstrap; build Boost, Mozilla, Qt, ...
![Page 10: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/10.jpg)
Clang: status as of 2.9
1. Production quality C, ObjC, C++, ObjC++ compiler on:
• X86 (-32 and -64)
• (some) ARM cores
2. Can bootstrap; build Boost, Mozilla, Qt, ...
3. Builds working base FreeBSD system
![Page 11: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/11.jpg)
ARM-specific extensions
1. ‘pcs’ function attribute is fully supported
![Page 12: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/12.jpg)
ARM-specific extensions
1. ‘pcs’ function attribute is fully supported
2. All (Soft, Soft-FP, Hard) FP ABIs are supported
![Page 13: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/13.jpg)
ARM-specific extensions
1. ‘pcs’ function attribute is fully supported
2. All (Soft, Soft-FP, Hard) FP ABIs are supported
3. NEON builtins are fully implemented (with some extensions)
![Page 14: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/14.jpg)
New stuff in 3.0
1. Significant progress in C++11 support
2. Various new stuff in libc++
![Page 15: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/15.jpg)
New stuff in 3.0
1. Significant progress in C++11 support
2. Various new stuff in libc++
3. Improvements in semantic analysis: new warnings here and there
![Page 16: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/16.jpg)
New stuff in 3.0
1. Significant progress in C++11 support
2. Various new stuff in libc++
3. Improvements in semantic analysis: new warnings here and there
4. Improvements in static analyzer
![Page 17: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/17.jpg)
New stuff in 3.0
1. Significant progress in C++11 support
2. Various new stuff in libc++
3. Improvements in semantic analysis: new warnings here and there
4. Improvements in static analyzer
5. Thread safety annotations
![Page 18: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/18.jpg)
ARM extensions in 3.0
1. Homogeneous aggregates in hard FP ABI
![Page 19: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/19.jpg)
ARM extensions in 3.0
1. Homogeneous aggregates in hard FP ABI
2. Generic half FP support
![Page 20: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/20.jpg)
ARM extensions in 3.0
1. Homogeneous aggregates in hard FP ABI
2. Generic half FP support:
• Native ops for OpenCL & similar
• Storage-only type for everything else
![Page 21: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/21.jpg)
Clang: compatibility
1. C99 by default (different inline semantics)
![Page 22: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/22.jpg)
Clang: compatibility
1. C99 by default (different inline semantics)
2. More “strict” inline assembler
![Page 23: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/23.jpg)
Clang: compatibility
1. C99 by default (different inline semantics)
2. More “strict” inline assembler
3. C++ VLAs are not supported
![Page 24: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/24.jpg)
Clang: compatibility
1. C99 by default (different inline semantics)
2. More “strict” inline assembler
3. C++ VLAs are not supported
4. Much standard (than gcc) in C++ templates
Check clang.llvm.org/compatibility.html
![Page 25: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/25.jpg)
Missed things in clang
1. ‘interrupt’ attribute is not supported
2. Everything assumes little-endian byte order
3. Nothing like a ‘universal driver’ is implemented
![Page 26: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/26.jpg)
Universal Driver: intro
1. Clang is inherently a cross compiler:
• All backends / targets are linked in
• In theory target switch should be easy
![Page 27: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/27.jpg)
Universal Driver: intro
1. Clang is inherently a cross compiler:
• All backends / targets are linked in
• In theory target switch should be easy
2. But: compiler is only a part of the whole compilation chain
![Page 28: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/28.jpg)
Universal Driver: intro
1. Clang is inherently a cross compiler:
• All backends / targets are linked in
• In theory target switch should be easy
2. But: compiler is only a part of the whole compilation chain
3. The Problem: provide paths to libraries, headers, linker, assembler, ...
![Page 29: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/29.jpg)
Universal Driver: problem
Multiple solutions:
• -V, -B, -b gcc cmdline switches
• -m32, -m64, -mthumb, ...
![Page 30: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/30.jpg)
Universal Driver: problem
Multiple solutions:
• -V, -B, -b gcc cmdline switches
• -m32, -m64, -mthumb, ...
• multilibs
![Page 31: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/31.jpg)
Universal Driver: problem
Multiple solutions:
• -V, -B, -b gcc cmdline switches
• -m32, -m64, -mthumb, ...
• multilibs
• Apple’s driver-driver
![Page 32: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/32.jpg)
Universal Driver: problem
Multiple solutions:
• -V, -B, -b gcc cmdline switches
• -m32, -m64, -mthumb, ...
• multilibs
• Apple’s driver-driver
• ....
These all are approximations!
![Page 33: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/33.jpg)
Universal Driver: model
Idea:
• Single entry point to compiler regardless of target and mode
![Page 34: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/34.jpg)
Universal Driver: model
Idea:
• Single entry point to compiler regardless of target and mode
• User specifies just a “configuration”:clang -‐-‐config=arm-‐cortex-‐a9-‐baremetal foo.c
clang -‐-‐config=cortex-‐m4-‐my-‐toaster morning-‐food.c
![Page 35: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/35.jpg)
Universal Driver: model
Idea:
• Single entry point to compiler regardless of target and mode
• User specifies just a “configuration”
• Configuration defines all stuff like paths, includes, libs, default cmdlines, etc..
• Configuration might be system-wide or user-wide
![Page 36: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/36.jpg)
Universal Driver: model
Idea:
• Single entry point to compiler regardless of target and mode
• User specifies just a “configuration”
• Configuration defines all stuff like paths, includes, libs, default cmdlines, etc..
• Configuration might be system-wide or user-wide
Large and open-ended project!
![Page 37: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/37.jpg)
Compiler-RT
1. Low-level compiler support library:
• Routines for e.g. 64 bit arithmetic on 32 bit targets
• Optimized versions for common stuff
2. Same as libgcc for gcc
![Page 38: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/38.jpg)
Compiler-RT: done
1. Surely we have all “common” libgcc functions:
• 64 bit arithmetics
• Soft floating point ops routines
• Multiplication, division, fp - int conversion ...
![Page 39: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/39.jpg)
Compiler-RT: done
1. Surely we have all “common” libgcc functions:
• 64 bit arithmetics
• Soft floating point ops routines
• Multiplication, division, fp - int conversion ...
2. (Some) EABI functions
![Page 40: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/40.jpg)
Compiler-RT: todo
1. “Unusual” EABI functions
![Page 41: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/41.jpg)
Compiler-RT: todo
1. “Unusual” EABI functions
2. Exception handling runtime
![Page 42: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/42.jpg)
Compiler-RT: todo
1. “Unusual” EABI functions
2. Exception handling runtime Time to open source / relicense EHEGI ? :)
![Page 43: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/43.jpg)
Compiler-RT: todo
1. “Unusual” EABI functions
2. Exception handling runtime
3. Something else?
![Page 44: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/44.jpg)
LLVM backend
1. Modern design
• Some parts are quite ‘unique’
2. 3 types of IR:
• SDAGs
• MachineInstr (MI)
• MachineCode (MCInst)
![Page 45: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/45.jpg)
LLVM backend: status
1. Pretty stable, can codegen many apps
![Page 46: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/46.jpg)
LLVM backend: status
1. Pretty stable, can codegen many apps
2. Supports ARMv5+, Thumb, Thumb2
3. Supports VFPv3, NEON
![Page 47: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/47.jpg)
LLVM backend: status
1. Pretty stable, can codegen many apps
2. Supports ARMv5+, Thumb, Thumb2
3. Supports VFPv3, NEON
4. Scheduling for Cortex-A8, -A9
![Page 48: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/48.jpg)
LLVM backend: status
1. Pretty stable, can codegen many apps
2. Supports ARMv5+, Thumb, Thumb2
3. Supports VFPv3, NEON
4. Scheduling for Cortex-A8, -A9
5. Emit calls to EABI functions + libgcc
![Page 49: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/49.jpg)
LLVM backend: status
1. Pretty stable, can codegen many apps
2. Supports ARMv5+, Thumb, Thumb2
3. Supports VFPv3, NEON
4. Scheduling for Cortex-A8, -A9
5. Emit calls to EABI functions + libgcc
6. ARM JIT is broken
![Page 50: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/50.jpg)
Performance Comparison
• Some benchmarks are biased towards different compilers and vice versa
![Page 51: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/51.jpg)
Performance Comparison
• Some benchmarks are biased towards different compilers and vice versa
• We still have problems with mid-level optimizers
![Page 52: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/52.jpg)
Performance Comparison
• Some benchmarks are biased towards different compilers and vice versa
• We still have problems with mid-level optimizers:
• nullstone ratio is 83% out of 100%
![Page 53: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/53.jpg)
Performance Comparison
• Some benchmarks are biased towards different compilers and vice versa
• We still have problems with mid-level optimizers:
• nullstone ratio is 83% out of 100%
• 2 tests there show ratio < 20%
![Page 54: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/54.jpg)
Performance Comparison
Generic facts:
• In average we’re quite good comparing with gcc and other compilers.
![Page 55: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/55.jpg)
Performance Comparison
Generic facts:
• In average we’re quite good comparing with gcc and other compilers.
• In some cases nice 30% speedup is seen
![Page 56: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/56.jpg)
Performance Comparison
Generic facts:
• In average we’re quite good comparing with gcc and other compilers.
• In some cases nice 30% speedup is seen
• Some cases produce 30-40% slower code than gcc: optimizer / codegen bugs
![Page 57: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/57.jpg)
Performance Comparison
Generic facts:
• In average we’re quite good comparing with gcc and other compilers.
• In some cases nice 30% speedup is seen
• Some cases produce 30-40% slower code than gcc: optimizer / codegen bugs
• LTO really helps! Can yield 50-60% speedup
![Page 58: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/58.jpg)
LLVM backend: new in 3.0
1. Improvements in NEON codegen
![Page 59: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/59.jpg)
LLVM backend: new in 3.0
1. Improvements in NEON codegen
2. Atomic stuff
![Page 60: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/60.jpg)
LLVM backend: new in 3.0
1. Improvements in NEON codegen
2. Atomic stuff
3. Calls to EABI functions, not to libgcc ones
![Page 61: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/61.jpg)
LLVM backend: new in 3.0
1. Improvements in NEON codegen
2. Atomic stuff
3. Calls to EABI functions, not to libgcc ones
4. Completely new regalloc
![Page 62: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/62.jpg)
LLVM backend: new in 3.0
1. Improvements in NEON codegen
2. Atomic stuff
3. Calls to EABI functions, not to libgcc ones
4. Completely new regalloc
5. Better inline asm handling (constraints)
6. Co-processor intrinsics
![Page 63: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/63.jpg)
MC: status
1. ‘integrated-as’ enabled by default for X86 (on ELF and Darwin)
![Page 64: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/64.jpg)
MC: status
1. ‘integrated-as’ enabled by default for X86 (on ELF and Darwin)
• ARM binary code emission is incomplete
![Page 65: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/65.jpg)
MC: status
1. ‘integrated-as’ enabled by default for X86 (on ELF and Darwin)
• ARM binary code emission is incomplete
2. Does not support bunch of directives
• e.g. everything EH-related: .fnstart, .save, ...
![Page 66: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/66.jpg)
MC: new in 3.0
1. Complete ARM assembler & disassembler support
![Page 67: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/67.jpg)
MC: new in 3.0
1. Complete ARM assembler & disassembler support:
• --integrated-as should (almost) work
![Page 68: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/68.jpg)
MC: new in 3.0
1. Complete ARM assembler & disassembler support:
• --integrated-as should (almost) work
2. MCJIT works up to some margin on arm-darwin:
• Expression evaluation in LLDB
![Page 69: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/69.jpg)
MC: still missed
1. MCJIT on non-MachO systems
2. (some) TLS
3. Direct object code emission: ELF on ARM
4. Switching between ARM / Thumb in one compilation unit
![Page 70: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/70.jpg)
Your help is needed!
1. MCJIT
2. ELF direct object code emission on ARM
3. ARM EHABI + runtime library
4. Different modes & components
5. Verification of codegen & stuff
6. Codegen for size
![Page 71: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/71.jpg)
LLVM: Overall view
• LLVM: 600k modern C++ LOC
• clang: 450k modern C++ LOC
![Page 72: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/72.jpg)
LLVM: Overall view
• LLVM: 600k modern C++ LOC
• clang: 450k modern C++ LOC
• ~200 committers, ~90 active right now
![Page 73: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/73.jpg)
LLVM: Overall view
• LLVM: 600k modern C++ LOC
• clang: 450k modern C++ LOC
• ~200 committers, ~90 active right now
• liberal license, no single copyright holder (e.g. FSF in gcc case)
![Page 74: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/74.jpg)
Usage models
Track LLVM releases
Track top-of-the-tree
![Page 75: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/75.jpg)
Usage modelsTrack releases
• Pros:
- Large distance between necessary code updates
- Releases are usually well-tested
![Page 76: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/76.jpg)
Usage modelsTrack releases
• Pros:
- Large distance between necessary code updates
- Releases are usually well-tested
• Cons:
- Large distance between necessary code updates
! Big changes required
- Need to backport fixes to private branch
! In most cases nontrivial and time-consuming
![Page 77: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/77.jpg)
Usage modelsTrack releases
• Pros:
- Large distance between necessary code updates
- Releases are usually well-tested
• Cons:
- Large distance between necessary code updates
! Big changes required
- Need to backport fixes to private branch
! In most cases nontrivial and time-consuming
LLVM releases are time-based, not feature-based
![Page 78: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/78.jpg)
Usage modelsTrack top-of-the-tree
• Pros:
- Fast mainline source updates
- Always work with fresh mainline source
- No need for bugfixes backport
![Page 79: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/79.jpg)
Usage modelsTrack top-of-the-tree
• Pros:
- Fast mainline source updates
- Always work with fresh mainline source
- No need for bugfixes backport
• Cons:
- Fast mainline source updates
- Frequent code updates necessary due to mainline change
- Possibility to “catch” mainline bug
![Page 80: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/80.jpg)
Usage modelsTrack top-of-the-tree
• Pros:
- Fast mainline source updates
- Always work with fresh mainline source
- No need for bugfixes backport
• Cons:
- Fast mainline source updates
- Frequent code updates necessary due to mainline change
- Possibility to “catch” mainline bug
One can make own releases when necessary
![Page 81: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/81.jpg)
Ways of contributingWhy contribute at all?
• Make someone else support your code: reduce maintenance costs
• Provide tests for “interesting” cases and make sure mainline is bug-free on them
• Add a possibility for the code extension / fixing by the community
![Page 82: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/82.jpg)
How to contributePatch submission
Commit-after-review model:
• Submit patch to mailing list
• Iterate until accepted
• In the end someone will commit the patch
![Page 83: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/83.jpg)
How to contributePatch submission
Commit-before-review model:
• Code owners
• Significant contributions to specific field
• Trivial stuff
![Page 84: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/84.jpg)
Standard Rules & TricksPatch submission
• Make small incremental checkins: much easier to review and show the actual progress
• Try to discuss huge changes in the ML beforehand
• Track what the other parties do: sometimes it’s possible to split (or even eliminate!) tasks
• Make sure there are no layering violations across the libraries
![Page 85: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/85.jpg)
Vendor-specific stuffHow to get your extension accepted?
• Think whether it’s possible to make the extension target-neutral (ex: naked functions)
• Make sure extension is good factored and won’t interfere with other code
• Provide exhaustive testsuite, so noone will break your code
• If possible: discuss the changes in ML beforehand
http://clang.llvm.org/get_involved.html
![Page 86: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/86.jpg)
Working with ToTHow to track mainline sources?
git & git-svn:
• Pull code into your working copy
• Much easier branching & rebasing
• Allows to pull different versions of mainline
• Public git mirror (with svn metadata) is available
![Page 87: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/87.jpg)
Interoperability Problems
1. Documentation:
• ARMv6+ Architecture Reference Manuals are closed
![Page 88: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/88.jpg)
Interoperability Problems
1. Documentation:
• ARMv6+ Architecture Reference Manuals are closed
• Few information about “internals”, e.g. pipeline stages, bypasses, functional units reservation, etc.
![Page 89: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/89.jpg)
Interoperability Problems
1. Documentation:
• ARMv6+ Architecture Reference Manuals are closed
• Few information about “internals”, e.g. pipeline stages, bypasses, functional units reservation, etc.
2. Information about new cores is closed
![Page 90: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/90.jpg)
Interoperability Problems
1. Documentation:
• ARMv6+ Architecture Reference Manuals are closed
• Few information about “internals”, e.g. pipeline stages, bypasses, functional units reservation, etc.
2. Information about new cores is closed ... but appears in gcc earlier than on arm.com
![Page 91: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/91.jpg)
Interoperability Problems
1. Documentation:
• ARMv6+ Architecture Reference Manuals are closed
• Few information about “internals”, e.g. pipeline stages, bypasses, functional units reservation, etc.
2. Information about new cores is closed ... but appears in gcc earlier than on arm.com
3. Slow / no responses to e-mails
![Page 92: Status of ARM platform support in LLVM and more Anton](https://reader031.vdocument.in/reader031/viewer/2022021223/62072fea49d709492c2ec910/html5/thumbnails/92.jpg)
Q & A