[PATCH] D32563: Add LiveRangeShrink pass to shrink live range within BB.
Dehao Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 30 17:23:34 PDT 2017
danielcdh added inline comments.
================
Comment at: lib/CodeGen/LiveRangeShrink.cpp:177-178
+ } else if (MRI.hasOneNonDBGUse(Reg) && MRI.hasOneDef(Reg) && DefMO &&
+ MRI.getRegClass(DefMO->getReg()) ==
+ MRI.getRegClass(MO.getReg())) {
+ MachineInstr &DefInstr = *MRI.def_instr_begin(Reg);
----------------
MatzeB wrote:
> - As we got surprised by it in the first try, it would be good to document the necessity for the regClass() check. Something along the lines of:
> ```
> /// The heuristic does not handle different register classes yet (registers of different sizes, looser/tighter constraints).
> ```
> - getRegClass() only works for virtual registers, as far as I understand this needs a check as we could get here with a constant physreg.
Updated the logic to make sure that DefMO and MO will always be virtual register.
https://reviews.llvm.org/D32563
More information about the llvm-commits
mailing list