There are places in MachineBlockPlacement where a worklist is filled in pretty much identical way. The code is duplicated. This refactor it so that the same code is used in both scenarii.
Details
Diff Detail
Event Timeline
lib/CodeGen/MachineBlockPlacement.cpp | ||
---|---|---|
598 | Honestly, I don't follow your argument. I prefer this style (i.e., the original code): if (Chain.UnscheduledPredecessors == 0) BlockWorkList.push_back(*Chain.begin()); rather than your change (below): if (Chain.UnscheduledPredecessors != 0) return; BlockWorkList.push_back(*Chain.begin()); For this patch can we just stick with the original code? |
lib/CodeGen/MachineBlockPlacement.cpp | ||
---|---|---|
598 | I agree with Chad here -- unless it helps reducing if nesting level, early return here does not help readability -- the original code seems more readable: if (Chain.UnscheduledPredecessors == 0) { // update worklist(s) } |
lib/CodeGen/MachineBlockPlacement.cpp | ||
---|---|---|
277 | Though not done for existing methods, I think it is better to add a slightly detailed comments for this method. Otherwise the refactoring looks good. |
Though not done for existing methods, I think it is better to add a slightly detailed comments for this method. Otherwise the refactoring looks good.