llvm.org GIT mirror llvm / b41c7e5
[StackMaps] Mark in CallLoweringInfo when lowering a patchpoint While, generally speaking, the process of lowering arguments for a patchpoint is the same as lowering a regular indirect call, on some targets it may not be exactly the same. Targets may not, for example, want to add additional register dependencies that apply only to making cross-DSO calls through linker stubs, may not want to load additional registers out of function descriptors, and may not want to add additional side-effect-causing instructions that cannot be removed later with the call itself being generated. The PowerPC target will use this in a future commit (for all of the reasons stated above). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225806 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 5 years ago
5 changed file(s) with 22 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
7575 unsigned ResultReg;
7676 unsigned NumResultRegs;
7777
78 bool IsPatchPoint;
79
7880 SmallVector OutVals;
7981 SmallVector OutFlags;
8082 SmallVector OutRegs;
8688 IsInReg(false), DoesNotReturn(false), IsReturnValueUsed(true),
8789 IsTailCall(false), NumFixedArgs(-1), CallConv(CallingConv::C),
8890 Callee(nullptr), SymName(nullptr), CS(nullptr), Call(nullptr),
89 ResultReg(0), NumResultRegs(0) {}
91 ResultReg(0), NumResultRegs(0), IsPatchPoint(false) {}
9092
9193 CallLoweringInfo &setCallee(Type *ResultTy, FunctionType *FuncTy,
9294 const Value *Target, ArgListTy &&ArgsList,
158160
159161 CallLoweringInfo &setTailCall(bool Value = true) {
160162 IsTailCall = Value;
163 return *this;
164 }
165
166 CallLoweringInfo &setIsPatchPoint(bool Value = true) {
167 IsPatchPoint = Value;
161168 return *this;
162169 }
163170
22982298 SelectionDAG &DAG;
22992299 SDLoc DL;
23002300 ImmutableCallSite *CS;
2301 bool IsPatchPoint;
23012302 SmallVector Outs;
23022303 SmallVector OutVals;
23032304 SmallVector Ins;
23062307 : RetTy(nullptr), RetSExt(false), RetZExt(false), IsVarArg(false),
23072308 IsInReg(false), DoesNotReturn(false), IsReturnValueUsed(true),
23082309 IsTailCall(false), NumFixedArgs(-1), CallConv(CallingConv::C),
2309 DAG(DAG), CS(nullptr) {}
2310 DAG(DAG), CS(nullptr), IsPatchPoint(false) {}
23102311
23112312 CallLoweringInfo &setDebugLoc(SDLoc dl) {
23122313 DL = dl;
23852386
23862387 CallLoweringInfo &setZExtResult(bool Value = true) {
23872388 RetZExt = Value;
2389 return *this;
2390 }
2391
2392 CallLoweringInfo &setIsPatchPoint(bool Value = true) {
2393 IsPatchPoint = Value;
23882394 return *this;
23892395 }
23902396
727727 // For AnyRegCC the arguments are lowered later on manually.
728728 unsigned NumCallArgs = IsAnyRegCC ? 0 : NumArgs;
729729 CallLoweringInfo CLI;
730 CLI.setIsPatchPoint();
730731 if (!lowerCallOperands(I, NumMetaOpers, NumCallArgs, Callee, IsAnyRegCC, CLI))
731732 return false;
732733
70227022 SelectionDAGBuilder::lowerCallOperands(ImmutableCallSite CS, unsigned ArgIdx,
70237023 unsigned NumArgs, SDValue Callee,
70247024 bool UseVoidTy,
7025 MachineBasicBlock *LandingPad) {
7025 MachineBasicBlock *LandingPad,
7026 bool IsPatchPoint) {
70267027 TargetLowering::ArgListTy Args;
70277028 Args.reserve(NumArgs);
70287029
70457046 TargetLowering::CallLoweringInfo CLI(DAG);
70467047 CLI.setDebugLoc(getCurSDLoc()).setChain(getRoot())
70477048 .setCallee(CS.getCallingConv(), retTy, Callee, std::move(Args), NumArgs)
7048 .setDiscardResult(CS->use_empty());
7049 .setDiscardResult(CS->use_empty()).setIsPatchPoint(IsPatchPoint);
70497050
70507051 return lowerInvokable(CLI, LandingPad);
70517052 }
71777178 unsigned NumCallArgs = IsAnyRegCC ? 0 : NumArgs;
71787179 std::pair Result =
71797180 lowerCallOperands(CS, NumMetaOpers, NumCallArgs, Callee, IsAnyRegCC,
7180 LandingPad);
7181 LandingPad, true);
71817182
71827183 SDNode *CallEnd = Result.second.getNode();
71837184 if (HasDef && (CallEnd->getOpcode() == ISD::CopyFromReg))
652652 unsigned NumArgs,
653653 SDValue Callee,
654654 bool UseVoidTy = false,
655 MachineBasicBlock *LandingPad = nullptr);
655 MachineBasicBlock *LandingPad = nullptr,
656 bool IsPatchPoint = false);
656657
657658 /// UpdateSplitBlock - When an MBB was split during scheduling, update the
658659 /// references that need to refer to the last resulting block.