Sources
21 entries in 4 parts
In the MCP server
cpuperf://section/8

Reading emitted code

  1. 01
    Compiler Explorer repository

    Shows how a source change alters the emitted instructions across compilers, versions and flags, with nothing installed.

  2. 02
    What Every C Programmer Should Know About Undefined Behavior report

    Explains how the signed-overflow and aliasing rules let a trip count be known and a store loop become memset.

  3. 03
    llvm-objdump manual

    Reads the binary that shipped, with source lines and symbolised branch targets, rather than a recompiled snippet.

  4. 04
    llvm-mca manual

    Predicts loop throughput and port pressure from the scheduling model, and states it models neither front end nor caches.

  5. 05
    llvm-exegesis manual

    Measures instruction latency and throughput with counters, so the model llvm-mca predicts from is checked, not trusted.

  1. 01
    Options That Control Optimization (GCC) manual

    Lists what each -O level turns on, the inlining limits, and that -Ofast admits transforms invalid for conforming code.

  2. 02
    There Are No Zero-cost Abstractions (CppCon 2019) talk

    Shows with real codegen that an abstraction is free only when inlining and the ABI allow it, and the cost when either refuses.

  3. 03
    Itanium C++ ABI manual

    Fixes the rule that a non-trivial class goes by reference to a caller-made temporary, the cost a wrapped pointer pays.

  4. 04
    How To Write Shared Libraries paper

    States what PLT calls and interposition cost, and the visibility controls a library needs to inline its own exports.

  5. 05
    LTO Overview (GCC Internals) manual

    Defines whole-program LTO against partitioned WHOPR, and the LGEN, WPA and LTRANS stages that run -flto in parallel.

  6. 06
    ThinLTO manual

    Defines the thin link, summaries analysed whole-program then parallel backends, and the cache for incremental rebuilds.

Target flags and auto-vectorisation

  1. 01
    x86 Options (GCC) manual

    Defines -march against -mtune, the psABI levels, and -mprefer-vector-width, the switch for full-width AVX-512 code.

  2. 02
    Function Multiversioning (GCC) manual

    Defines target_clones, one function per ISA behind a resolver the dynamic linker runs, so a generic build ships AVX-512.

  3. 03
    Controlling Floating Point Behavior (Clang) manual

    Lists what -ffast-math implies, of which -fassociative-math alone frees a float reduction, and -ffp-contract for FMA.

  4. 04
    Auto-Vectorization in LLVM manual

    States what the vectorisers need, aliasing disproved or checked at run time, and where a float reduction stays in order.

  5. 05
    Options to Emit Optimization Reports (Clang) manual

    Defines the remarks that make the compiler say which loop it left scalar and why, so the fix targets the real blocker.

Reproduce it

the vectoriser with and without restrict.

Reproduce it · 08-autovectorization-aliasing Auto-vectorisation and aliasing The vectoriser gives up on possible aliasing; a qualifier fixes it

Profile-guided and post-link optimisation

  1. 01
    Profile Guided Optimization (Clang) manual

    Defines the instrumented and sampled workflows, why their profiles cannot mix, and the cost of a wrong training input.

  2. 02
    AutoFDO: Automatic Feedback-Directed Optimization for Warehouse-Scale Applications paper

    Defines the address-to-source mapping with discriminators that lets a stale production profile still drive FDO.

  3. 03
    BOLT: A Practical Binary Optimizer for Data Centers and Beyond paper

    States why a profile applied to the final binary beats one mapped to source, and the layout passes accuracy enables.

  4. 04
    BOLT (llvm-project/bolt) repository

    States what full effect needs, relocations kept at link time and a branch-stack sample profile, neither on by default.

  5. 05
    RFC: Propeller: A frame work for Post Link Optimizations report

    States the design, not a result: basic-block sections and a relink, no binary rewrite, so layout needs no disassembly.