comparison llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @ 165:597b3f1c2c93

fix call createTailCallEliminationPass
author anatofuz
date Tue, 24 Mar 2020 15:30:52 +0900
parents f7e988d3e4cc
children 3a3539a2fb79
comparison
equal deleted inserted replaced
164:fdfabb438fbf 165:597b3f1c2c93
394 addExtensionsToPM(EP_Peephole, MPM); 394 addExtensionsToPM(EP_Peephole, MPM);
395 395
396 // Optimize memory intrinsic calls based on the profiled size information. 396 // Optimize memory intrinsic calls based on the profiled size information.
397 if (SizeLevel == 0) 397 if (SizeLevel == 0)
398 MPM.add(createPGOMemOPSizeOptLegacyPass()); 398 MPM.add(createPGOMemOPSizeOptLegacyPass());
399 #ifndef noCbc
400 MPM.add(createTailCallEliminationPass(false)); // CbC
401 #endif
399 402
400 // TODO: Investigate the cost/benefit of tail call elimination on debugging. 403 // TODO: Investigate the cost/benefit of tail call elimination on debugging.
404 #ifdef noCbC
401 if (OptLevel > 1) 405 if (OptLevel > 1)
402 #ifndef noCbC
403 MPM.add(createTailCallEliminationPass(false)); // CbC
404 #else
405 MPM.add(createTailCallEliminationPass()); // Eliminate tail calls 406 MPM.add(createTailCallEliminationPass()); // Eliminate tail calls
406 #endif 407 #endif
407 MPM.add(createCFGSimplificationPass()); // Merge & remove BBs 408 MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
408 MPM.add(createReassociatePass()); // Reassociate expressions 409 MPM.add(createReassociatePass()); // Reassociate expressions
409 410
991 // Break up allocas 992 // Break up allocas
992 PM.add(createSROAPass()); 993 PM.add(createSROAPass());
993 994
994 // LTO provides additional opportunities for tailcall elimination due to 995 // LTO provides additional opportunities for tailcall elimination due to
995 // link-time inlining, and visibility of nocapture attribute. 996 // link-time inlining, and visibility of nocapture attribute.
996 if (OptLevel > 1)
997 #ifndef noCbC 997 #ifndef noCbC
998 PM.add(createTailCallEliminationPass(false)); 998 PM.add(createTailCallEliminationPass(false));
999 #else 999 #else
1000 if (OptLevel > 1)
1000 PM.add(createTailCallEliminationPass()); 1001 PM.add(createTailCallEliminationPass());
1001 #endif 1002 #endif
1002 1003
1003 // Infer attributes on declarations, call sites, arguments, etc. 1004 // Infer attributes on declarations, call sites, arguments, etc.
1004 PM.add(createPostOrderFunctionAttrsLegacyPass()); // Add nocapture. 1005 PM.add(createPostOrderFunctionAttrsLegacyPass()); // Add nocapture.