When using accumulators in loops, they are passed around in PHI nodes of unprimed accumulators, causing the generation of additional
prime/unprime instructions. This patch detects these cases and changes these PHI nodes to primed accumulator PHI nodes.
We also add IR and MIR test cases for several PHI node cases.
Details
- Reviewers
nemanjai saghir - Group Reviewers
Restricted Project - Commits
- rG45ec3a37b0a5: [PowerPC] Fix for excessive ACC copies due to PHI nodes
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
380 ms | linux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp |
Event Timeline
My comments are all cosmetic, feel free to address them on the commit. LGTM otherwise.
llvm/lib/Target/PowerPC/PPCMIPeephole.cpp | ||
---|---|---|
318 | This comment appears to be out of date. It talks about returning false but the return type is void. Please revise the comment. | |
363 | Please add a comment here describing why we are creating a new primed accumulator virtual register as it is not trivially obvious. If the PHI node we are changing is the root node, the register it defines will be the destination register of the original copy (of the PHI def). For all other PHI's in the list, we need to create another primed accumulator virtual register as the PHI will no longer define the unprimed accumulator. | |
439 | s/directions/direction | |
440 | s/satisfying (i) (ii) and (iii)/satisfying (i) and (ii) |
Do you mean we check if they can be converted?