Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intrinsics require investigation #13

Open
dkcumming opened this issue Oct 28, 2024 · 0 comments
Open

Intrinsics require investigation #13

dkcumming opened this issue Oct 28, 2024 · 0 comments
Assignees

Comments

@dkcumming
Copy link
Collaborator

dkcumming commented Oct 28, 2024

Goal

  • Find the definitive set of intrinics as we will see them in the MIR / SMIR
  • Strip the instrinsics that we care about
  • Find appropriate tests to examine intrinsics
  • Observe that instrinsics are working as we expect and we are handling correctly

Sources

  • ui/compiletest
  • cargo build -Z build-std --target <TARGET> e.g. cargo build -Z build-std --target x86_64-unknown-linux-gnu more info can be found in Stephen's hack.md and cargo reference
    NOTE: This is a cargo flag not rustc flag.
    This will throw attempting to add the flags with smir_pretty with
error: "/home/daniel/Applications/mir-semantics/deps/smir_pretty/deps/rust/src/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/Cargo.lock" does not exist, unable to build with the standard library, try:
        rustup component add rust-src --toolchain smir_serde_derive_intern_scripts

meaning that the the rust-src component is required for the toolchain. However it will not be able to do this for smir_serde_derive_intern_scripts as it is our own fork branch (If there is a way let me know).
But the compiler can be set to the same version the that is the base of the smir_serde_derive_intern_scripts fork with rustup defaulting to the day subsequent to the last rustc commit:

rustup default nightly-2024-07-27
rustup component add rust-src --toolchain nightly-2024-07-27-x86_64-unknown-linux-gnu

Then the artefacts of the std-lib can be found in <PROJECT ROOT>/target/<TARGET> e.g. hello-world/target/x86_64-unknown-linux-gnu.

Questions for the investigation:

  • What are the names of all the intrinsics
    • Rv rust fork: get_instrincs.sh gets the names at source level
    • Need to find the mangled names

Noticed Behaviour

  • Sometimes the compiler generates a mir body for the intrinsic?
    • Suspect: If LLVM knows the intrinsic then it doesn't generate a mir body
  • Sometimes intrinsics are generic?
@dkcumming dkcumming self-assigned this Oct 29, 2024
@dkcumming dkcumming changed the title Some intrinsics are not serialising properly Intrinsics require investigation Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant