diff options
| author | Ralf Jung <post@ralfj.de> | 2020-03-11 14:23:13 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-03-11 14:23:13 +0100 |
| commit | d49306da136c1c433a95babc82cc278cbf192238 (patch) | |
| tree | 5925accc0e24d4ccc0dec2af7c58acd16f9f8dc9 /src/librustc_codegen_llvm | |
| parent | 303d8aff6092709edd4dbd35b1c88e9aa40bf6d8 (diff) | |
| download | rust-d49306da136c1c433a95babc82cc278cbf192238.tar.gz rust-d49306da136c1c433a95babc82cc278cbf192238.zip | |
implement zeroed and uninitialized with MaybeUninit
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/intrinsic.rs | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/librustc_codegen_llvm/intrinsic.rs b/src/librustc_codegen_llvm/intrinsic.rs index 1ae9d2a6841..aa42d557b02 100644 --- a/src/librustc_codegen_llvm/intrinsic.rs +++ b/src/librustc_codegen_llvm/intrinsic.rs @@ -195,26 +195,8 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> { .unwrap(); OperandRef::from_const(self, ty_name, ret_ty).immediate_or_packed_pair(self) } - "init" => { - let ty = substs.type_at(0); - if !self.layout_of(ty).is_zst() { - // Just zero out the stack slot. - // If we store a zero constant, LLVM will drown in vreg allocation for large - // data structures, and the generated code will be awful. (A telltale sign of - // this is large quantities of `mov [byte ptr foo],0` in the generated code.) - memset_intrinsic( - self, - false, - ty, - llresult, - self.const_u8(0), - self.const_usize(1), - ); - } - return; - } - // Effectively no-ops - "uninit" | "forget" => { + // Effectively no-op + "forget" => { return; } "offset" => { |
