llvm.org GIT mirror llvm / fc40386
Fix valgrind warning for gcc builds. Sorry, I don't understand why the warning is generated (a gcc bug?). Anyhow, the change should improve readablity. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199214 91177308-0d34-0410-b5e6-96231b3b80d8 Patrik Hagglund 6 years ago
1 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
815815 }
816816
817817 if (TargetRegisterInfo::isVirtualRegister(DstReg)) {
818 unsigned NewIdx = NewMI->getOperand(0).getSubReg();
818 unsigned NewIdx;
819819 const TargetRegisterClass *RCForInst;
820 if (NewIdx)
821 RCForInst = TRI->getMatchingSuperRegClass(MRI->getRegClass(DstReg), DefRC,
822 NewIdx);
823820
824821 if (MRI->constrainRegClass(DstReg, DefRC)) {
825822 // The materialized instruction is quite capable of setting DstReg
826823 // directly, but it may still have a now-trivial subregister index which
827824 // we should clear.
828825 NewMI->getOperand(0).setSubReg(0);
829 } else if (NewIdx && RCForInst) {
826 } else if ((NewIdx = NewMI->getOperand(0).getSubReg()) &&
827 (RCForInst = TRI->getMatchingSuperRegClass(
828 MRI->getRegClass(DstReg), DefRC, NewIdx))) {
830829 // The subreg index on NewMI is essential; we still have to make sure
831830 // DstReg:idx is in a class that NewMI can use.
832831 MRI->constrainRegClass(DstReg, RCForInst);