Unlike the call handling, this wasn't checking for void results and
creating a register with the invalid LLT
llvm-svn: 358110
ArgInfo(unsigned Reg, Type *Ty, ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy{},
bool IsFixed = true)
- : Reg(Reg), Ty(Ty), Flags(Flags), IsFixed(IsFixed) {}
+ : Reg(Reg), Ty(Ty), Flags(Flags), IsFixed(IsFixed) {
+ assert((Ty->isVoidTy() == (Reg == 0)) &&
+ "only void types should have no register");
+ }
};
/// Argument handling is mostly uniform between the four places that
MCSymbol *BeginSymbol = Context.createTempSymbol();
MIRBuilder.buildInstr(TargetOpcode::EH_LABEL).addSym(BeginSymbol);
- unsigned Res =
- MRI->createGenericVirtualRegister(getLLTForType(*I.getType(), *DL));
+ unsigned Res = 0;
+ if (!I.getType()->isVoidTy())
+ Res = MRI->createGenericVirtualRegister(getLLTForType(*I.getType(), *DL));
SmallVector<unsigned, 8> Args;
for (auto &Arg: I.arg_operands())
Args.push_back(packRegs(*Arg, MIRBuilder));