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

Stop using hash_raw_entry in CodegenCx::const_str #137741

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Feb 27, 2025

That unstable feature (#56167) completed fcp-close, so the compiler needs to be
migrated away to allow its removal. In this case, cg_llvm and cg_gcc
were using raw entries to optimize their const_str_cache lookup and
insertion. We can change that to separate get and (on miss) insert
calls, so we still have the fast path avoiding string allocation when
the cache hits.

That unstable feature completed fcp-close, so the compiler needs to be
migrated away to allow its removal. In this case, `cg_llvm` and `cg_gcc`
were using raw entries to optimize their `const_str_cache` lookup and
insertion. We can change that to separate `get` and (on miss) `insert`
calls, so we still have the fast path avoiding string allocation when
the cache hits.
@fmease fmease closed this Feb 27, 2025
@fmease fmease reopened this Feb 27, 2025
@fmease
Copy link
Member

fmease commented Feb 27, 2025

(triagebot currently faces timeouts from GH since it's too slow to process events sometimes)

r? compiler

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 27, 2025
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 1, 2025

📌 Commit 396c2a8 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 1, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 2, 2025
…k-Simulacrum

Stop using `hash_raw_entry` in `CodegenCx::const_str`

That unstable feature (rust-lang#56167) completed fcp-close, so the compiler needs to be
migrated away to allow its removal. In this case, `cg_llvm` and `cg_gcc`
were using raw entries to optimize their `const_str_cache` lookup and
insertion. We can change that to separate `get` and (on miss) `insert`
calls, so we still have the fast path avoiding string allocation when
the cache hits.
tgross35 added a commit to tgross35/rust that referenced this pull request Mar 2, 2025
…k-Simulacrum

Stop using `hash_raw_entry` in `CodegenCx::const_str`

That unstable feature (rust-lang#56167) completed fcp-close, so the compiler needs to be
migrated away to allow its removal. In this case, `cg_llvm` and `cg_gcc`
were using raw entries to optimize their `const_str_cache` lookup and
insertion. We can change that to separate `get` and (on miss) `insert`
calls, so we still have the fast path avoiding string allocation when
the cache hits.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 3, 2025
…k-Simulacrum

Stop using `hash_raw_entry` in `CodegenCx::const_str`

That unstable feature (rust-lang#56167) completed fcp-close, so the compiler needs to be
migrated away to allow its removal. In this case, `cg_llvm` and `cg_gcc`
were using raw entries to optimize their `const_str_cache` lookup and
insertion. We can change that to separate `get` and (on miss) `insert`
calls, so we still have the fast path avoiding string allocation when
the cache hits.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 3, 2025
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#132388 (Implement `#[cfg]` in `where` clauses)
 - rust-lang#134900 (Fix parsing of ranges after unary operators)
 - rust-lang#136938 (Remove `:` from `stack-protector-heuristics-effect.rs` Filecheck Pattern)
 - rust-lang#137054 (Make phantom variance markers transparent)
 - rust-lang#137525 (Simplify parallelization in test-float-parse)
 - rust-lang#137618 (Skip `tidy` in pre-push hook if the user is deleting a remote branch)
 - rust-lang#137685 (self-contained linker: conservatively default to `-znostart-stop-gc`)
 - rust-lang#137741 (Stop using `hash_raw_entry` in `CodegenCx::const_str`)
 - rust-lang#137849 (Revert "Remove Win SDK 10.0.26100.0 from CI")
 - rust-lang#137862 (ensure we always print all --print options in help)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 3, 2025
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#132388 (Implement `#[cfg]` in `where` clauses)
 - rust-lang#134900 (Fix parsing of ranges after unary operators)
 - rust-lang#136938 (Remove `:` from `stack-protector-heuristics-effect.rs` Filecheck Pattern)
 - rust-lang#137054 (Make phantom variance markers transparent)
 - rust-lang#137525 (Simplify parallelization in test-float-parse)
 - rust-lang#137618 (Skip `tidy` in pre-push hook if the user is deleting a remote branch)
 - rust-lang#137685 (self-contained linker: conservatively default to `-znostart-stop-gc`)
 - rust-lang#137741 (Stop using `hash_raw_entry` in `CodegenCx::const_str`)
 - rust-lang#137849 (Revert "Remove Win SDK 10.0.26100.0 from CI")
 - rust-lang#137862 (ensure we always print all --print options in help)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 3, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#132388 (Implement `#[cfg]` in `where` clauses)
 - rust-lang#134900 (Fix parsing of ranges after unary operators)
 - rust-lang#136938 (Remove `:` from `stack-protector-heuristics-effect.rs` Filecheck Pattern)
 - rust-lang#137054 (Make phantom variance markers transparent)
 - rust-lang#137525 (Simplify parallelization in test-float-parse)
 - rust-lang#137618 (Skip `tidy` in pre-push hook if the user is deleting a remote branch)
 - rust-lang#137741 (Stop using `hash_raw_entry` in `CodegenCx::const_str`)
 - rust-lang#137849 (Revert "Remove Win SDK 10.0.26100.0 from CI")
 - rust-lang#137862 (ensure we always print all --print options in help)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 3, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#132388 (Implement `#[cfg]` in `where` clauses)
 - rust-lang#134900 (Fix parsing of ranges after unary operators)
 - rust-lang#136938 (Remove `:` from `stack-protector-heuristics-effect.rs` Filecheck Pattern)
 - rust-lang#137054 (Make phantom variance markers transparent)
 - rust-lang#137525 (Simplify parallelization in test-float-parse)
 - rust-lang#137618 (Skip `tidy` in pre-push hook if the user is deleting a remote branch)
 - rust-lang#137741 (Stop using `hash_raw_entry` in `CodegenCx::const_str`)
 - rust-lang#137849 (Revert "Remove Win SDK 10.0.26100.0 from CI")
 - rust-lang#137862 (ensure we always print all --print options in help)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit fd4bf82 into rust-lang:master Mar 4, 2025
12 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 4, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2025
Rollup merge of rust-lang#137741 - cuviper:const_str-raw_entry, r=Mark-Simulacrum

Stop using `hash_raw_entry` in `CodegenCx::const_str`

That unstable feature (rust-lang#56167) completed fcp-close, so the compiler needs to be
migrated away to allow its removal. In this case, `cg_llvm` and `cg_gcc`
were using raw entries to optimize their `const_str_cache` lookup and
insertion. We can change that to separate `get` and (on miss) `insert`
calls, so we still have the fast path avoiding string allocation when
the cache hits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants