From: Chris Lattner Date: Sun, 15 Feb 2004 05:54:06 +0000 (+0000) Subject: Make the JIT zero out globals with memset instead of an element at a time. This X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dd2c82a427a089e7c704af44eeeb2a10a38e2519;p=oota-llvm.git Make the JIT zero out globals with memset instead of an element at a time. This should speed it up a bit on a lot of programs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11472 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 665b5c62737..4e45bfa24ec 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -406,6 +406,10 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) { GenericValue Val = getConstantValue(Init); StoreValueToMemory(Val, (GenericValue*)Addr, Init->getType()); return; + } else if (isa(Init)) { + unsigned Size = getTargetData().getTypeSize(Init->getType()); + memset(Addr, 0, Size); + return; } switch (Init->getType()->getPrimitiveID()) {