In findBestLoopExit it only finds a BB that can exit a loop, but it doesn't consider the exit BB may have other better predecessor. In that case the exit BB is placed after other predecessor, rotation actually makes loop layout worse.
Details
Details
Diff Detail
Diff Detail
Event Timeline
lib/CodeGen/MachineBlockPlacement.cpp | ||
---|---|---|
1871 | loop rotation can save one internal fall through, not just adding a loop exit fall through. Do you need to consider the overall cost/savings? |
lib/CodeGen/MachineBlockPlacement.cpp | ||
---|---|---|
1871 | If MBB is not the best predecessor of Succ, then Succ will not be placed after MBB, the overall cost saving should not consider MBB -> Succ. |
loop rotation can save one internal fall through, not just adding a loop exit fall through. Do you need to consider the overall cost/savings?