[LLVMdev] problem with inlining pass

Jochen Wilhelmy jochen.wilhelmy at googlemail.com
Wed Feb 29 15:11:13 PST 2012


Hi!

My llvm version is 3.0 release.
I have a module generated by clang. When I optimize it, I first add an
inlining pass (llvm::createFunctionInliningPass), then these passes:
- own FunctionPass
- llvm::createPromoteMemoryToRegisterPass
- llvm::createInstructionCombiningPass
- llvm::createDeadInstEliminationPass
- llvm::createDeadStoreEliminationPass
- new llvm::DominatorTree()
- new llvm::LoopInfo()
- llvm::createLoopSimplifyPass()
- own FunctionPass

The problem is that the last function pass (and maybe the others too) 
gets called
with functions that the inlining pass is supposed to delete. this 
behavior I only saw
on windows and macos in 64 bit release mode. In debug mode it works and 
I think
at least on windows it works in 32 bit release mode.

My current workaround is creating a new pass manager for the last pass 
and let it
run separately. At this time all functions with linkonce_odr got deleted 
by the inlining
pass and everything is ok.

-Jochen




More information about the llvm-dev mailing list