about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-03-11 14:23:13 +0100
committerRalf Jung <post@ralfj.de>2020-03-11 14:23:13 +0100
commitd49306da136c1c433a95babc82cc278cbf192238 (patch)
tree5925accc0e24d4ccc0dec2af7c58acd16f9f8dc9 /src/librustc_codegen_llvm
parent303d8aff6092709edd4dbd35b1c88e9aa40bf6d8 (diff)
downloadrust-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.rs22
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" => {