[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?

Gabi bugspynet at gmail.com
Fri Mar 19 02:27:17 PDT 2010


Reid,

Thanks! You were right!
Changing the code to:

float (*theF)(float) = (float (*)(float)) EE -> getPointerToFunction(f);
float retVal = theF(arg1);

made the difference. Now it is dozens of times faster!

I don't really understand the cause though..
Why doesn't ExecutionEngine cope well with "define float
@someFunc(float %x)" and needs this trick ?  (but copes well with
"define i32 @someFunc(i32 %x) )

The function was generated using "getOrInsertFunction(name,
Type::getFloatTy(ctx), Type::getFloatTy(ctx), (Type*)NULL);

And the orginal slow execution was:

std::vector<GenericValue> args(1);
args[0].FloatVal = 8.0f;
GenericValue retVal =  EE -> runFunction(f, args);
return retVal.FloatVal;





-- 
Regards,
Gabi

http://bugspy.net



More information about the llvm-dev mailing list