This is an archive of the discontinued LLVM Phabricator instance.

[MIPS] ORC JIT support
ClosedPublic

Authored by erceg95 on Jul 23 2018, 4:53 AM.

Details

Summary

This patch supports ORC JIT for mips/mips64 architecture. We have changed in common code $static to __ORCstatic because on MIPS architecture "$" is a reserved character.

Diff Detail

Repository
rL LLVM

Event Timeline

erceg95 created this revision.Jul 23 2018, 4:53 AM

Hi Luca,

Sorry for the delay. I am reading through this now, but the first thing I notice is that we cannot change from uint64_t to uintptr_t. ORC is meant to work across platforms, and that includes compiling (and holding addresses of) 64-bit code on 32-bit platforms where the a uintptr_t would only be 32-bits.

What endianness bugs are you seeing?

Cheers,
Lang.

The rest of this looks great. All that remains is to sort out the uintptr_t issue and provide testing. I think you will want to enable mips32/mips64 in test/ExecutionEngine/OrcLazy/lit.local.cfg to allow those regression tests to run on mips.

erceg95 updated this revision to Diff 163109.Aug 29 2018, 9:55 AM

Hi Lang,

I fixed the issue with endianness without changing uintptr_t and also enabled tests for Mips. The issue was related to return values for mips32. On mips32 if the return value size is 64 bit we are using register pair (32bit) v0 and v1 for it. For big endian, since return type is uint64_t, return value was put into v1, and for little endian was put into v0 and it was needed we to set the proper return value in resolver code.

Luka

lhames accepted this revision.Sep 10 2018, 10:50 AM

Looks good to me. Thanks Luka!

This revision is now accepted and ready to land.Sep 10 2018, 10:50 AM

Luka, can you please update the commit message? (e.g. "changed types in common code in few places, from uint64_t to uintptr_t" is not true anymore).

erceg95 edited the summary of this revision. (Show Details)Sep 11 2018, 2:27 AM

I changed the commit message. Thank you.

This revision was automatically updated to reflect the committed changes.