[cfe-commits] r67896 - /cfe/trunk/lib/CodeGen/CGExprAgg.cpp

Eli Friedman eli.friedman at gmail.com
Fri Mar 27 20:10:48 PDT 2009


Author: efriedma
Date: Fri Mar 27 22:10:45 2009
New Revision: 67896

URL: http://llvm.org/viewvc/llvm-project?rev=67896&view=rev
Log:
Minor cleanup.


Modified:
    cfe/trunk/lib/CodeGen/CGExprAgg.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=67896&r1=67895&r2=67896&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Fri Mar 27 22:10:45 2009
@@ -313,17 +313,7 @@
     // There's a potential optimization opportunity in combining
     // memsets; that would be easy for arrays, but relatively
     // difficult for structures with the current code.
-    const llvm::Type *SizeTy = llvm::Type::Int64Ty;
-    llvm::Value *MemSet = CGF.CGM.getIntrinsic(llvm::Intrinsic::memset,
-                                               &SizeTy, 1);
-    uint64_t Size = CGF.getContext().getTypeSize(T);
-    
-    const llvm::Type *BP = llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
-    llvm::Value* DestPtr = Builder.CreateBitCast(LV.getAddress(), BP, "tmp");
-    Builder.CreateCall4(MemSet, DestPtr, 
-                        llvm::ConstantInt::get(llvm::Type::Int8Ty, 0),
-                        llvm::ConstantInt::get(SizeTy, Size/8),
-                        llvm::ConstantInt::get(llvm::Type::Int32Ty, 0));
+    CGF.EmitMemSetToZero(LV.getAddress(), T);
   }
 }
 





More information about the cfe-commits mailing list