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
This commit is contained in:
Chris Lattner 2004-02-15 05:54:06 +00:00
parent 218eb798a2
commit 834b1272f3
1 changed files with 4 additions and 0 deletions

View File

@ -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()) {