Hello,<div> I have written a custom LLVM Loop Pass that perforates a loop by changing the increment value for the induction variable. I am able to run this pass using the opt command and loading the shared object library from Debug+Asserts as detailed in <a href="http://llvm.org/docs/WritingAnLLVMPass.html">http://llvm.org/docs/WritingAnLLVMPass.html</a></div>
<div><br></div><div>I was wondering if this pass can be used in clang somehow. I have read about "-mllvm" option which can be used to pass arguments to LLVM from clang. But I have not been able to get this to work.</div>
<div>I tried a similar way of running clang (as I did with opt) </div><div>clang -load "path_to_library" -mllvm "registered_custom_pass_option" test.c -o test.o</div><div><br></div><div>It complains that the load option was unused during compilation, Also, that it cannot find any option by -loop-perforate which is the registered custom pass.</div>
<div><br></div><div>I tried using -indvars,along with -mllvm to see if I am doing it right. But I get the same error for -indvars too. Isn't that supported by default ( i can see it printed in -mllvm -debug-pass=Arguments)</div>
<div><br></div><div>Am I doing something completely wrong here? How can I get the custom pass to work with clang and also specify only certain passes like -indvars?</div><div><br></div><div>Thank you in advance.</div><div>
<br clear="all">Regards,<div>Rakesh Varna</div><br>
</div>