LLVM's Realtime Safety Revolution: Tools for Modern Mission Critical SystemsLLVM’s Real-time Safety Revolution Tools for Modern Mission Critical SystemsChris Apple ● 10-year veteran of the audio industry ● Previously Dolby, Roblox, Spatial Inc. ● Currently: layabout David REAL(malloc)(size); } INTERCEPTOR (void *, malloc, size_t size) { return REAL(malloc)(size); } LLVM Intermediate Representation (IR) compilation step lightweight runtime library void __rtsan_realtime_enter() each tool outside of LLVM ContrastAgenda 1. Run time vs compile time 2. False negatives and false positives 3. Cost 4. Disabling each tool 5. Using each tool outside of LLVM ContrastRun time Compile0 码力 | 153 页 | 1.38 MB | 6 月前3
Mastering C++ Modules-- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Users/hoffman/Work/llvm/llvm-inst/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - $hoffman@caprica b % ninja -v [1/10] "/Users/hoffman/Work/llvm/llvm-inst/bin/clang-scan-deps" -format=p1689 -- /Users/hoffman/Work/llvm/llvm-inst/bin/clang++ -std=gnu++20 -arch arm64 -isysroot /Li ules/simple/main.cxx -c -o CMakeFiles/hello.dir/main.cxx.o -resource-dir "/Users/hoffman/Work/llvm/llvm-inst/lib/clang/20" -MT CMakeFiles/hello.dir/main.cxx.o.ddi -MD -MF CMakeFiles/hello.dir/main.cxx0 码力 | 77 页 | 9.07 MB | 6 月前3
2020: The Year of Sanitizers?try dynamic/runtime analysis. After years of improvements and successes for Clang and GCC users, LLVM AddressSanitizer (ASan) is finally available on Windows, in the latest Visual Studio 2019 versions Sanitizers?18 2020 Victor Ciura | @ciura_victor - 2020: The Year of Sanitizers? clang-tidy clang.llvm.org/extra/clang-tidy/checks/list.html ~ 300 checks19 clang-tidy modernize-use-nullptr modernize-loop-convert clang-tidy checks 2020 Victor Ciura | @ciura_victor - 2020: The Year of Sanitizers?23 https://clang.llvm.org/extra/clang-tidy/checks/bugprone-dangling-handle.html clang-tidy bugprone-dangling-handle 〝0 码力 | 135 页 | 27.77 MB | 6 月前3
Cetting Started with C++Compiler Toolchains Clang/LLVM clang / clang++ Creates object files (.o) lld Creates executables and shared libraries (.so) ar Creates static libraries (.a) llvm Attaches to processes and Compiler Toolchains Clang/LLVM https://github.com/llvm/llvm-project/releases Building from source Repository git clone https://github.com/llvm/llvm-project.git https://llvm.org/docs/GettingStarted.html#getti Compiler Toolchains Clang/LLVM Ubuntu sudo apt-get install clang Windows MSYS - pacman -S mingw-w64-x86_64-clang macOS Install Xcode Apple Clang is not quite Clang/LLVM sudo port install clang-16Tools0 码力 | 95 页 | 4.71 MB | 6 月前3
Practical memory pool based allocators for Modern C++information injected by the allocator we need to: ● Compile the code with clang into LLVM bitcode ● Implement a custom LLVM pass(es) which would be able to: ○ Compose the list of all unique allocation types memory pool definitions ● Run the pass on the bitcode using the LLVM opt tool © 2020 Apex.AI, Inc.Compile the code with clang into LLVM bitcode ● The code should be compiled with: ○ -g to have the file:line calls ○ -emit-llvm to compile into the bitcode ○ Probably -DNDEBUG to get the Release versions of data structures Then the bitcode files can be (optionally) linked together with llvm-link © 2020 Apex0 码力 | 49 页 | 986.95 KB | 6 月前3
Just-In-Time Compilation: The Next Big Thing11HOW IT WORKS? - DETAILS HOW IT WORKS? - DETAILS HTTPS://GITHUB.COM/HFINKEL/LLVM-PROJECT-CXXJIT HTTPS://GITHUB.COM/HFINKEL/LLVM-PROJECT-CXXJIT 5 . 12EXAMPLES: C++20 AND BEYOND EXAMPLES: C++20 AND BEYOND dispatch(std::stoi(argv[1])); } $LLC -filetype=obj dispatch.ir -o dispatch.o # IR to an object file LLVM STATIC COMPILER LLVM STATIC COMPILER 6 . 12SAVE LIBRARY/BINARY SAVE LIBRARY/BINARY MAIN.CPP MAIN.CPP LLC - to an object file $CXX $CXXFLAGS dispatch.o main.cpp -o dispatch # No `-fjit` required LLVM STATIC COMPILER LLVM STATIC COMPILER 6 . 12SAVE LIBRARY/BINARY SAVE LIBRARY/BINARY MAIN.CPP MAIN.CPP LLC -0 码力 | 222 页 | 5.45 MB | 6 月前3
Adventures in SIMD Thinking (Part 2 of 2)Reference Libraries • iconv – GNU libiconv, used here as the “gold standard” • LLVM – UTF conversion functions from the LLVM distribution • AV – UTF-8 to UTF-32 conversion by Alexey Vatchenko • std::codecvt 2500 3000 3500 english_wiki.txt chinese_wiki.txt hindi_wiki.txt Conversion Time (msec) iconv llvm av std::codecvt Boost.Text Hoehrmann kewb-basic kewb-fast kewb-sse kewb-avxCopyright © 2020 3000 3500 portuguese_wiki.txt russian_wiki.txt swedish_wiki.txt Conversion Time (msec) iconv llvm av std::codecvt Boost.Text Hoehrmann kewb-basic kewb-fast kewb-sse kewb-avxCopyright © 20200 码力 | 135 页 | 551.08 KB | 6 月前3
A Long Journey of Changing std::sort Implementation at Scalethe same 16.4INTROSORT (WORST CASE) 17LLVM libc++ did not do anything at all for a long time 18LLVM libc++ did not do anything at all for a long time 18.1LLVM libc++ did not do anything at all for a long time 7 years 18.2Only 0.01% of all calls got into the heap sort fallback in production 19LLVM (HISTORY) 20What is a good sort? 21What is a good sort? O(nlogn) comparisons 21.1What is a good 4https://discourse.llvm.org/t/rfc-strict-weak-ordering- checks-in-the-debug-libc/70217 55OOB check in 36d8b4 56Submitted SWO checks for std::{stable_,partial_}sort and rolled out in LLVM 17 in -D_LIB0 码力 | 182 页 | 7.65 MB | 6 月前3
Code Analysis++Lifetime safety: http://wg21.link/ p1179 ○ Owner & Pointer ○ Built-in compiler check ○ Current LLVM implementation gives 5% overhead ○ Annotations to help analysis: gsl::SharedOwner, gsl::Owner Value Range AnalysisData Flow Analysis: CTU – Cross Translation Unit (CTU) Analysis: https://clang.llvm.org/docs/analyzer/user-docs/CrossTranslationUnit.html CodeChecker https://github.com/Ericsson/ Lifetime safety ● Data Flow Analysis ● C++ Core Guidelines ● Clang-TidyClang-Tidy – https://clang.llvm.org/extra/clang-tidy/checks/list.html abseil-* (18), android-* (15), cert-* (35), Clang0 码力 | 61 页 | 2.70 MB | 6 月前3
Just-in-Time Compilation - J F Bastien - CppCon 2020NaCl portable, by running LLVM inside an NaCl sandbox, having it generate NaCl code, and validating the generated code before executing it, therefore it doesn’t trust that LLVM is correct to be secure.While deep-dives into various JiT compilers’ vulnerabilities.Emscripten an LLVM-to-JavaScript compiler — 2011 We presented Emscripten, an LLVM-to-JavaScript compiler, which opens up numerous opportunities for web as well, for example Python and Lua. (read)Emscripten an LLVM-to-JavaScript compiler — 2011 We presented Emscripten, an LLVM-to-JavaScript compiler, which opens up numerous opportunities for0 码力 | 111 页 | 3.98 MB | 6 月前3
共 112 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12













