remove all-zero GEP
This always produces zero offset, regardless of what the struct layout is. Originally, this may have been necessary in order to change the pointer type, but with opaque pointers, it is no longer necessary.
This commit is contained in:
parent
b6d2d841bc
commit
efe5a40f2b
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue