[PATCH] D19337: [Tail duplication] Handle source registers with subregisters
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 26 09:13:10 PDT 2016
qcolombet added inline comments.
================
Comment at: lib/CodeGen/TailDuplicator.cpp:373
@@ +372,3 @@
+ // needed to change the class of the mapped register.
+ ConstrRC = MRI->constrainRegClass(VI->second.Reg, ConstrRC);
+ }
----------------
MRI->setRegClass.
================
Comment at: lib/CodeGen/TailDuplicator.cpp:389
@@ +388,3 @@
+ // class constraints. An explicit COPY is necessary.
+ unsigned NewReg = MRI->createVirtualRegister(OrigRC);
+ BuildMI(*PredBB, MI, MI->getDebugLoc(),
----------------
Instead of using OrigRC, we should use the regclass that is required by MO.
MachineInstr::getRegClassConstraint
================
Comment at: lib/CodeGen/TailDuplicator.cpp:392
@@ +391,3 @@
+ TII->get(TargetOpcode::COPY), NewReg)
+ .addReg(Reg);
+ LocalVRMap.erase(VI);
----------------
We need to read from Reg:subReg if Reg has a sub reg.
Repository:
rL LLVM
http://reviews.llvm.org/D19337
More information about the llvm-commits
mailing list