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
- Repository
- rL LLVM
Event Timeline
lib/Target/PowerPC/PPCLoopPreIncPrep.cpp | ||
---|---|---|
186 ↗ | (On Diff #111153) | Please add a comment here explaining what this function is doing. |
189 ↗ | (On Diff #111153) | Local variables start with a capital letter (here and a bunch of places below). |
203 ↗ | (On Diff #111153) | Extra spaces inside parens. |
212 ↗ | (On Diff #111153) | I don't believe that getSCEVAtScope can return nullptr. |
219 ↗ | (On Diff #111153) | This can't be null. |
223 ↗ | (On Diff #111153) | Indentation looks odd here (you might try running clang-format over the patch). |
234 ↗ | (On Diff #111153) | This phrasing is confusing (it sounds like you're saying that the start and the increment are identical to each other). |
417 ↗ | (On Diff #111153) | Space after if. |
lib/Target/PowerPC/PPCLoopPreIncPrep.cpp | ||
---|---|---|
65 ↗ | (On Diff #111389) | How about "PHI node already in pre-increment form" (no period at the end). |
193 ↗ | (On Diff #111389) | Remove this variable, it is not needed (and see comment below). |
206 ↗ | (On Diff #111389) | Extra spaces inside < >. |
207 ↗ | (On Diff #111389) | 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 ↗ | (On Diff #111389) | FoundPHI is not needed. Instead of setting FoundPHI to true here, you can just ++PHINodeAlreadyExists; return true; |