Skip to content

Commit

Permalink
Rollup merge of rust-lang#122051 - erikdesjardins:cleanup, r=nikic
Browse files Browse the repository at this point in the history
cleanup: remove zero-offset GEP

This GEP would've been used to change the pointer type in the past, but after opaque pointers it's a no-op. I missed removing this in rust-lang#105545.

Split out from rust-lang#121577.
  • Loading branch information
matthiaskrgr committed Mar 6, 2024
2 parents e93a3d1 + efe5a40 commit 1a85eb0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/rustc_codegen_ssa/src/mir/rvalue.rs
Expand Up @@ -94,8 +94,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
}

if let OperandValue::Immediate(v) = cg_elem.val {
let zero = bx.const_usize(0);
let start = dest.project_index(bx, zero).llval;
let start = dest.llval;
let size = bx.const_usize(dest.layout.size.bytes());

// Use llvm.memset.p0i8.* to initialize all zero arrays
Expand Down

0 comments on commit 1a85eb0

Please sign in to comment.