HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
llvm-mirror
llvm
LLVM2013–2022
llvm-mirror / llvm · Archived

llvm

Project moved to: https://github.com/llvm/llvm-project

41Distinct people
49Mentions
1Explicit recommenders
4.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Project moved to: https://github.com/llvm/llvm-project

GitHub

Where it is used

The source check is incomplete. Verified examples will appear here.

What people are saying

I recommend the LLVM source code. I've worked a bit with it implementing toy compilers and using LLVM as a backend for generating x86/SPARC object code. Just compiling it is a…

palotasb used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year49 dated mentions

Observed mentions: 2013-08-09 06:19:32 UTC to 2022-10-16 10:06:36 UTC.

0369122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 9 mentions; 2 submissions, 7 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 8 mentions; 0 submissions, 8 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 12 mentions; 0 submissions, 12 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC101
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC615
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC927
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC707
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC808
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC12012
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC303
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
The LLVM Compiler Infrastructure ================================ This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments. LLVM is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt. Please see the documentation provided in docs/ for further assistance with LLVM, and in particular docs/GettingStarted.rst for getting started with LLVM and docs/README.txt for an overview of LLVM's documentation setup. If you are writing a package for LLVM, see docs/Packaging.rst for our suggestions.
Read the full README on GitHub

What Hacker News says

49 sources
UTF-8 vs UTF-16 vs UTF-32 encoding/decoding are just simple bit-twiddling transformations [1], you don't need a 'complete UNICODE implemenentation' for this (and ISO/IEC be damned, those conversion functions would still be useful to have in the C and C++ stdlibs without full 'UNICODE support' - which is hardly needed anyway, unless you're doing 'actual' text processing or need to write your own text renderer) [1] https://github.com/llvm-mirror/llvm/blob/master/lib/Support/...
In The Wonderfully Terrible World of C and C++ Text Encoding APIs (With Some Rust)
palotasb·Oct 28, 2020Recommendation phrase
I recommend the LLVM source code. I've worked a bit with it implementing toy compilers and using LLVM as a backend for generating x86/SPARC object code. Just compiling it is a nice exercise if you're new to C++ and CMake (as I was, then). I would start by reading the LLVM Programmer's Manual [prog man] and the LLVM Coding Standards [code stand] and looking up how the code they reference and the examples are implemented and how they interact with each other. You can browse the code in the LLVM Mirror Git repository [llvm-git] or the cross-referenced Doxygen [llvm-doxy] (has very useful links!). If you're willing to spend the time it might be worth setting up the codebase in your IDE of choice with the proper integrations to be able to browse and cross-reference the source code there. There is a lot to learn especially from the Important an
Read the rest
d useful LLVM APIs and Picking the Right Data Structure for a Task (and the corresponding code) in the Programmer's Manual. The data structures under llvm/ADT could be especially useful to look at. They are good generic data structures that you may even want to directly reuse in your own project, but they are much easier on the eyes and closer to what you and I would want to see in our own codebases than the source code of the standard library or the Boost data structures. [prog man]: https://releases.llvm.org/4.0.1/docs/ProgrammersManual.html [code stand]: https://releases.llvm.org/4.0.1/docs/CodingStandards.html [llvm-git]: https://github.com/llvm-mirror/llvm [llvm-doxy]: http://llvm.org/doxygen/modules.html PS. The Coding Standards will contain a lot of subjective stuff that makes sense inside LLVM for consistency but you don't want to adopt verbatim into an existing (maybe not even a green field) project, like naming variables with Capital letters. You can skim these parts, but it might be useful to know about the existence of these types of issues.
In Ask HN: Good C++ code bases to read?
https://docs.microsoft.com/en-us/cpp/build/x64-calling-conve... After you read that, you might want to look at the LLVM source https://github.com/llvm-mirror/llvm/blob/master/lib/Target/X... /// The C convention as implemented on Windows/x86-64 and /// AArch64. This convention differs from the more common /// \c X86_64_SysV convention in a number of ways, most notably in /// that XMM registers used to pass arguments are shadowed by GPRs, /// and vice versa. /// On AArch64, this is identical to the normal C (AAPCS) calling /// convention for normal functions, but floats are passed in integer /// registers to variadic functions.
In x86 Assembly Guide (2018)
But it is aided by tail-call optimization. Suppose you have a function as follows: int foo(int x) { if (test(x)) return C; return evaluate(x) + foo(adjust(x)); } I can turn that function into: int foo(int x) { int accum = C; for ( ; !test(x); x = adjust(x)) { accum += evaluate(x); } return accum; } In the case of fibonacci, that equates to: int fib(int x) { int accum = 1; for (; x > 1; x -= 2) { accum += fib(x - 1); } return accum; } We still turned the recursive call (or one of them, at least), into a while loop. And this idiom is recognized by both gcc and llvm. In fact. llvm has a test that specifically makes sure fib is transformed as thus: https://github.com/llvm-mirror/llvm/blob/30fa583f8430bfc7935...
In Recursive fibonacci benchmark using top languages on GitHub
This is definitely wrong :) Besides Richard, who is the code owner of the clang frontend , chandler is the #5 contributor to LLVM (see here https://github.com/llvm-mirror/llvm/graphs/contributors), and a quick trip to llvm-dev will tell you how much time he spends working on optimizations :) FWIW: The GCC folks i pinged were similarly unenamored with the idea of trying to elide allocation all the time. Personally, i've seen a bunch of these "required optimizations" over the years, and they rarely pan out without significant help. (IE required tail call optimization usually requires special marking/calling convention change, etc). Full disclosure: Chandler, Geoff, and Richard are in my org, and i am theoretically their boss's boss. I say theoretically because it's pretty meaningless - i'm not going to tell Richard how to do C++.
In C++ Core Coroutines Proposal [pdf]
The llvm compiler has it's optimization routines here: https://github.com/llvm-mirror/llvm/tree/master/lib/Transfor... You can play around with how it takes in llvm code to optimized llvm code by using the opt tool. Here's a basic example. $ cat test.c #include <stdio.h> int main() { for (int i = 0; i < 3; i++) { printf("hello world"); } } $ clang -c -S -emit-llvm test.c $ cat test.ll ** too long replacing with gist** https://gist.github.com/cwgreene/b6f33d40ad735a448ed15057d91fdbdc $ opt -S -print-before-all -O2 test.ll ** too long, replacing with gist** https://gist.github.com/cwgreene/99b3075dbfffae35a5745934ded217fb ** final result** @.str = private unnamed_addr constant [12 x i8] c"hello world\00", align 1 ; Function Attrs: nounwind uwtable define i32 @main() #0 { entry: %call = ta
Read the rest
il call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)) #2 %call.1 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)) #2 %call.2 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)) #2 ret i32 0 } The command `opt -S -print-before-all -O2` can be manually modified to specify exactly which compiler passes you want to see. You can run `opt --help` to see a list of all compiler passes. (you can figure out what code performs by looking at the * * * IR Dump Before `MODULE NAME` * * * and finding the associated logic in the Lib directory) In the case of llvm, the idea for them is they break the code into things called 'basic blocks' which, along with using Single Static Assignment, are more easily analyzed, transformed, and simplified.
In Oops, I Wrote a C++ Compiler
I'm not an expert in this field, also currently in learning mode. > You said you were working on another JIT - what was that? A JIT for a custom 32-bit RISC soft-CPU (FPGA). > Also, do you have any suggestions of another project/language to implement compiler for to gain some knowledge about writing optimizations, actual intepretation/compilation logic, etc? You could write another C compiler. Or a JIT for some scripting language. Lua is about as simple as it gets when it comes to JITtable scripting languages. Of course amazing http://luajit.org/ already exists. Existing CPUs and bytecode formats are also potentially good. In particular, other people might actually want to use a small WebAssembly (https://webassembly.org/) AOT/JIT compiler. I know I would. :) Some source code I've personally found educating on this topic: 1) Lots of easie
Read the rest
r stuff (ARM/x86 encoding, basic optimizations, etc.) can be found in JITting emulators, like Dolphin: (https://github.com/dolphin-emu/dolphin) 2) Web browser Javascript engines, like (https://github.com/v8/v8/tree/master/src). And of course LuaJIT. 3) Compiler codegen, like LLVM (https://github.com/llvm-mirror/llvm)
In Uefi-jitfuck – A JIT Brainfuck compiler running on x86_64 UEFI
Thanks. Unless something is escaping me, that's an optimizer bug. I'm pretty sure the ABI allows you to do whatever you want with the sret pointer, including passing it to another function to chain return for free. I guess you could say that RVO is more robust since it's implemented in the frontend and does not rely on finding the optimization after a fair amount of lowering. Edit: I don't have time to debug this but at least for llvm, I think this optimization should trigger in the optimizer's memcpy elimination pass ( https://github.com/llvm-mirror/llvm/blob/0818e789cb58fbf6b5e... ). However I don't see why clang could not simply apply the RVO logic to C code as well.
In One year of C

Showing the 15 most recent of 49 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.