mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-29 00:30:22 +02:00
Use llvm.memset instead of _d_array_init_i1 and _d_array_init_i8.
This exposes what's happening to LLVM, and memset is probably faster than the runtime functions we were using anyway.
This commit is contained in:
+9
-2
@@ -411,7 +411,7 @@ LLConstant* DtoGEPi(LLConstant* ptr, unsigned i0, unsigned i1)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void DtoMemSetZero(LLValue* dst, LLValue* nbytes)
|
||||
void DtoMemSet(LLValue* dst, LLValue* val, LLValue* nbytes)
|
||||
{
|
||||
dst = DtoBitCast(dst,getVoidPtrType());
|
||||
|
||||
@@ -419,7 +419,14 @@ void DtoMemSetZero(LLValue* dst, LLValue* nbytes)
|
||||
llvm::Function* fn = llvm::Intrinsic::getDeclaration(gIR->module,
|
||||
llvm::Intrinsic::memset, &intTy, 1);
|
||||
|
||||
gIR->ir->CreateCall4(fn, dst, DtoConstUbyte(0), nbytes, DtoConstUint(0), "");
|
||||
gIR->ir->CreateCall4(fn, dst, val, nbytes, DtoConstUint(0), "");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void DtoMemSetZero(LLValue* dst, LLValue* nbytes)
|
||||
{
|
||||
DtoMemSet(dst, DtoConstUbyte(0), nbytes);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user