Skip to content

Commit 263e637

Browse files
committed
Avoid invalid lookthrough to physical registers in Z80 call lowering
1 parent 1d62676 commit 263e637

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

llvm/lib/Target/Z80/GISel/Z80CallLowering.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,13 @@ bool Z80CallLowering::lowerCall(MachineIRBuilder &MIRBuilder,
607607
case TargetOpcode::G_GLOBAL_VALUE:
608608
case TargetOpcode::G_INTTOPTR:
609609
case TargetOpcode::G_CONSTANT:
610-
Info.Callee = MI->getOperand(1);
611-
continue;
610+
const MachineOperand CalleeMO = MI->getOperand(1);
611+
// Don't look through to physical registers.
612+
if (!CalleeMO.isReg() ||
613+
Register::isVirtualRegister(CalleeMO.getReg())) {
614+
Info.Callee = CalleeMO;
615+
continue;
616+
}
612617
}
613618
}
614619
break;

0 commit comments

Comments
 (0)