This patch moves the constrainSelectedInstRegOperands from InstructionSelector into GlobalISel/Utils so it can be used elsewhere.
Also added constrainAllUses method into MachineInstrBuilder which forwards the call to utils. So now we can use it like,
BuildMI(...)
.addUse(..) .addImm(..) .constrainAllUses(TII, TRI, RBI);