<div dir="ltr"><div>Hi Dibyendu</div><div>I understand that ORCv2 is changing fast, I will try to answer quickly if you provide me the <br></div><div>Optimized IR Module (with your expectations)  and Unoptimized IR Module the ORC gives you. </div><div>I can't able to build your project though now :) <br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 11 Aug 2019 at 01:43, Dibyendu Majumdar <<a href="mailto:mobile@majumdar.org.uk">mobile@majumdar.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Praveen,<br>
<br>
On Sat, 10 Aug 2019 at 21:05, Praveen Velliengiri<br>
<<a href="mailto:praveenvelliengiri@gmail.com" target="_blank">praveenvelliengiri@gmail.com</a>> wrote:<br>
><br>
> 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.<br>
> Optimize Module is just a function object.<br>
><br>
<br>
You can view the code here:<br>
<br>
<a href="https://github.com/dibyendumajumdar/ravi/blob/master/include/ravi_llvmcodegen.h" rel="noreferrer" target="_blank">https://github.com/dibyendumajumdar/ravi/blob/master/include/ravi_llvmcodegen.h</a><br>
<a href="https://github.com/dibyendumajumdar/ravi/blob/master/src/ravi_llvmjit.cpp" rel="noreferrer" target="_blank">https://github.com/dibyendumajumdar/ravi/blob/master/src/ravi_llvmjit.cpp</a><br>
<br>
Just look for USE_ORCv2_JIT<br>
<br>
The code is messy but that is because LLVM's api keeps changing from<br>
version to version, causing huge issues for users.<br>
<br>
<br>
><br>
> On Sat, 10 Aug 2019 at 22:55, Dibyendu Majumdar via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> I am trying out ORC v2 and facing some problems.<br>
>><br>
>> I am using LLVM 8.0.1.<br>
>> I updated my ORC v1 implementation from 6.0 to 8.0 based on<br>
>> Kaleidoscope example (i.e. using Legacy classes) and that works fine.<br>
>><br>
>> Now  I am trying out ORC v2 apis, based on<br>
>> <a href="https://github.com/llvm-mirror/llvm/blob/master/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h" rel="noreferrer" target="_blank">https://github.com/llvm-mirror/llvm/blob/master/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h</a>.<br>
>><br>
>> I have got it to compile and build.<br>
>> But looks like my compiled code is not being optimized at all.<br>
>><br>
>> For optimization I am using the PassManagerBuilder class to setup the<br>
>> passes. I use OptLevel = 2. This works perfectly with ORC v1 apis, but<br>
>> with ORC v2 I am not sure what is happening. I can see that the<br>
>> optimizeModule() is being called.<br>
>><br>
>> Second issue is - I need to use an instance method as optimizeModule()<br>
>> but based on the example this is now a static method. Is this a<br>
>> restriction in the new api? I need to pass some parameters from the<br>
>> JIT context such as what optimization level to use.<br>
>><br>
>> Thanks and Regards<br>
>> Dibyendu<br>
</blockquote></div>