[PATCH] Enable ExitValue rewrite only when expansion cost is low.
atrick at apple.com
Wed May 27 21:16:14 PDT 2015
Please update you patch for trunk. You probably don't need LastPN.
IsLoopCanBeDel should be phrased "CanLoopBeDeleted". However, it's not just a query; it at least needs a very clear comment that it may hoist instructions into the preheader to facilitate the query.
As Hal pointed out, it's very important to return early from CanLoopBeDeleted. We should only scan all instructions in the loop if we know the loop can otherwise be deleted.
I'm curious why you needed to enable aggressive exit value replacement in four unit tests. Can your logic determine that the loops can be deleted in those cases?
More information about the llvm-commits