llvm / llvm/llvm-project

[C++] Support `__builtin_observable_checkpoint`

Open
#159,287 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clang:codegen clang:frontend llvm:ir
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

To support P1494 we need a built-in that lowers to an IR instruction that would behave like an opaque function and would resist time travel UB during optimisation.

__builtin_observable_checkpoint is the name that has been chosen by GCC.

I'm happy to implement the builtin in clang once we know what to lower it too.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading P1494 and the existing discussion in this issue. No files, tests, or lowering entry points are named, so first determine the required IR instruction semantics and where Clang should implement the builtin. Done means an agreed lowering design and a working __builtin_observable_checkpoint implementation with suitable coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.