-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 LLVM struct types for array/pointer offset GEPs #122325
base: master
Are you sure you want to change the base?
Conversation
This avoids depending on LLVM's struct types to determine the size of the array/pointer element.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Stop using LLVM struct types for array/pointer offset GEPs ...and just use a byte array with the same size as the element type instead. This avoids depending on LLVM's struct layout to determine the size of the array/pointer element. Spiritually split out from rust-lang#121577. r? `@nikic`
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (7ba692d): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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 sizeResultsThis 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.
Bootstrap: 647.708s -> 643.848s (-0.60%) |
GCC uses a start/end pointer instead of the index-based loop on LLVM, so it has a "GEP" here that needs to be converted for consistency with project_index
Some changes occurred in compiler/rustc_codegen_gcc |
I'm not sure this is a particularly useful change to make at this time. |
This isn't really about But given that this pattern is likely to get a proper untyped representation in the future (with scaled ptradd or something), I'm fine if you want to wait for that. † ...and a few unfortunate special cases: volatile load/store, |
@nikic Do you think we should wait for a proper untyped representation in LLVM IR as @erikdesjardins mentions or should we consider merging this? |
I think it's better to wait. LLVM still has some source element type dependent logic for variable index GEPs, and I don't think there's much benefit to making this change early. |
As per the previous comment, I'll try signaling this with: @rustbot label -S-waiting-on-review +S-blocked |
...and just use a byte array with the same size as the element type instead. This avoids depending on LLVM's struct layout to determine the size of the array/pointer element.
Spiritually split out from #121577.
r? @nikic