[llvm] r237706 - RegisterCoalescer: Improve a comment.
Matthias Braun
matze at braunis.de
Tue May 19 10:52:32 PDT 2015
Author: matze
Date: Tue May 19 12:52:32 2015
New Revision: 237706
URL: http://llvm.org/viewvc/llvm-project?rev=237706&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=237706&r1=237705&r2=237706&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Tue May 19 12:52:32 2015
@@ -955,12 +955,11 @@ bool RegisterCoalescer::reMaterializeTri
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);
More information about the llvm-commits
mailing list