diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-15 05:54:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-15 05:54:06 +0000 |
commit | 834b1272f3eab2cbf3cd01bc9f059c768f502e1a (patch) | |
tree | b02f3e00e5472e7f5c07e72f54d1f8a0b0b07fe8 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 218eb798a2f347a85886bc3af5bfe7fee188263b (diff) | |
download | bcm5719-llvm-834b1272f3eab2cbf3cd01bc9f059c768f502e1a.tar.gz bcm5719-llvm-834b1272f3eab2cbf3cd01bc9f059c768f502e1a.zip |
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
llvm-svn: 11472
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 665b5c62737..4e45bfa24ec 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/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<ConstantAggregateZero>(Init)) { + unsigned Size = getTargetData().getTypeSize(Init->getType()); + memset(Addr, 0, Size); + return; } switch (Init->getType()->getPrimitiveID()) { |