rust-lang / rust-lang/rustc_codegen_gcc

Simplify generate_intrinsics.py

Open
#575 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
1.2k
Forks
105
Avg merge
8h 20m
Merged PRs (30d)
14

Description

Currently it tries to fetch data from three sources:

The last two sources are because the last commit on llvm-project may have removed some intrinsics that stdarch uses. It should be possible to simplify this to just Intrinsics.td from llvm-project by picking the exact commit that the nightly version against which cg_gcc will build uses as LLVM version. If any intrinsics are removed there, stdarch has had to stop using them before, so the removal of the intrinsic wouldn't matter.

The manual parsing of llvm-tblgen output could also likely be replaced by usage of the --dump-json flag.

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 with generate_intrinsics.py and trace how it fetches Intrinsics.td and the two llvmint sources. Check the LLVM commit used by the cg_gcc nightly build, then investigate llvm-tblgen's --dump-json output; done means the generator relies on the selected llvm-project source and no longer manually parses that output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
compilers, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.