LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 4816 - PPC doesn't support non-lazy JIT compilation
Summary: PPC doesn't support non-lazy JIT compilation
Status: NEW
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-28 11:36 PDT by Török Edwin
Modified: 2011-03-18 06:37 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
x.bc (492 bytes, application/octet-stream)
2009-08-28 11:36 PDT, Török Edwin
Details
Possible fix (35.22 KB, patch)
2009-11-10 13:37 PST, Jeffrey Yasskin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Török Edwin 2009-08-28 11:36:48 PDT
Created attachment 3386 [details]
x.bc

Disabling lazy compilation fails on PPC:

Release/bin/lli -disable-lazy-compilation  ~/x.bc
Assertion failed: (0 && "This target doesn't implement emitFunctionStubAtAddr!"), function emitFunctionStubAtAddr, file /Users/acab/clamav-devel/libclamav/llvm/llvm/include/llvm/Target/TargetJITInfo.h, line 65.
0   lli               0x0065d50c llvm::sys::RWMutexImpl::writer_release() + 476
1   lli               0x0065dddc llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 1244
2   libSystem.B.dylib 0x92f639fc _sigtramp + 68
Stack dump:
0.      Program arguments: Release/bin/lli -disable-lazy-compilation /Users/acab/x.bc
Abort trap


It seems that X86 is the only target that implements that method.

In this case it is simply a matter of ordering the functions bottom-up according to the callgraph, and then non-lazy compilation should succeeed on the Mac too in this case, BUT it would fail for mutually recursive functions.

Is there a workaround that doesn't need emitFunctinStubAtAddr, or should I just always use lazy compilation on Mac/PPC? (rather anything non-X86?)
Comment 1 Jeffrey Yasskin 2009-11-01 01:00:44 PST
I'm pretty sure you're correct that the eager JIT only exists on x86. It doesn't look that hard to implement emitFunctionStubAtAddr given emitFunctionStub (with some thought, maybe we can unify them), but I don't have a PPC or ARM to test on, so I'm a bit reluctant to try it myself. Would you be interested in taking a shot at the implementation? If not, I may be able to find a machine to test on or use the buildbots as guinea pigs.
Comment 2 Török Edwin 2009-11-01 04:04:12 PST
(In reply to comment #1)
> I'm pretty sure you're correct that the eager JIT only exists on x86. It
> doesn't look that hard to implement emitFunctionStubAtAddr given
> emitFunctionStub (with some thought, maybe we can unify them), but I don't have
> a PPC or ARM to test on, so I'm a bit reluctant to try it myself. Would you be
> interested in taking a shot at the implementation? 

For PPC and ARM there are some Linux machines on the compile farm.
They are about 7-13 times slower than my x86-64 box though, so it may take some time to compile LLVM initially.

>If not, I may be able to
> find a machine to test on or use the buildbots as guinea pigs.
> 

I may have some time for this late next week.
Comment 3 Jeffrey Yasskin 2009-11-06 16:24:06 PST
I may wind up fixing this as part of the redesign for PR5201, so don't waste time working on it yet.
Comment 4 Jeffrey Yasskin 2009-11-10 13:37:44 PST
Created attachment 3804 [details]
Possible fix

Nick's running the tests on PPC and ARM, but other people are welcome to do the same. You can review the patch at http://codereview.appspot.com/153044.