As we know, the order of compiler passes has a great influence on the results of program optimization.
While I using llvm to compiler my test code, I changed the order of Loop Deletion pass and DSE pass(First time Loop Deletion is before DSE, the default order of FunctionSimplificationPipeline. Second time, I used DSE before Loop Deletion), the compilation method of these two sequences has produced a big performance gap, because without DSE, a variable inside loop could not be optimized for the default order of FunctionSimplificationPipeline, but the second order(DSE before Loop Deletion) works well. And I noticed that in LTODefaultPipeline , DSE is before Loop Deletion.
So , Why there is difference of passes order between FunctionSimplificationPipeline and LTODefaultPipeline?
And why should use Loop Deletion before DSE(or other great optimization passes) as default?
Anyone’s answers are precious to me. Thank you all.