mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Capitalize ArgListEntry fields. NFC.
llvm-svn: 298178
This commit is contained in:
parent
deff2f0776
commit
c91fe2d028
@ -163,6 +163,35 @@ public:
|
|||||||
// or custom.
|
// or custom.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ArgListEntry {
|
||||||
|
public:
|
||||||
|
Value *Val = nullptr;
|
||||||
|
SDValue Node = SDValue();
|
||||||
|
Type *Ty = nullptr;
|
||||||
|
bool IsSExt : 1;
|
||||||
|
bool IsZExt : 1;
|
||||||
|
bool IsInReg : 1;
|
||||||
|
bool IsSRet : 1;
|
||||||
|
bool IsNest : 1;
|
||||||
|
bool IsByVal : 1;
|
||||||
|
bool IsInAlloca : 1;
|
||||||
|
bool IsReturned : 1;
|
||||||
|
bool IsSwiftSelf : 1;
|
||||||
|
bool IsSwiftError : 1;
|
||||||
|
uint16_t Alignment = 0;
|
||||||
|
|
||||||
|
ArgListEntry()
|
||||||
|
: IsSExt(false), IsZExt(false), IsInReg(false), IsSRet(false),
|
||||||
|
IsNest(false), IsByVal(false), IsInAlloca(false), IsReturned(false),
|
||||||
|
IsSwiftSelf(false), IsSwiftError(false) {}
|
||||||
|
|
||||||
|
void setAttributes(ImmutableCallSite *CS, unsigned AttrIdx);
|
||||||
|
};
|
||||||
|
typedef std::vector<ArgListEntry> ArgListTy;
|
||||||
|
|
||||||
|
virtual void markLibCallAttributes(MachineFunction *MF, unsigned CC,
|
||||||
|
ArgListTy &Args) const {};
|
||||||
|
|
||||||
static ISD::NodeType getExtendForContent(BooleanContent Content) {
|
static ISD::NodeType getExtendForContent(BooleanContent Content) {
|
||||||
switch (Content) {
|
switch (Content) {
|
||||||
case UndefinedBooleanContent:
|
case UndefinedBooleanContent:
|
||||||
@ -2550,30 +2579,6 @@ public:
|
|||||||
llvm_unreachable("Not Implemented");
|
llvm_unreachable("Not Implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ArgListEntry {
|
|
||||||
SDValue Node;
|
|
||||||
Type* Ty;
|
|
||||||
bool isSExt : 1;
|
|
||||||
bool isZExt : 1;
|
|
||||||
bool isInReg : 1;
|
|
||||||
bool isSRet : 1;
|
|
||||||
bool isNest : 1;
|
|
||||||
bool isByVal : 1;
|
|
||||||
bool isInAlloca : 1;
|
|
||||||
bool isReturned : 1;
|
|
||||||
bool isSwiftSelf : 1;
|
|
||||||
bool isSwiftError : 1;
|
|
||||||
uint16_t Alignment;
|
|
||||||
|
|
||||||
ArgListEntry() : isSExt(false), isZExt(false), isInReg(false),
|
|
||||||
isSRet(false), isNest(false), isByVal(false), isInAlloca(false),
|
|
||||||
isReturned(false), isSwiftSelf(false), isSwiftError(false),
|
|
||||||
Alignment(0) {}
|
|
||||||
|
|
||||||
void setAttributes(ImmutableCallSite *CS, unsigned AttrIdx);
|
|
||||||
};
|
|
||||||
typedef std::vector<ArgListEntry> ArgListTy;
|
|
||||||
|
|
||||||
/// This structure contains all information that is necessary for lowering
|
/// This structure contains all information that is necessary for lowering
|
||||||
/// calls. It is passed to TLI::LowerCallTo when the SelectionDAG builder
|
/// calls. It is passed to TLI::LowerCallTo when the SelectionDAG builder
|
||||||
/// needs to lower a call, and targets will see this struct in their LowerCall
|
/// needs to lower a call, and targets will see this struct in their LowerCall
|
||||||
|
@ -1909,8 +1909,8 @@ SDValue SelectionDAGLegalize::ExpandLibCall(RTLIB::Libcall LC, SDNode *Node,
|
|||||||
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
||||||
Entry.Node = Op;
|
Entry.Node = Op;
|
||||||
Entry.Ty = ArgTy;
|
Entry.Ty = ArgTy;
|
||||||
Entry.isSExt = isSigned;
|
Entry.IsSExt = isSigned;
|
||||||
Entry.isZExt = !isSigned;
|
Entry.IsZExt = !isSigned;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
}
|
}
|
||||||
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
||||||
@ -1960,8 +1960,8 @@ SDValue SelectionDAGLegalize::ExpandLibCall(RTLIB::Libcall LC, EVT RetVT,
|
|||||||
for (unsigned i = 0; i != NumOps; ++i) {
|
for (unsigned i = 0; i != NumOps; ++i) {
|
||||||
Entry.Node = Ops[i];
|
Entry.Node = Ops[i];
|
||||||
Entry.Ty = Entry.Node.getValueType().getTypeForEVT(*DAG.getContext());
|
Entry.Ty = Entry.Node.getValueType().getTypeForEVT(*DAG.getContext());
|
||||||
Entry.isSExt = isSigned;
|
Entry.IsSExt = isSigned;
|
||||||
Entry.isZExt = !isSigned;
|
Entry.IsZExt = !isSigned;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
}
|
}
|
||||||
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
||||||
@ -1994,8 +1994,8 @@ SelectionDAGLegalize::ExpandChainLibCall(RTLIB::Libcall LC,
|
|||||||
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
||||||
Entry.Node = Node->getOperand(i);
|
Entry.Node = Node->getOperand(i);
|
||||||
Entry.Ty = ArgTy;
|
Entry.Ty = ArgTy;
|
||||||
Entry.isSExt = isSigned;
|
Entry.IsSExt = isSigned;
|
||||||
Entry.isZExt = !isSigned;
|
Entry.IsZExt = !isSigned;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
}
|
}
|
||||||
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
||||||
@ -2081,8 +2081,8 @@ SelectionDAGLegalize::ExpandDivRemLibCall(SDNode *Node,
|
|||||||
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
||||||
Entry.Node = Op;
|
Entry.Node = Op;
|
||||||
Entry.Ty = ArgTy;
|
Entry.Ty = ArgTy;
|
||||||
Entry.isSExt = isSigned;
|
Entry.IsSExt = isSigned;
|
||||||
Entry.isZExt = !isSigned;
|
Entry.IsZExt = !isSigned;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2090,8 +2090,8 @@ SelectionDAGLegalize::ExpandDivRemLibCall(SDNode *Node,
|
|||||||
SDValue FIPtr = DAG.CreateStackTemporary(RetVT);
|
SDValue FIPtr = DAG.CreateStackTemporary(RetVT);
|
||||||
Entry.Node = FIPtr;
|
Entry.Node = FIPtr;
|
||||||
Entry.Ty = RetTy->getPointerTo();
|
Entry.Ty = RetTy->getPointerTo();
|
||||||
Entry.isSExt = isSigned;
|
Entry.IsSExt = isSigned;
|
||||||
Entry.isZExt = !isSigned;
|
Entry.IsZExt = !isSigned;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
||||||
@ -2185,24 +2185,24 @@ SelectionDAGLegalize::ExpandSinCosLibCall(SDNode *Node,
|
|||||||
// Pass the argument.
|
// Pass the argument.
|
||||||
Entry.Node = Node->getOperand(0);
|
Entry.Node = Node->getOperand(0);
|
||||||
Entry.Ty = RetTy;
|
Entry.Ty = RetTy;
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
// Pass the return address of sin.
|
// Pass the return address of sin.
|
||||||
SDValue SinPtr = DAG.CreateStackTemporary(RetVT);
|
SDValue SinPtr = DAG.CreateStackTemporary(RetVT);
|
||||||
Entry.Node = SinPtr;
|
Entry.Node = SinPtr;
|
||||||
Entry.Ty = RetTy->getPointerTo();
|
Entry.Ty = RetTy->getPointerTo();
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
// Also pass the return address of the cos.
|
// Also pass the return address of the cos.
|
||||||
SDValue CosPtr = DAG.CreateStackTemporary(RetVT);
|
SDValue CosPtr = DAG.CreateStackTemporary(RetVT);
|
||||||
Entry.Node = CosPtr;
|
Entry.Node = CosPtr;
|
||||||
Entry.Ty = RetTy->getPointerTo();
|
Entry.Ty = RetTy->getPointerTo();
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
||||||
|
@ -2590,22 +2590,23 @@ void DAGTypeLegalizer::ExpandIntRes_XMULO(SDNode *N,
|
|||||||
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
||||||
Entry.Node = Op;
|
Entry.Node = Op;
|
||||||
Entry.Ty = ArgTy;
|
Entry.Ty = ArgTy;
|
||||||
Entry.isSExt = true;
|
Entry.IsSExt = true;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also pass the address of the overflow check.
|
// Also pass the address of the overflow check.
|
||||||
Entry.Node = Temp;
|
Entry.Node = Temp;
|
||||||
Entry.Ty = PtrTy->getPointerTo();
|
Entry.Ty = PtrTy->getPointerTo();
|
||||||
Entry.isSExt = true;
|
Entry.IsSExt = true;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
SDValue Func = DAG.getExternalSymbol(TLI.getLibcallName(LC), PtrVT);
|
SDValue Func = DAG.getExternalSymbol(TLI.getLibcallName(LC), PtrVT);
|
||||||
|
|
||||||
TargetLowering::CallLoweringInfo CLI(DAG);
|
TargetLowering::CallLoweringInfo CLI(DAG);
|
||||||
CLI.setDebugLoc(dl).setChain(Chain)
|
CLI.setDebugLoc(dl)
|
||||||
|
.setChain(Chain)
|
||||||
.setCallee(TLI.getLibcallCallingConv(LC), RetTy, Func, std::move(Args))
|
.setCallee(TLI.getLibcallCallingConv(LC), RetTy, Func, std::move(Args))
|
||||||
.setSExtResult();
|
.setSExtResult();
|
||||||
|
|
||||||
|
@ -1084,8 +1084,8 @@ DAGTypeLegalizer::ExpandChainLibCall(RTLIB::Libcall LC, SDNode *Node,
|
|||||||
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
||||||
Entry.Node = Node->getOperand(i);
|
Entry.Node = Node->getOperand(i);
|
||||||
Entry.Ty = ArgTy;
|
Entry.Ty = ArgTy;
|
||||||
Entry.isSExt = isSigned;
|
Entry.IsSExt = isSigned;
|
||||||
Entry.isZExt = !isSigned;
|
Entry.IsZExt = !isSigned;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
}
|
}
|
||||||
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
|
||||||
|
@ -2032,7 +2032,7 @@ void SelectionDAGBuilder::visitSPDescriptorParent(StackProtectorDescriptor &SPD,
|
|||||||
Entry.Node = StackSlot;
|
Entry.Node = StackSlot;
|
||||||
Entry.Ty = FnTy->getParamType(0);
|
Entry.Ty = FnTy->getParamType(0);
|
||||||
if (Fn->hasAttribute(1, Attribute::AttrKind::InReg))
|
if (Fn->hasAttribute(1, Attribute::AttrKind::InReg))
|
||||||
Entry.isInReg = true;
|
Entry.IsInReg = true;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
TargetLowering::CallLoweringInfo CLI(DAG);
|
TargetLowering::CallLoweringInfo CLI(DAG);
|
||||||
@ -4912,12 +4912,10 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
|
|||||||
report_fatal_error("Unsupported element size");
|
report_fatal_error("Unsupported element size");
|
||||||
|
|
||||||
TargetLowering::CallLoweringInfo CLI(DAG);
|
TargetLowering::CallLoweringInfo CLI(DAG);
|
||||||
CLI.setDebugLoc(sdl)
|
CLI.setDebugLoc(sdl).setChain(getRoot()).setCallee(
|
||||||
.setChain(getRoot())
|
TLI.getLibcallCallingConv(LibraryCall),
|
||||||
.setCallee(TLI.getLibcallCallingConv(LibraryCall),
|
|
||||||
Type::getVoidTy(*DAG.getContext()),
|
Type::getVoidTy(*DAG.getContext()),
|
||||||
DAG.getExternalSymbol(
|
DAG.getExternalSymbol(TLI.getLibcallName(LibraryCall),
|
||||||
TLI.getLibcallName(LibraryCall),
|
|
||||||
TLI.getPointerTy(DAG.getDataLayout())),
|
TLI.getPointerTy(DAG.getDataLayout())),
|
||||||
std::move(Args));
|
std::move(Args));
|
||||||
|
|
||||||
@ -5857,7 +5855,6 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
|
|||||||
Type *RetTy = CS.getType();
|
Type *RetTy = CS.getType();
|
||||||
|
|
||||||
TargetLowering::ArgListTy Args;
|
TargetLowering::ArgListTy Args;
|
||||||
TargetLowering::ArgListEntry Entry;
|
|
||||||
Args.reserve(CS.arg_size());
|
Args.reserve(CS.arg_size());
|
||||||
|
|
||||||
const Value *SwiftErrorVal = nullptr;
|
const Value *SwiftErrorVal = nullptr;
|
||||||
@ -5873,6 +5870,7 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
|
|||||||
|
|
||||||
for (ImmutableCallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end();
|
for (ImmutableCallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end();
|
||||||
i != e; ++i) {
|
i != e; ++i) {
|
||||||
|
TargetLowering::ArgListEntry Entry;
|
||||||
const Value *V = *i;
|
const Value *V = *i;
|
||||||
|
|
||||||
// Skip empty types
|
// Skip empty types
|
||||||
@ -5886,7 +5884,7 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
|
|||||||
Entry.setAttributes(&CS, i - CS.arg_begin() + 1);
|
Entry.setAttributes(&CS, i - CS.arg_begin() + 1);
|
||||||
|
|
||||||
// Use swifterror virtual register as input to the call.
|
// Use swifterror virtual register as input to the call.
|
||||||
if (Entry.isSwiftError && TLI.supportSwiftError()) {
|
if (Entry.IsSwiftError && TLI.supportSwiftError()) {
|
||||||
SwiftErrorVal = V;
|
SwiftErrorVal = V;
|
||||||
// We find the virtual register for the actual swifterror argument.
|
// We find the virtual register for the actual swifterror argument.
|
||||||
// Instead of using the Value, we use the virtual register instead.
|
// Instead of using the Value, we use the virtual register instead.
|
||||||
@ -5899,7 +5897,7 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
|
|||||||
|
|
||||||
// If we have an explicit sret argument that is an Instruction, (i.e., it
|
// If we have an explicit sret argument that is an Instruction, (i.e., it
|
||||||
// might point to function-local memory), we can't meaningfully tail-call.
|
// might point to function-local memory), we can't meaningfully tail-call.
|
||||||
if (Entry.isSRet && isa<Instruction>(V))
|
if (Entry.IsSRet && isa<Instruction>(V))
|
||||||
isTailCall = false;
|
isTailCall = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7657,15 +7655,15 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||||||
ArgListEntry Entry;
|
ArgListEntry Entry;
|
||||||
Entry.Node = DemoteStackSlot;
|
Entry.Node = DemoteStackSlot;
|
||||||
Entry.Ty = StackSlotPtrType;
|
Entry.Ty = StackSlotPtrType;
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Entry.isInReg = false;
|
Entry.IsInReg = false;
|
||||||
Entry.isSRet = true;
|
Entry.IsSRet = true;
|
||||||
Entry.isNest = false;
|
Entry.IsNest = false;
|
||||||
Entry.isByVal = false;
|
Entry.IsByVal = false;
|
||||||
Entry.isReturned = false;
|
Entry.IsReturned = false;
|
||||||
Entry.isSwiftSelf = false;
|
Entry.IsSwiftSelf = false;
|
||||||
Entry.isSwiftError = false;
|
Entry.IsSwiftError = false;
|
||||||
Entry.Alignment = Align;
|
Entry.Alignment = Align;
|
||||||
CLI.getArgs().insert(CLI.getArgs().begin(), Entry);
|
CLI.getArgs().insert(CLI.getArgs().begin(), Entry);
|
||||||
CLI.RetTy = Type::getVoidTy(CLI.RetTy->getContext());
|
CLI.RetTy = Type::getVoidTy(CLI.RetTy->getContext());
|
||||||
@ -7698,7 +7696,7 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||||||
ArgListTy &Args = CLI.getArgs();
|
ArgListTy &Args = CLI.getArgs();
|
||||||
if (supportSwiftError()) {
|
if (supportSwiftError()) {
|
||||||
for (unsigned i = 0, e = Args.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Args.size(); i != e; ++i) {
|
||||||
if (Args[i].isSwiftError) {
|
if (Args[i].IsSwiftError) {
|
||||||
ISD::InputArg MyFlags;
|
ISD::InputArg MyFlags;
|
||||||
MyFlags.VT = getPointerTy(DL);
|
MyFlags.VT = getPointerTy(DL);
|
||||||
MyFlags.ArgVT = EVT(getPointerTy(DL));
|
MyFlags.ArgVT = EVT(getPointerTy(DL));
|
||||||
@ -7715,7 +7713,7 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||||||
SmallVector<EVT, 4> ValueVTs;
|
SmallVector<EVT, 4> ValueVTs;
|
||||||
ComputeValueVTs(*this, DL, Args[i].Ty, ValueVTs);
|
ComputeValueVTs(*this, DL, Args[i].Ty, ValueVTs);
|
||||||
Type *FinalType = Args[i].Ty;
|
Type *FinalType = Args[i].Ty;
|
||||||
if (Args[i].isByVal)
|
if (Args[i].IsByVal)
|
||||||
FinalType = cast<PointerType>(Args[i].Ty)->getElementType();
|
FinalType = cast<PointerType>(Args[i].Ty)->getElementType();
|
||||||
bool NeedsRegBlock = functionArgumentNeedsConsecutiveRegisters(
|
bool NeedsRegBlock = functionArgumentNeedsConsecutiveRegisters(
|
||||||
FinalType, CLI.CallConv, CLI.IsVarArg);
|
FinalType, CLI.CallConv, CLI.IsVarArg);
|
||||||
@ -7728,11 +7726,11 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||||||
ISD::ArgFlagsTy Flags;
|
ISD::ArgFlagsTy Flags;
|
||||||
unsigned OriginalAlignment = DL.getABITypeAlignment(ArgTy);
|
unsigned OriginalAlignment = DL.getABITypeAlignment(ArgTy);
|
||||||
|
|
||||||
if (Args[i].isZExt)
|
if (Args[i].IsZExt)
|
||||||
Flags.setZExt();
|
Flags.setZExt();
|
||||||
if (Args[i].isSExt)
|
if (Args[i].IsSExt)
|
||||||
Flags.setSExt();
|
Flags.setSExt();
|
||||||
if (Args[i].isInReg) {
|
if (Args[i].IsInReg) {
|
||||||
// If we are using vectorcall calling convention, a structure that is
|
// If we are using vectorcall calling convention, a structure that is
|
||||||
// passed InReg - is surely an HVA
|
// passed InReg - is surely an HVA
|
||||||
if (CLI.CallConv == CallingConv::X86_VectorCall &&
|
if (CLI.CallConv == CallingConv::X86_VectorCall &&
|
||||||
@ -7745,15 +7743,15 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||||||
// Set InReg Flag
|
// Set InReg Flag
|
||||||
Flags.setInReg();
|
Flags.setInReg();
|
||||||
}
|
}
|
||||||
if (Args[i].isSRet)
|
if (Args[i].IsSRet)
|
||||||
Flags.setSRet();
|
Flags.setSRet();
|
||||||
if (Args[i].isSwiftSelf)
|
if (Args[i].IsSwiftSelf)
|
||||||
Flags.setSwiftSelf();
|
Flags.setSwiftSelf();
|
||||||
if (Args[i].isSwiftError)
|
if (Args[i].IsSwiftError)
|
||||||
Flags.setSwiftError();
|
Flags.setSwiftError();
|
||||||
if (Args[i].isByVal)
|
if (Args[i].IsByVal)
|
||||||
Flags.setByVal();
|
Flags.setByVal();
|
||||||
if (Args[i].isInAlloca) {
|
if (Args[i].IsInAlloca) {
|
||||||
Flags.setInAlloca();
|
Flags.setInAlloca();
|
||||||
// Set the byval flag for CCAssignFn callbacks that don't know about
|
// Set the byval flag for CCAssignFn callbacks that don't know about
|
||||||
// inalloca. This way we can know how many bytes we should've allocated
|
// inalloca. This way we can know how many bytes we should've allocated
|
||||||
@ -7762,7 +7760,7 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||||||
// in the various CC lowering callbacks.
|
// in the various CC lowering callbacks.
|
||||||
Flags.setByVal();
|
Flags.setByVal();
|
||||||
}
|
}
|
||||||
if (Args[i].isByVal || Args[i].isInAlloca) {
|
if (Args[i].IsByVal || Args[i].IsInAlloca) {
|
||||||
PointerType *Ty = cast<PointerType>(Args[i].Ty);
|
PointerType *Ty = cast<PointerType>(Args[i].Ty);
|
||||||
Type *ElementTy = Ty->getElementType();
|
Type *ElementTy = Ty->getElementType();
|
||||||
Flags.setByValSize(DL.getTypeAllocSize(ElementTy));
|
Flags.setByValSize(DL.getTypeAllocSize(ElementTy));
|
||||||
@ -7775,7 +7773,7 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||||||
FrameAlign = getByValTypeAlignment(ElementTy, DL);
|
FrameAlign = getByValTypeAlignment(ElementTy, DL);
|
||||||
Flags.setByValAlign(FrameAlign);
|
Flags.setByValAlign(FrameAlign);
|
||||||
}
|
}
|
||||||
if (Args[i].isNest)
|
if (Args[i].IsNest)
|
||||||
Flags.setNest();
|
Flags.setNest();
|
||||||
if (NeedsRegBlock)
|
if (NeedsRegBlock)
|
||||||
Flags.setInConsecutiveRegs();
|
Flags.setInConsecutiveRegs();
|
||||||
@ -7786,13 +7784,13 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||||||
SmallVector<SDValue, 4> Parts(NumParts);
|
SmallVector<SDValue, 4> Parts(NumParts);
|
||||||
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
|
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
|
||||||
|
|
||||||
if (Args[i].isSExt)
|
if (Args[i].IsSExt)
|
||||||
ExtendKind = ISD::SIGN_EXTEND;
|
ExtendKind = ISD::SIGN_EXTEND;
|
||||||
else if (Args[i].isZExt)
|
else if (Args[i].IsZExt)
|
||||||
ExtendKind = ISD::ZERO_EXTEND;
|
ExtendKind = ISD::ZERO_EXTEND;
|
||||||
|
|
||||||
// Conservatively only handle 'returned' on non-vectors for now
|
// Conservatively only handle 'returned' on non-vectors for now
|
||||||
if (Args[i].isReturned && !Op.getValueType().isVector()) {
|
if (Args[i].IsReturned && !Op.getValueType().isVector()) {
|
||||||
assert(CLI.RetTy == Args[i].Ty && RetTys.size() == NumValues &&
|
assert(CLI.RetTy == Args[i].Ty && RetTys.size() == NumValues &&
|
||||||
"unexpected use of 'returned'");
|
"unexpected use of 'returned'");
|
||||||
// Before passing 'returned' to the target lowering code, ensure that
|
// Before passing 'returned' to the target lowering code, ensure that
|
||||||
@ -7806,8 +7804,8 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
|
|||||||
// parameter extension method is not compatible with the return
|
// parameter extension method is not compatible with the return
|
||||||
// extension method
|
// extension method
|
||||||
if ((NumParts * PartVT.getSizeInBits() == VT.getSizeInBits()) ||
|
if ((NumParts * PartVT.getSizeInBits() == VT.getSizeInBits()) ||
|
||||||
(ExtendKind != ISD::ANY_EXTEND &&
|
(ExtendKind != ISD::ANY_EXTEND && CLI.RetSExt == Args[i].IsSExt &&
|
||||||
CLI.RetSExt == Args[i].isSExt && CLI.RetZExt == Args[i].isZExt))
|
CLI.RetZExt == Args[i].IsZExt))
|
||||||
Flags.setReturned();
|
Flags.setReturned();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,16 +98,16 @@ bool TargetLowering::parametersInCSRMatch(const MachineRegisterInfo &MRI,
|
|||||||
/// and called function attributes.
|
/// and called function attributes.
|
||||||
void TargetLowering::ArgListEntry::setAttributes(ImmutableCallSite *CS,
|
void TargetLowering::ArgListEntry::setAttributes(ImmutableCallSite *CS,
|
||||||
unsigned AttrIdx) {
|
unsigned AttrIdx) {
|
||||||
isSExt = CS->paramHasAttr(AttrIdx, Attribute::SExt);
|
IsSExt = CS->paramHasAttr(AttrIdx, Attribute::SExt);
|
||||||
isZExt = CS->paramHasAttr(AttrIdx, Attribute::ZExt);
|
IsZExt = CS->paramHasAttr(AttrIdx, Attribute::ZExt);
|
||||||
isInReg = CS->paramHasAttr(AttrIdx, Attribute::InReg);
|
IsInReg = CS->paramHasAttr(AttrIdx, Attribute::InReg);
|
||||||
isSRet = CS->paramHasAttr(AttrIdx, Attribute::StructRet);
|
IsSRet = CS->paramHasAttr(AttrIdx, Attribute::StructRet);
|
||||||
isNest = CS->paramHasAttr(AttrIdx, Attribute::Nest);
|
IsNest = CS->paramHasAttr(AttrIdx, Attribute::Nest);
|
||||||
isByVal = CS->paramHasAttr(AttrIdx, Attribute::ByVal);
|
IsByVal = CS->paramHasAttr(AttrIdx, Attribute::ByVal);
|
||||||
isInAlloca = CS->paramHasAttr(AttrIdx, Attribute::InAlloca);
|
IsInAlloca = CS->paramHasAttr(AttrIdx, Attribute::InAlloca);
|
||||||
isReturned = CS->paramHasAttr(AttrIdx, Attribute::Returned);
|
IsReturned = CS->paramHasAttr(AttrIdx, Attribute::Returned);
|
||||||
isSwiftSelf = CS->paramHasAttr(AttrIdx, Attribute::SwiftSelf);
|
IsSwiftSelf = CS->paramHasAttr(AttrIdx, Attribute::SwiftSelf);
|
||||||
isSwiftError = CS->paramHasAttr(AttrIdx, Attribute::SwiftError);
|
IsSwiftError = CS->paramHasAttr(AttrIdx, Attribute::SwiftError);
|
||||||
Alignment = CS->getParamAlignment(AttrIdx);
|
Alignment = CS->getParamAlignment(AttrIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +125,8 @@ TargetLowering::makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC, EVT RetVT,
|
|||||||
for (SDValue Op : Ops) {
|
for (SDValue Op : Ops) {
|
||||||
Entry.Node = Op;
|
Entry.Node = Op;
|
||||||
Entry.Ty = Entry.Node.getValueType().getTypeForEVT(*DAG.getContext());
|
Entry.Ty = Entry.Node.getValueType().getTypeForEVT(*DAG.getContext());
|
||||||
Entry.isSExt = shouldSignExtendTypeInLibCall(Op.getValueType(), isSigned);
|
Entry.IsSExt = shouldSignExtendTypeInLibCall(Op.getValueType(), isSigned);
|
||||||
Entry.isZExt = !shouldSignExtendTypeInLibCall(Op.getValueType(), isSigned);
|
Entry.IsZExt = !shouldSignExtendTypeInLibCall(Op.getValueType(), isSigned);
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2112,8 +2112,8 @@ SDValue AArch64TargetLowering::LowerFSINCOS(SDValue Op,
|
|||||||
|
|
||||||
Entry.Node = Arg;
|
Entry.Node = Arg;
|
||||||
Entry.Ty = ArgTy;
|
Entry.Ty = ArgTy;
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
const char *LibcallName =
|
const char *LibcallName =
|
||||||
|
@ -42,7 +42,8 @@ SDValue AArch64SelectionDAGInfo::EmitTargetCodeForMemset(
|
|||||||
Entry.Node = Size;
|
Entry.Node = Size;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
TargetLowering::CallLoweringInfo CLI(DAG);
|
TargetLowering::CallLoweringInfo CLI(DAG);
|
||||||
CLI.setDebugLoc(dl).setChain(Chain)
|
CLI.setDebugLoc(dl)
|
||||||
|
.setChain(Chain)
|
||||||
.setCallee(CallingConv::C, Type::getVoidTy(*DAG.getContext()),
|
.setCallee(CallingConv::C, Type::getVoidTy(*DAG.getContext()),
|
||||||
DAG.getExternalSymbol(bzeroEntry, IntPtr), std::move(Args))
|
DAG.getExternalSymbol(bzeroEntry, IntPtr), std::move(Args))
|
||||||
.setDiscardResult();
|
.setDiscardResult();
|
||||||
|
@ -2873,8 +2873,8 @@ ARMTargetLowering::LowerToTLSGeneralDynamicModel(GlobalAddressSDNode *GA,
|
|||||||
|
|
||||||
// FIXME: is there useful debug info available here?
|
// FIXME: is there useful debug info available here?
|
||||||
TargetLowering::CallLoweringInfo CLI(DAG);
|
TargetLowering::CallLoweringInfo CLI(DAG);
|
||||||
CLI.setDebugLoc(dl).setChain(Chain)
|
CLI.setDebugLoc(dl).setChain(Chain).setCallee(
|
||||||
.setCallee(CallingConv::C, Type::getInt32Ty(*DAG.getContext()),
|
CallingConv::C, Type::getInt32Ty(*DAG.getContext()),
|
||||||
DAG.getExternalSymbol("__tls_get_addr", PtrVT), std::move(Args));
|
DAG.getExternalSymbol("__tls_get_addr", PtrVT), std::move(Args));
|
||||||
|
|
||||||
std::pair<SDValue, SDValue> CallResult = LowerCallTo(CLI);
|
std::pair<SDValue, SDValue> CallResult = LowerCallTo(CLI);
|
||||||
@ -7350,9 +7350,9 @@ SDValue ARMTargetLowering::LowerFSINCOS(SDValue Op, SelectionDAG &DAG) const {
|
|||||||
ArgListEntry Entry;
|
ArgListEntry Entry;
|
||||||
Entry.Node = SRet;
|
Entry.Node = SRet;
|
||||||
Entry.Ty = RetTy->getPointerTo();
|
Entry.Ty = RetTy->getPointerTo();
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Entry.isSRet = true;
|
Entry.IsSRet = true;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
RetTy = Type::getVoidTy(*DAG.getContext());
|
RetTy = Type::getVoidTy(*DAG.getContext());
|
||||||
}
|
}
|
||||||
@ -7360,8 +7360,8 @@ SDValue ARMTargetLowering::LowerFSINCOS(SDValue Op, SelectionDAG &DAG) const {
|
|||||||
ArgListEntry Entry;
|
ArgListEntry Entry;
|
||||||
Entry.Node = Arg;
|
Entry.Node = Arg;
|
||||||
Entry.Ty = ArgTy;
|
Entry.Ty = ArgTy;
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
const char *LibcallName =
|
const char *LibcallName =
|
||||||
@ -7572,12 +7572,12 @@ static SDValue LowerFPOWI(SDValue Op, const ARMSubtarget &Subtarget,
|
|||||||
|
|
||||||
Entry.Node = Val;
|
Entry.Node = Val;
|
||||||
Entry.Ty = Val.getValueType().getTypeForEVT(*DAG.getContext());
|
Entry.Ty = Val.getValueType().getTypeForEVT(*DAG.getContext());
|
||||||
Entry.isZExt = true;
|
Entry.IsZExt = true;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
Entry.Node = Exponent;
|
Entry.Node = Exponent;
|
||||||
Entry.Ty = Exponent.getValueType().getTypeForEVT(*DAG.getContext());
|
Entry.Ty = Exponent.getValueType().getTypeForEVT(*DAG.getContext());
|
||||||
Entry.isZExt = true;
|
Entry.IsZExt = true;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
Type *LCRTy = Val.getValueType().getTypeForEVT(*DAG.getContext());
|
Type *LCRTy = Val.getValueType().getTypeForEVT(*DAG.getContext());
|
||||||
@ -13012,8 +13012,8 @@ static TargetLowering::ArgListTy getDivRemArgList(
|
|||||||
Type *ArgTy = ArgVT.getTypeForEVT(*Context);
|
Type *ArgTy = ArgVT.getTypeForEVT(*Context);
|
||||||
Entry.Node = N->getOperand(i);
|
Entry.Node = N->getOperand(i);
|
||||||
Entry.Ty = ArgTy;
|
Entry.Ty = ArgTy;
|
||||||
Entry.isSExt = isSigned;
|
Entry.IsSExt = isSigned;
|
||||||
Entry.isZExt = !isSigned;
|
Entry.IsZExt = !isSigned;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
}
|
}
|
||||||
if (Subtarget->isTargetWindows() && Args.size() >= 2)
|
if (Subtarget->isTargetWindows() && Args.size() >= 2)
|
||||||
|
@ -95,7 +95,7 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall(
|
|||||||
|
|
||||||
Entry.Node = Src;
|
Entry.Node = Src;
|
||||||
Entry.Ty = Type::getInt32Ty(*DAG.getContext());
|
Entry.Ty = Type::getInt32Ty(*DAG.getContext());
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
} else {
|
} else {
|
||||||
Entry.Node = Src;
|
Entry.Node = Src;
|
||||||
|
@ -51,10 +51,11 @@ SDValue HexagonSelectionDAGInfo::EmitTargetCodeForMemcpy(
|
|||||||
TargetLowering::CallLoweringInfo CLI(DAG);
|
TargetLowering::CallLoweringInfo CLI(DAG);
|
||||||
CLI.setDebugLoc(dl)
|
CLI.setDebugLoc(dl)
|
||||||
.setChain(Chain)
|
.setChain(Chain)
|
||||||
.setCallee(TLI.getLibcallCallingConv(RTLIB::MEMCPY),
|
.setCallee(
|
||||||
|
TLI.getLibcallCallingConv(RTLIB::MEMCPY),
|
||||||
Type::getVoidTy(*DAG.getContext()),
|
Type::getVoidTy(*DAG.getContext()),
|
||||||
DAG.getTargetExternalSymbol(SpecialMemcpyName,
|
DAG.getTargetExternalSymbol(
|
||||||
TLI.getPointerTy(DAG.getDataLayout()), Flags),
|
SpecialMemcpyName, TLI.getPointerTy(DAG.getDataLayout()), Flags),
|
||||||
std::move(Args))
|
std::move(Args))
|
||||||
.setDiscardResult();
|
.setDiscardResult();
|
||||||
|
|
||||||
|
@ -2177,8 +2177,8 @@ SparcTargetLowering::LowerF128Op(SDValue Op, SelectionDAG &DAG,
|
|||||||
Entry.Node = RetPtr;
|
Entry.Node = RetPtr;
|
||||||
Entry.Ty = PointerType::getUnqual(RetTy);
|
Entry.Ty = PointerType::getUnqual(RetTy);
|
||||||
if (!Subtarget->is64Bit())
|
if (!Subtarget->is64Bit())
|
||||||
Entry.isSRet = true;
|
Entry.IsSRet = true;
|
||||||
Entry.isReturned = false;
|
Entry.IsReturned = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
RetTyABI = Type::getVoidTy(*DAG.getContext());
|
RetTyABI = Type::getVoidTy(*DAG.getContext());
|
||||||
}
|
}
|
||||||
|
@ -21508,8 +21508,8 @@ SDValue X86TargetLowering::LowerWin64_i128OP(SDValue Op, SelectionDAG &DAG) cons
|
|||||||
MachinePointerInfo(), /* Alignment = */ 16);
|
MachinePointerInfo(), /* Alignment = */ 16);
|
||||||
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
|
||||||
Entry.Ty = PointerType::get(ArgTy,0);
|
Entry.Ty = PointerType::get(ArgTy,0);
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23227,8 +23227,8 @@ static SDValue LowerFSINCOS(SDValue Op, const X86Subtarget &Subtarget,
|
|||||||
|
|
||||||
Entry.Node = Arg;
|
Entry.Node = Arg;
|
||||||
Entry.Ty = ArgTy;
|
Entry.Ty = ArgTy;
|
||||||
Entry.isSExt = false;
|
Entry.IsSExt = false;
|
||||||
Entry.isZExt = false;
|
Entry.IsZExt = false;
|
||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
bool isF64 = ArgVT == MVT::f64;
|
bool isF64 = ArgVT == MVT::f64;
|
||||||
|
@ -85,7 +85,8 @@ SDValue X86SelectionDAGInfo::EmitTargetCodeForMemset(
|
|||||||
Args.push_back(Entry);
|
Args.push_back(Entry);
|
||||||
|
|
||||||
TargetLowering::CallLoweringInfo CLI(DAG);
|
TargetLowering::CallLoweringInfo CLI(DAG);
|
||||||
CLI.setDebugLoc(dl).setChain(Chain)
|
CLI.setDebugLoc(dl)
|
||||||
|
.setChain(Chain)
|
||||||
.setCallee(CallingConv::C, Type::getVoidTy(*DAG.getContext()),
|
.setCallee(CallingConv::C, Type::getVoidTy(*DAG.getContext()),
|
||||||
DAG.getExternalSymbol(bzeroEntry, IntPtr), std::move(Args))
|
DAG.getExternalSymbol(bzeroEntry, IntPtr), std::move(Args))
|
||||||
.setDiscardResult();
|
.setDiscardResult();
|
||||||
|
Loading…
Reference in New Issue
Block a user