diff options
| author | Matthias Braun <matze@braunis.de> | 2015-05-19 17:52:32 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2015-05-19 17:52:32 +0000 |
| commit | 7e10e53f1490e42b8730e8567ed668955d858123 (patch) | |
| tree | 2b6e7140129a17a89fa2e3194c3d4f8f3d4fb14e /llvm/lib/CodeGen | |
| parent | 3c9e370ec0ef13173e1f419bc88b8a510f46dfbd (diff) | |
| download | bcm5719-llvm-7e10e53f1490e42b8730e8567ed668955d858123.tar.gz bcm5719-llvm-7e10e53f1490e42b8730e8567ed668955d858123.zip | |
RegisterCoalescer: Improve a comment.
Explain the relation of the example to the variables in the code,
explain what bad behaviour the code avoids in this case.
llvm-svn: 237706
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/RegisterCoalescer.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index c2d1620c552..9c3d075ff0f 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -955,12 +955,11 @@ bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP, TII->reMaterialize(*MBB, MII, DstReg, SrcIdx, DefMI, *TRI); MachineInstr *NewMI = std::prev(MII); - // A situation like the following: - // %vreg0:subX = instr ; DefMI - // %vregY = copy %vreg:subX ; CopyMI - // does not need subregisters/regclass widening after rematerialization, just - // do: - // %vregY = instr + // In a situation like the following: + // %vreg0:subreg = instr ; DefMI, subreg = DstIdx + // %vreg1 = copy %vreg0:subreg ; CopyMI, SrcIdx = 0 + // instead of widening %vreg1 to the register class of %vreg0 simply do: + // %vreg1 = instr const TargetRegisterClass *NewRC = CP.getNewRC(); if (DstIdx != 0) { MachineOperand &DefMO = NewMI->getOperand(0); |

