[llvm-dev] ORC v2 question

Dibyendu Majumdar via llvm-dev llvm-dev at lists.llvm.org
Sat Aug 10 13:43:00 PDT 2019


On Sat, 10 Aug 2019 at 21:27, Praveen Velliengiri
<praveenvelliengiri at gmail.com> wrote:
> I understand that ORCv2 is changing fast, I will try to answer quickly if you provide me the
> Optimized IR Module (with your expectations)  and Unoptimized IR Module the ORC gives you.
> I can't able to build your project though now :)
>

Sorry Praveen, I only need someone to tell me what I am doing wrong in
ORC v2 vs ORC v1. The code I sent shows how I am using it.
There is not much point in analyzing the output at this stage as the
same optimizations should be applied in the two cases.

>
> On Sun, 11 Aug 2019 at 01:43, Dibyendu Majumdar <mobile at majumdar.org.uk> wrote:
>>
>> On Sat, 10 Aug 2019 at 21:05, Praveen Velliengiri
>> <praveenvelliengiri at gmail.com> wrote:
>> >
>> > Could you please send me your unoptimized and expected optimized code? The default implementation only contains some transformations. It would be helpful to know what you are actually trying.
>> > Optimize Module is just a function object.
>> >
>>
>> You can view the code here:
>>
>> https://github.com/dibyendumajumdar/ravi/blob/master/include/ravi_llvmcodegen.h
>> https://github.com/dibyendumajumdar/ravi/blob/master/src/ravi_llvmjit.cpp
>>
>> Just look for USE_ORCv2_JIT
>>
>> The code is messy but that is because LLVM's api keeps changing from
>> version to version, causing huge issues for users.
>>
>>
>> >
>> > On Sat, 10 Aug 2019 at 22:55, Dibyendu Majumdar via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>> >> I am trying out ORC v2 and facing some problems.
>> >>
>> >> I am using LLVM 8.0.1.
>> >> I updated my ORC v1 implementation from 6.0 to 8.0 based on
>> >> Kaleidoscope example (i.e. using Legacy classes) and that works fine.
>> >>
>> >> Now  I am trying out ORC v2 apis, based on
>> >> https://github.com/llvm-mirror/llvm/blob/master/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h.
>> >>
>> >> I have got it to compile and build.
>> >> But looks like my compiled code is not being optimized at all.
>> >>
>> >> For optimization I am using the PassManagerBuilder class to setup the
>> >> passes. I use OptLevel = 2. This works perfectly with ORC v1 apis, but
>> >> with ORC v2 I am not sure what is happening. I can see that the
>> >> optimizeModule() is being called.
>> >>
>> >> Second issue is - I need to use an instance method as optimizeModule()
>> >> but based on the example this is now a static method. Is this a
>> >> restriction in the new api? I need to pass some parameters from the
>> >> JIT context such as what optimization level to use.
>> >>
>> >> Thanks and Regards
>> >> Dibyendu


More information about the llvm-dev mailing list