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
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index 665b5c6..4e45bfa 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -406,6 +406,10 @@
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()) {