llvm.org GIT mirror llvm / ebe8075
add a -backedge-hack llc-beta option to codegenprepare. When specified, don't split backedges of single-bb loops. This helps address PR1877 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45344 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
1 changed file(s) with 10 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
3636 namespace {
3737 cl::opt OptExtUses("optimize-ext-uses",
3838 cl::init(true), cl::Hidden);
39 // LLCBETA option.
40 cl::opt DontHackBackedge("backedge-hack", cl::Hidden);
3941 }
4042
4143 namespace {
263265 }
264266
265267
266 /// SplitEdgeNicely - Split the critical edge from TI to it's specified
268 /// SplitEdgeNicely - Split the critical edge from TI to its specified
267269 /// successor if it will improve codegen. We only do this if the successor has
268270 /// phi nodes (otherwise critical edges are ok). If there is already another
269271 /// predecessor of the succ that is empty (and thus has no phi nodes), use it
274276 assert(isa(Dest->begin()) &&
275277 "This should only be called if Dest has a PHI!");
276278
279 // As a hack, never split backedges of loops. Even though the copy for any
280 // PHIs inserted on the backedge would be dead for exits from the loop, we
281 // assume that the cost of *splitting* the backedge would be too high.
282 if (DontHackBackedge && Dest == TIBB)
283 return;
284
277285 /// TIPHIValues - This array is lazily computed to determine the values of
278286 /// PHIs in Dest that TI would provide.
279 std::vector> TIPHIValues;
287 SmallVector> TIPHIValues;
280288
281289 // Check to see if Dest has any blocks that can be used as a split edge for
282290 // this terminator.