@@ -109,7 +109,7 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
109
109
110
110
switch (ABI) {
111
111
default:
112
- report_fatal_error ("Don't know how to lower this ABI");
112
+ reportFatalUsageError ("Don't know how to lower this ABI");
113
113
case RISCVABI::ABI_ILP32:
114
114
case RISCVABI::ABI_ILP32E:
115
115
case RISCVABI::ABI_LP64E:
@@ -7305,7 +7305,8 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op,
7305
7305
SelectionDAG &DAG) const {
7306
7306
switch (Op.getOpcode()) {
7307
7307
default:
7308
- report_fatal_error("unimplemented operand");
7308
+ reportFatalInternalError(
7309
+ "Unimplemented RISCVTargetLowering::LowerOperation Case");
7309
7310
case ISD::PREFETCH:
7310
7311
return LowerPREFETCH(Op, Subtarget, DAG);
7311
7312
case ISD::ATOMIC_FENCE:
@@ -7503,7 +7504,7 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op,
7503
7504
// vscale as VLENB / 8.
7504
7505
static_assert(RISCV::RVVBitsPerBlock == 64, "Unexpected bits per block!");
7505
7506
if (Subtarget.getRealMinVLen() < RISCV::RVVBitsPerBlock)
7506
- report_fatal_error ("Support for VLEN==32 is incomplete.");
7507
+ reportFatalInternalError ("Support for VLEN==32 is incomplete.");
7507
7508
// We assume VLENB is a multiple of 8. We manually choose the best shift
7508
7509
// here because SimplifyDemandedBits isn't always able to simplify it.
7509
7510
uint64_t Val = Op.getConstantOperandVal(0);
@@ -8516,7 +8517,7 @@ SDValue RISCVTargetLowering::emitFlushICache(SelectionDAG &DAG, SDValue InChain,
8516
8517
SDValue RISCVTargetLowering::lowerINIT_TRAMPOLINE(SDValue Op,
8517
8518
SelectionDAG &DAG) const {
8518
8519
if (!Subtarget.is64Bit())
8519
- llvm::report_fatal_error ("Trampolines only implemented for RV64");
8520
+ llvm::reportFatalUsageError ("Trampolines only implemented for RV64");
8520
8521
8521
8522
// Create an MCCodeEmitter to encode instructions.
8522
8523
TargetLoweringObjectFile *TLO = getTargetMachine().getObjFileLowering();
@@ -8676,7 +8677,7 @@ SDValue RISCVTargetLowering::lowerINIT_TRAMPOLINE(SDValue Op,
8676
8677
SDValue RISCVTargetLowering::lowerADJUST_TRAMPOLINE(SDValue Op,
8677
8678
SelectionDAG &DAG) const {
8678
8679
if (!Subtarget.is64Bit())
8679
- llvm::report_fatal_error ("Trampolines only implemented for RV64");
8680
+ llvm::reportFatalUsageError ("Trampolines only implemented for RV64");
8680
8681
8681
8682
return Op.getOperand(0);
8682
8683
}
@@ -8811,7 +8812,7 @@ SDValue RISCVTargetLowering::getAddr(NodeTy *N, SelectionDAG &DAG,
8811
8812
8812
8813
switch (getTargetMachine().getCodeModel()) {
8813
8814
default:
8814
- report_fatal_error ("Unsupported code model for lowering");
8815
+ reportFatalUsageError ("Unsupported code model for lowering");
8815
8816
case CodeModel::Small: {
8816
8817
// Generate a sequence for accessing addresses within the first 2 GiB of
8817
8818
// address space. This generates the pattern (addi (lui %hi(sym)) %lo(sym)).
@@ -8989,7 +8990,7 @@ SDValue RISCVTargetLowering::lowerGlobalTLSAddress(SDValue Op,
8989
8990
8990
8991
if (DAG.getMachineFunction().getFunction().getCallingConv() ==
8991
8992
CallingConv::GHC)
8992
- report_fatal_error ("In GHC calling convention TLS is not supported");
8993
+ reportFatalUsageError ("In GHC calling convention TLS is not supported");
8993
8994
8994
8995
SDValue Addr;
8995
8996
switch (Model) {
@@ -10838,15 +10839,15 @@ SDValue RISCVTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
10838
10839
if (!isValidEGW(4, Op.getSimpleValueType(), Subtarget) ||
10839
10840
!isValidEGW(4, Op->getOperand(1).getSimpleValueType(), Subtarget) ||
10840
10841
!isValidEGW(4, Op->getOperand(2).getSimpleValueType(), Subtarget))
10841
- report_fatal_error ("EGW should be greater than or equal to 4 * SEW.");
10842
+ reportFatalUsageError ("EGW should be greater than or equal to 4 * SEW.");
10842
10843
return Op;
10843
10844
}
10844
10845
// EGS * EEW >= 256 bits
10845
10846
case Intrinsic::riscv_vsm3c:
10846
10847
case Intrinsic::riscv_vsm3me: {
10847
10848
if (!isValidEGW(8, Op.getSimpleValueType(), Subtarget) ||
10848
10849
!isValidEGW(8, Op->getOperand(1).getSimpleValueType(), Subtarget))
10849
- report_fatal_error ("EGW should be greater than or equal to 8 * SEW.");
10850
+ reportFatalUsageError ("EGW should be greater than or equal to 8 * SEW.");
10850
10851
return Op;
10851
10852
}
10852
10853
// zvknha(SEW=32)/zvknhb(SEW=[32|64])
@@ -10855,11 +10856,11 @@ SDValue RISCVTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
10855
10856
case Intrinsic::riscv_vsha2ms: {
10856
10857
if (Op->getSimpleValueType(0).getScalarSizeInBits() == 64 &&
10857
10858
!Subtarget.hasStdExtZvknhb())
10858
- report_fatal_error ("SEW=64 needs Zvknhb to be enabled.");
10859
+ reportFatalUsageError ("SEW=64 needs Zvknhb to be enabled.");
10859
10860
if (!isValidEGW(4, Op.getSimpleValueType(), Subtarget) ||
10860
10861
!isValidEGW(4, Op->getOperand(1).getSimpleValueType(), Subtarget) ||
10861
10862
!isValidEGW(4, Op->getOperand(2).getSimpleValueType(), Subtarget))
10862
- report_fatal_error ("EGW should be greater than or equal to 4 * SEW.");
10863
+ reportFatalUsageError ("EGW should be greater than or equal to 4 * SEW.");
10863
10864
return Op;
10864
10865
}
10865
10866
case Intrinsic::riscv_sf_vc_v_x:
@@ -22334,8 +22335,8 @@ RISCVTargetLowering::EmitInstrWithCustomInserter(MachineInstr &MI,
22334
22335
case TargetOpcode::STACKMAP:
22335
22336
case TargetOpcode::PATCHPOINT:
22336
22337
if (!Subtarget.is64Bit())
22337
- report_fatal_error ("STACKMAP, PATCHPOINT and STATEPOINT are only "
22338
- "supported on 64-bit targets");
22338
+ reportFatalUsageError ("STACKMAP, PATCHPOINT and STATEPOINT are only "
22339
+ "supported on 64-bit targets");
22339
22340
return emitPatchPoint(MI, BB);
22340
22341
}
22341
22342
}
@@ -22568,7 +22569,7 @@ SDValue RISCVTargetLowering::LowerFormalArguments(
22568
22569
22569
22570
switch (CallConv) {
22570
22571
default:
22571
- report_fatal_error ("Unsupported calling convention");
22572
+ reportFatalUsageError ("Unsupported calling convention");
22572
22573
case CallingConv::C:
22573
22574
case CallingConv::Fast:
22574
22575
case CallingConv::SPIR_KERNEL:
@@ -22592,17 +22593,17 @@ SDValue RISCVTargetLowering::LowerFormalArguments(
22592
22593
break;
22593
22594
case CallingConv::GHC:
22594
22595
if (Subtarget.hasStdExtE())
22595
- report_fatal_error ("GHC calling convention is not supported on RVE!");
22596
+ reportFatalUsageError ("GHC calling convention is not supported on RVE!");
22596
22597
if (!Subtarget.hasStdExtFOrZfinx() || !Subtarget.hasStdExtDOrZdinx())
22597
- report_fatal_error ("GHC calling convention requires the (Zfinx/F) and "
22598
- "(Zdinx/D) instruction set extensions");
22598
+ reportFatalUsageError ("GHC calling convention requires the (Zfinx/F) and "
22599
+ "(Zdinx/D) instruction set extensions");
22599
22600
}
22600
22601
22601
22602
const Function &Func = MF.getFunction();
22602
22603
if (Func.hasFnAttribute("interrupt")) {
22603
22604
if (!Func.arg_empty())
22604
- report_fatal_error (
22605
- "Functions with the interrupt attribute cannot have arguments!");
22605
+ reportFatalUsageError (
22606
+ "Functions with the interrupt attribute cannot have arguments!");
22606
22607
22607
22608
StringRef Kind =
22608
22609
MF.getFunction().getFnAttribute("interrupt").getValueAsString();
@@ -22618,11 +22619,12 @@ SDValue RISCVTargetLowering::LowerFormalArguments(
22618
22619
"SiFive-CLIC-preemptible-stack-swap",
22619
22620
};
22620
22621
if (!llvm::is_contained(SupportedInterruptKinds, Kind))
22621
- report_fatal_error (
22622
- "Function interrupt attribute argument not supported!");
22622
+ reportFatalUsageError (
22623
+ "Function interrupt attribute argument not supported!");
22623
22624
22624
22625
if (Kind.starts_with("qci-") && !Subtarget.hasVendorXqciint())
22625
- report_fatal_error("'qci-*' interrupt kinds require Xqciint extension");
22626
+ reportFatalUsageError(
22627
+ "'qci-*' interrupt kinds require Xqciint extension");
22626
22628
22627
22629
if (Kind.starts_with("SiFive-CLIC-") && !Subtarget.hasVendorXSfmclic())
22628
22630
reportFatalUsageError(
@@ -22860,7 +22862,7 @@ SDValue RISCVTargetLowering::LowerCall(CallLoweringInfo &CLI,
22860
22862
22861
22863
if (CallConv == CallingConv::GHC) {
22862
22864
if (Subtarget.hasStdExtE())
22863
- report_fatal_error ("GHC calling convention is not supported on RVE!");
22865
+ reportFatalUsageError ("GHC calling convention is not supported on RVE!");
22864
22866
ArgCCInfo.AnalyzeCallOperands(Outs, CC_RISCV_GHC);
22865
22867
} else
22866
22868
analyzeOutputArgs(MF, ArgCCInfo, Outs, /*IsRet=*/false, &CLI,
@@ -22874,8 +22876,8 @@ SDValue RISCVTargetLowering::LowerCall(CallLoweringInfo &CLI,
22874
22876
if (IsTailCall)
22875
22877
++NumTailCalls;
22876
22878
else if (CLI.CB && CLI.CB->isMustTailCall())
22877
- report_fatal_error ("failed to perform tail call elimination on a call "
22878
- " site marked musttail");
22879
+ reportFatalInternalError ("failed to perform tail call elimination on a "
22880
+ "call site marked musttail");
22879
22881
22880
22882
// Get a count of how many bytes are to be pushed on the stack.
22881
22883
unsigned NumBytes = ArgCCInfo.getStackSize();
@@ -23200,7 +23202,7 @@ RISCVTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
23200
23202
nullptr, CC_RISCV);
23201
23203
23202
23204
if (CallConv == CallingConv::GHC && !RVLocs.empty())
23203
- report_fatal_error ("GHC functions return void only");
23205
+ reportFatalUsageError ("GHC functions return void only");
23204
23206
23205
23207
SDValue Glue;
23206
23208
SmallVector<SDValue, 4> RetOps(1, Chain);
@@ -23266,7 +23268,7 @@ RISCVTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
23266
23268
const Function &Func = DAG.getMachineFunction().getFunction();
23267
23269
if (Func.hasFnAttribute("interrupt")) {
23268
23270
if (!Func.getReturnType()->isVoidTy())
23269
- report_fatal_error (
23271
+ reportFatalUsageError (
23270
23272
"Functions with the interrupt attribute must have void return type!");
23271
23273
23272
23274
MachineFunction &MF = DAG.getMachineFunction();
@@ -24533,8 +24535,8 @@ RISCVTargetLowering::getRegisterByName(const char *RegName, LLT VT,
24533
24535
24534
24536
BitVector ReservedRegs = Subtarget.getRegisterInfo()->getReservedRegs(MF);
24535
24537
if (!ReservedRegs.test(Reg) && !Subtarget.isRegisterReservedByUser(Reg))
24536
- report_fatal_error (Twine("Trying to obtain non-reserved register \"" +
24537
- StringRef(RegName) + "\"."));
24538
+ reportFatalUsageError (Twine("Trying to obtain non-reserved register \"" +
24539
+ StringRef(RegName) + "\"."));
24538
24540
return Reg;
24539
24541
}
24540
24542
0 commit comments