@@ -665,10 +665,6 @@ SDValue RISCVTargetLowering::lowerGlobalTLSAddress(SDValue Op,
665
665
666
666
TLSModel::Model Model = getTargetMachine ().getTLSModel (N->getGlobal ());
667
667
668
- if (DAG.getMachineFunction ().getFunction ().getCallingConv () ==
669
- CallingConv::GHC)
670
- report_fatal_error (" In GHC calling convention TLS is not supported" );
671
-
672
668
SDValue Addr;
673
669
switch (Model) {
674
670
case TLSModel::LocalExec:
@@ -2244,71 +2240,22 @@ static bool CC_RISCV_FastCC(unsigned ValNo, MVT ValVT, MVT LocVT,
2244
2240
return true ; // CC didn't match.
2245
2241
}
2246
2242
2247
- static bool CC_RISCV_GHC (unsigned ValNo, MVT ValVT, MVT LocVT,
2248
- CCValAssign::LocInfo LocInfo,
2249
- ISD::ArgFlagsTy ArgFlags, CCState &State) {
2250
-
2251
- if (LocVT == MVT::i32 || LocVT == MVT::i64 ) {
2252
- // Pass in STG registers: Base, Sp, Hp, R1, R2, R3, R4, R5, R6, R7, SpLim
2253
- // s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11
2254
- static const MCPhysReg GPRList[] = {
2255
- RISCV::X9, RISCV::X18, RISCV::X19, RISCV::X20, RISCV::X21, RISCV::X22,
2256
- RISCV::X23, RISCV::X24, RISCV::X25, RISCV::X26, RISCV::X27};
2257
- if (unsigned Reg = State.AllocateReg (GPRList)) {
2258
- State.addLoc (CCValAssign::getReg (ValNo, ValVT, Reg, LocVT, LocInfo));
2259
- return false ;
2260
- }
2261
- }
2262
-
2263
- if (LocVT == MVT::f32 ) {
2264
- // Pass in STG registers: F1, ..., F6
2265
- // fs0 ... fs5
2266
- static const MCPhysReg FPR32List[] = {RISCV::F8_F, RISCV::F9_F,
2267
- RISCV::F18_F, RISCV::F19_F,
2268
- RISCV::F20_F, RISCV::F21_F};
2269
- if (unsigned Reg = State.AllocateReg (FPR32List)) {
2270
- State.addLoc (CCValAssign::getReg (ValNo, ValVT, Reg, LocVT, LocInfo));
2271
- return false ;
2272
- }
2273
- }
2274
-
2275
- if (LocVT == MVT::f64 ) {
2276
- // Pass in STG registers: D1, ..., D6
2277
- // fs6 ... fs11
2278
- static const MCPhysReg FPR64List[] = {RISCV::F22_D, RISCV::F23_D,
2279
- RISCV::F24_D, RISCV::F25_D,
2280
- RISCV::F26_D, RISCV::F27_D};
2281
- if (unsigned Reg = State.AllocateReg (FPR64List)) {
2282
- State.addLoc (CCValAssign::getReg (ValNo, ValVT, Reg, LocVT, LocInfo));
2283
- return false ;
2284
- }
2285
- }
2286
-
2287
- report_fatal_error (" No registers left in GHC calling convention" );
2288
- return true ;
2289
- }
2290
-
2291
2243
// Transform physical registers into virtual registers.
2292
2244
SDValue RISCVTargetLowering::LowerFormalArguments (
2293
2245
SDValue Chain, CallingConv::ID CallConv, bool IsVarArg,
2294
2246
const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &DL,
2295
2247
SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const {
2296
2248
2297
- MachineFunction &MF = DAG.getMachineFunction ();
2298
-
2299
2249
switch (CallConv) {
2300
2250
default :
2301
2251
report_fatal_error (" Unsupported calling convention" );
2302
2252
case CallingConv::C:
2303
2253
case CallingConv::Fast:
2304
2254
break ;
2305
- case CallingConv::GHC:
2306
- if (!MF.getSubtarget ().getFeatureBits ()[RISCV::FeatureStdExtF] ||
2307
- !MF.getSubtarget ().getFeatureBits ()[RISCV::FeatureStdExtD])
2308
- report_fatal_error (
2309
- " GHC calling convention requires the F and D instruction set extensions" );
2310
2255
}
2311
2256
2257
+ MachineFunction &MF = DAG.getMachineFunction ();
2258
+
2312
2259
const Function &Func = MF.getFunction ();
2313
2260
if (Func.hasFnAttribute (" interrupt" )) {
2314
2261
if (!Func.arg_empty ())
@@ -2335,8 +2282,6 @@ SDValue RISCVTargetLowering::LowerFormalArguments(
2335
2282
2336
2283
if (CallConv == CallingConv::Fast)
2337
2284
CCInfo.AnalyzeFormalArguments (Ins, CC_RISCV_FastCC);
2338
- else if (CallConv == CallingConv::GHC)
2339
- CCInfo.AnalyzeFormalArguments (Ins, CC_RISCV_GHC);
2340
2285
else
2341
2286
analyzeInputArgs (MF, CCInfo, Ins, /* IsRet=*/ false );
2342
2287
@@ -2537,8 +2482,6 @@ SDValue RISCVTargetLowering::LowerCall(CallLoweringInfo &CLI,
2537
2482
2538
2483
if (CallConv == CallingConv::Fast)
2539
2484
ArgCCInfo.AnalyzeCallOperands (Outs, CC_RISCV_FastCC);
2540
- else if (CallConv == CallingConv::GHC)
2541
- ArgCCInfo.AnalyzeCallOperands (Outs, CC_RISCV_GHC);
2542
2485
else
2543
2486
analyzeOutputArgs (MF, ArgCCInfo, Outs, /* IsRet=*/ false , &CLI);
2544
2487
@@ -2826,9 +2769,6 @@ RISCVTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
2826
2769
analyzeOutputArgs (DAG.getMachineFunction (), CCInfo, Outs, /* IsRet=*/ true ,
2827
2770
nullptr );
2828
2771
2829
- if (CallConv == CallingConv::GHC && !RVLocs.empty ())
2830
- report_fatal_error (" GHC functions return void only" );
2831
-
2832
2772
SDValue Glue;
2833
2773
SmallVector<SDValue, 4 > RetOps (1 , Chain);
2834
2774
0 commit comments