Skip to content

Remove TypeKind from rustc_codegen_ssa - #164924

Open
beetrees wants to merge 1 commit into
rust-lang:mainfrom
beetrees:no-ssa-type-kind
Open

beetrees wants to merge 1 commit into
rust-lang:mainfrom
beetrees:no-ssa-type-kind

Conversation

@beetrees

@beetrees beetrees commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

TypeKind is a very LLVM-shaped enum (e.g. there is a single TypeKind::Integer but multiple variants for floats because that's what LLVM does) - other backends (e.g. rustc_codegen_gcc) usually don't have a single call to get the required information and have to check for each variant individually, even though most callers only care if a type is one or at most a few variants. This PR removes TypeKind and cx.type_kind() from rustc_codegen_ssa, replacing them with Option-returning methods int_width, float_type and vector_element_type_and_length.

cc @antoyo for rustc_codegen_gcc

r? @bjorn3

@rustbot

rustbot commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

Some changes occurred in compiler/rustc_codegen_llvm/src/builder/autodiff.rs

cc @ZuseZ4

@rustbot rustbot added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Oct 25, 2026
@rustbot rustbot added F-autodiff `#![feature(autodiff)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 25, 2026

@GuillaumeGomez GuillaumeGomez left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much easier to read, I like it. 👍

View changes since this review

@rust-log-analyzer

This comment has been minimized.

Comment thread compiler/rustc_codegen_gcc/src/type_.rs Outdated
Comment thread compiler/rustc_codegen_ssa/src/traits/type_.rs
Comment thread compiler/rustc_codegen_ssa/src/traits/type_.rs Outdated
@rust-log-analyzer

This comment has been minimized.

@antoyo

antoyo commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

The failure is a know issue currently being resolved: #164929

Comment thread compiler/rustc_codegen_gcc/src/builder.rs Outdated
Comment thread compiler/rustc_codegen_gcc/src/int.rs Outdated
Comment thread compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs
Comment thread compiler/rustc_codegen_llvm/src/type_.rs Outdated
Comment thread compiler/rustc_codegen_gcc/src/intrinsic/simd.rs Outdated
@beetrees
beetrees force-pushed the no-ssa-type-kind branch 4 times, most recently from 0b25baf to 4a47ac5 Compare October 25, 2026 23:40
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

Comment thread compiler/rustc_codegen_llvm/src/builder.rs Outdated
Comment thread compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs Outdated
Comment thread compiler/rustc_codegen_llvm/src/intrinsic.rs Outdated
@rustbot

This comment has been minimized.

@bjorn3

bjorn3 commented Oct 27, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 599ce90 has been approved by bjorn3

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 27, 2026
@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@beetrees

Copy link
Copy Markdown
Contributor Author

@bors r=bjorn3

@rust-bors

rust-bors Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7e1341e has been tentatively approved by bjorn3

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. F-autodiff `#![feature(autodiff)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants