>> I specialized a CD-DCE pass, named CD-DCE2, and only in this pass, loop >> removal based on assumed finteness is performed. Please check the patch.
> Oh, but why not generally do this? It is nature that real finiteness of loop should override assumed one. As you said, CD-DCE could be invocated as an early pass. At that time, we might make mistake deduction on finiteness for a loop whose bound is in form of variable, but could be transformed to constant by later optimizations. So it is not "safe" to generally do this in CD-DCE. We need one late and specific pass. Feng