[PATCH] D37730: [PowerPC] eliminate unconditional branch to the next instruction
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 14 00:32:10 PDT 2017
nemanjai added inline comments.
================
Comment at: lib/Target/PowerPC/PPCInstrInfo.cpp:491
+ MachineFunction::iterator BBI = MBB.getIterator();
+ MachineFunction::iterator NextBBI = std::next(BBI);
+ // If the BB end with an unconditional branch to the fallthrough BB,
----------------
This makes the assumption that the blocks are ordered in in the `MachineFunction` in the same order in which they'll be emitted. Can you add a comment with a quick explanation of why you're allowed to make that assumption.
================
Comment at: lib/Target/PowerPC/PPCInstrInfo.cpp:492
+ MachineFunction::iterator NextBBI = std::next(BBI);
+ // If the BB end with an unconditional branch to the fallthrough BB,
+ // we eliminate it.
----------------
1. s/end/ends
2. s/we eliminate it/we eliminate the branch instruction
The reason for 2. is that there's a bit of confusion of the subject of the sentence - it sounds like we're removing the basic block rather than the branch instruction.
https://reviews.llvm.org/D37730
More information about the llvm-commits
mailing list