-
Notifications
You must be signed in to change notification settings - Fork 0
Blueprint 05 Compiler
Source:
docs/blueprint/05-compiler.mdin the main repository.
Force the compiler to emit the machine code you mean — then keep that code small.
Tooling deep-dive (ARM vs Intel, cross-compilation, flags):
docs/tutorials/modern-cpp-tooling-arm-intel.md.
| Topic | Status |
|---|---|
| C++26 as project default | SHIPPED |
| constexpr / consteval | DOC + encourage in modules |
| CRTP / static polymorphism | ll::StaticInterface |
[[likely]] / [[unlikely]]
|
LL_LIKELY / LL_UNLIKELY
|
| LTO / PGO / ISA flags | DOC (portable defaults in CMake) |
| i-cache discipline | DOC (critical) |
constexpr double tick_size = 0.01;
consteval int scale() { return 100; }Push parsing of static config, hash tables of constants, and protocol tags to compile time when possible.
struct Feed : ll::StaticInterface<Feed> {
void on_tick() { /* ... */ }
};
// call feed.self().on_tick() — resolved statically, no vptrPrefer std::variant + std::visit for closed sets of message types.
if (LL_UNLIKELY(error)) {
handle_cold_path();
}Cold error paths should not pollute the i-cache working set of the hot loop.
| Goal | Flags |
|---|---|
| Portable release |
-O3 -flto (optional) |
| Local max performance |
-O3 -flto -march=native (not for portable artifacts) |
| PGO | build + train + rebuild with profile data |
This repo avoids hard-coding -march=native in shared CMake so CI and laptops stay portable; document native builds for production images.
Instruction cache misses from huge binaries often hurt more than one extra data load.
Practices:
- Split diagnostics / logging from hot TUs
- Avoid heavy templates on the absolute critical path
- Prefer few, predictable branches
- Profile with
perf(icache,iTLB)
#include "ll/branch.hpp"Wiki mirror of repository docs. Edit docs/ in the main repo, then python3 scripts/publish_wiki.py.