How to get the function definition of a kmpc_micro call

Thanks Arpith for this pointer but it did not contain what I was looking for.

However, I solved my issue by finding that the BitCastInst used when outlining OpenMP parallel region offers a method for retrieving the original value within the bitcast via stripPointerCasts().

So what I did to retrieve omp_outlined…45 is:

//bitcast is the third argument of __kmpc_fork_call

Value *vcall = callInst->getArgOperand(2);
//This will return the outlined function in __kmpc_fork_call
Function *f = dyn_cast(vcall->stripPointerCasts());

f->getName returns “.omp_outlined…45” So this worked.

Thanks again,
Dounia