[LLVMdev] MCJIT problem on native 'ppc64' target

Frank Winter fwinter at jlab.org
Mon Mar 10 12:14:39 PDT 2014


Hi Ulrich!

thanks for the patch. I can confirm that with the patch applied
even the IR function that caused the segfault now runs fine.

Is there any reason why the patch shouldn't be commited?
Would it hurt on any other target architectures?

Best wishes,
Frank


On 03/10/2014 02:35 PM, Ulrich Weigand wrote:
> Frank Winter <fwinter at jlab.org> wrote:
>
>> The issue seems to have to do with the number of calls to external
>> functions or whether a particular external function is called repeatedly.
>> I am saying this because when replacing all external calls with trivial
>> additions (fadd double ..), then the offending function works fine too.
> Just from this symptom, this reminds me a problem I've been seeing
> a while back: when the MCJIT dynamic loader resolves a function call
> to an external function, it needs to patch in code to restore the
> TOC pointer after the external call returns.  Current code does that,
> but only for the first call to a particular external function; for
> subsequent calls, it is omitted.
>
> Can you check whether this patch fixes the problem you're seeing?
> (See attached file: diff-llvm-ppc64-restoretoc)
>
> Bye,
> Ulrich





More information about the llvm-dev mailing list