forked from OSchip/llvm-project
GlobalISel: Remove unnecessary check for copy type
COPY isn't allowed to change the type, but can mix no type with type.
This commit is contained in:
parent
66ffa0e91f
commit
924f31bc3c
|
@ -151,9 +151,8 @@ const ConstantFP* getConstantFPVRegVal(Register VReg,
|
||||||
MachineInstr *getOpcodeDef(unsigned Opcode, Register Reg,
|
MachineInstr *getOpcodeDef(unsigned Opcode, Register Reg,
|
||||||
const MachineRegisterInfo &MRI);
|
const MachineRegisterInfo &MRI);
|
||||||
|
|
||||||
/// Find the def instruction for \p Reg, folding away any trivial copies. Note
|
/// Find the def instruction for \p Reg, folding away any trivial copies. May
|
||||||
/// it may still return a COPY, if it changes the type. May return nullptr if \p
|
/// return nullptr if \p Reg is not a generic virtual register.
|
||||||
/// Reg is not a generic virtual register.
|
|
||||||
MachineInstr *getDefIgnoringCopies(Register Reg,
|
MachineInstr *getDefIgnoringCopies(Register Reg,
|
||||||
const MachineRegisterInfo &MRI);
|
const MachineRegisterInfo &MRI);
|
||||||
|
|
||||||
|
|
|
@ -365,7 +365,7 @@ getDefSrcRegIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI) {
|
||||||
while (DefMI->getOpcode() == TargetOpcode::COPY) {
|
while (DefMI->getOpcode() == TargetOpcode::COPY) {
|
||||||
Register SrcReg = DefMI->getOperand(1).getReg();
|
Register SrcReg = DefMI->getOperand(1).getReg();
|
||||||
auto SrcTy = MRI.getType(SrcReg);
|
auto SrcTy = MRI.getType(SrcReg);
|
||||||
if (!SrcTy.isValid() || SrcTy != DstTy)
|
if (!SrcTy.isValid())
|
||||||
break;
|
break;
|
||||||
DefMI = MRI.getVRegDef(SrcReg);
|
DefMI = MRI.getVRegDef(SrcReg);
|
||||||
DefSrcReg = SrcReg;
|
DefSrcReg = SrcReg;
|
||||||
|
|
Loading…
Reference in New Issue