Preparations to use the per-increment are sometimes done in the target independent pass Loop Strength Reduction.
We try to detect them in the PowerPC specific pass so that they are not done twice and so that we do not add PHIs that are not required.
Details
Diff Detail
Event Timeline
lib/Target/PowerPC/PPCLoopPreIncPrep.cpp | ||
---|---|---|
186 | Please add a comment here explaining what this function is doing. | |
189 | Local variables start with a capital letter (here and a bunch of places below). | |
203 | Extra spaces inside parens. | |
212 | I don't believe that getSCEVAtScope can return nullptr. | |
219 | This can't be null. | |
223 | Indentation looks odd here (you might try running clang-format over the patch). | |
234 | This phrasing is confusing (it sounds like you're saying that the start and the increment are identical to each other). | |
417 | Space after if. |
lib/Target/PowerPC/PPCLoopPreIncPrep.cpp | ||
---|---|---|
65 | How about "PHI node already in pre-increment form" (no period at the end). | |
193 | Remove this variable, it is not needed (and see comment below). | |
206 | Extra spaces inside < >. | |
207 | Please be consistent in capitalization. PHI is more common in LLVM than Phi, and we use PHI already in this source file. Make this PHIInter and so on. | |
235 | FoundPHI is not needed. Instead of setting FoundPHI to true here, you can just ++PHINodeAlreadyExists; return true; |
How about "PHI node already in pre-increment form" (no period at the end).