-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Prepare GEP building for opaque pointers #87695
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
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @nagisa |
@@ -103,12 +103,13 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> { | |||
if offset == a.value.size(bx.cx()).align_to(b.value.align(bx.cx()).abi) => | |||
{ | |||
// Offset matches second field. | |||
bx.struct_gep(self.llval, 1) | |||
let ty = bx.backend_type(self.layout); | |||
bx.struct_gep(ty, self.llval, 1) | |||
} | |||
Abi::Scalar(_) | Abi::ScalarPair(..) | Abi::Vector { .. } if field.is_zst() => { | |||
// ZST fields are not included in Scalar, ScalarPair, and Vector layouts, so manually offset the pointer. | |||
let byte_ptr = bx.pointercast(self.llval, bx.cx().type_i8p()); |
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.
Is it necessary to pointercast this self.llval
anymore?
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.
When an explicit pointee type is provided it must be equal to the pointer element type, so this will have to wait until migration to opaque pointers is complete:
@@ -185,7 +189,7 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> { | |||
|
|||
// Cast and adjust pointer. | |||
let byte_ptr = bx.pointercast(self.llval, bx.cx().type_i8p()); |
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.
Similarly here.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 6aafd29e3d4588c170d88707da1f90308843d33f with merge 414880045b5e5aa73962982e332456daa6a1162a... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
Imlement struct_gep using LLVMBuildStructGEP2 which takes an explicit type argument instead of deriving it from a pointer type.
Implement gep using LLVMBuildGEP2 which takes an explicit type argument instead of deriving it from a pointer type.
Implement inbounds_gep using LLVMBuildInBoundsGEP2 which takes an explicit type argument instead of deriving it from a pointer type.
A custom reimplementation of LLVMConstInBoundsGEP2 is used, since the LLVM contains a declaration of LLVMConstInBoundsGEP2 but not the implementation.
6aafd29
to
8e0df32
Compare
|
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 8e0df32 with merge 83871193ae29d0a5032d80fd9102b851d62bbb4f... |
☀️ Try build successful - checks-actions |
Queued 83871193ae29d0a5032d80fd9102b851d62bbb4f with parent 87d713f, future comparison URL. |
Finished benchmarking try commit (83871193ae29d0a5032d80fd9102b851d62bbb4f): comparison url. Summary: This benchmark run did not return any significant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. @bors rollup=never |
@bors r+ |
📌 Commit 8e0df32 has been approved by |
☀️ Test successful - checks-actions |
No description provided.