I have written my own pass with Transformation. I am able to run my pass using opt but I want to run using clang (version 16) directly .
I run the command
clang -Xclang -load -Xclang ./LLVMMyHello.so input.c
This command creates an executable file from inp file but does not show any output from my pass .
Anyone help me to run my own pass .
Also , want to know how to delete a pass from building in optimization . I have seen bugpoint and it is reduction the passes to be run . If anyone can help me to remove passes from schedule pass .
Will it work if I comment out in PassRegistry.def
You need to register with newPM, LLVM has an entire dedicated infrastructure for that now.
I suggest you start with adding your pass with add_llvm_pass_plugin
, which lets the build system get most of the job done, the rest is implementing a few interface functions, assume your PassPlugin is called XXX:
void PassBuilderCallBack(PassBuilder &PB) {
// You register your NPM pass here
}
PassPluginLibraryInfo getXXXPluginInfo() {
return {LLVM_PLUGIN_API_VERSION, "XXX", LLVM_VERSION_STRING,
PassBuilderCallBack};
}
extern "C" LLVM_ATTRIBUTE_WEAK PassPluginLibraryInfo llvmGetPassPluginInfo() {
return getXXXPluginInfo();
}
Thanks for your response .
want linux command to run the pass in new PM
On Tue, May 23, 2023 at 9:40 PM Zhang via LLVM Discussion Forums <notifications@llvm.discoursemail.com> wrote:
You need to register with newPM, LLVM has an entire dedicated infrastructure for that now
Visit Topic or reply to this email to respond.
To unsubscribe from these emails, click here.
What do you mean linux command, you need to change your pass’s source code as well
Yes . I did everything .
How my question is how will I run the pass using clang not opt . I ran using opt and it ran .
It depends on how you registered your pass, for example if I used PassBuilder::registerOptimizerLastEPCallback
, then it should now be ran automatically at the end of of pipeline
I got you . Thanks for your help .
On Tue, May 23, 2023 at 11:15 PM Zhang via LLVM Discussion Forums <notifications@llvm.discoursemail.com> wrote:
It depends on how you registered your pass, for example if I used PassBuilder::registerOptimizerLastEPCallback
, then it should now be ran automatically at the end of of pipeline
Visit Topic or reply to this email to respond.
To unsubscribe from these emails, click here.