[llvm-dev] Apply optimization passes with short names

Adrien DEGRANGE via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 11 06:31:08 PST 2016


Hi all,

I apologize for bothering you, but even after many efforts, I can't solve my issue. 

There is a great command-line optimizer tool, "opt", which can apply optimization passes to the IR code : 
opt -mem2reg -S myFile.ll -o myFile.ll 

With that tool, an optimization pass is referred as its "short name" (mem2reg), and these passes are pretty well documented, for instance here: http://llvm.org/docs/Passes.html

However, if I want to apply the same optimization pass in a C++ code, I have to call a specific function, such as: 
myPassManager->add(createPromoteMemoryToRegisterPass());

The link between the "mem2reg" short name and the "createPromoteMemoryToRegister" function is pretty obvious, but not completely straightforward. 
Is there any dictionary, or at least a comprehensive documentation about these translations? 

Thanks a lot in advance!

Have a great day,

AD

Adrien Dégrange 
Recherche & Développement





More information about the llvm-dev mailing list