-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustc_codegen_llvm
cleanups
#130506
rustc_codegen_llvm
cleanups
#130506
Conversation
Some changes occurred in compiler/rustc_codegen_gcc Some changes occurred in coverage instrumentation. cc @Zalathar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT the changes look good, and they do make the code nicer to read 👍 Some of the changes are a bit more subtle (like the hidden visibility logic), so I would like someone else to also take a look.
set_math_builder_methods! { | ||
fadd_fast(x, y) => (LLVMBuildFAdd, LLVMRustSetFastMath), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remark: I do like how these look 👍
☔ The latest upstream changes (presumably #130519) made this pull request unmergeable. Please resolve the merge conflicts. |
9f62143
to
e9582bb
Compare
The hidden visibility commit is definitely the trickiest one! I have fixed the conflicts and updated. |
☔ The latest upstream changes (presumably #130534) made this pull request unmergeable. Please resolve the merge conflicts. |
These can be made more concise, mostly through appropriate use of `use` declarations.
This seems to be a typo. `singletree` doesn't make sense, and everywhere else it is `singlethread`.
By using `use`.
Similar to the existing macro just above.
We rarely use parameter comments, and these ones don't tell us anything interesting.
In `get_fn` there is a complicated set of if/elses to determine if `hidden` visibility should be applied. There are five calls to `LLVMRustSetVisibility` and some repetition in the comments. This commit streamlines it a bit: - Computes `hidden` and then uses it to determine if a single call to `LLVMRustSetVisibility` occurs. - Converts some of the if/elses into boolean expressions. - Removes the repetitive comments. Overall this makes it quite a bit shorter, and I find it easier to read.
It's crazy to have the integer methods in something close to random order. The reordering makes the gaps clear: `const_i64`, `const_i128`, `const_isize`, and `const_u16`. I guess they just aren't needed.
I'm pretty sure `CodegenCx` applies to codegen units, rather than compilation units.
Through judicious use of `use` and `Self`.
So they are less than 100 chars.
e9582bb
to
1f35940
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I looked at the hidden visibility changes again, and I think the restructure is correct (as in I think it does preserve the original logic). Please r=me after PR CI is green.
@bors r=jieyouxu |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1a5a224): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 3.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 3.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 769.323s -> 768.108s (-0.16%) |
Some improvements I found while reading through this crate's code.
r? @michaelwoerister