diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h @@ -36,7 +36,6 @@ TargetOptions(Options) { TargetABI = RISCVABI::computeTargetABI( STI.getTargetTriple(), STI.getFeatureBits(), Options.getABIName()); - RISCVFeatures::validate(STI.getTargetTriple(), STI.getFeatureBits()); } ~RISCVAsmBackend() override = default; diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h @@ -341,10 +341,6 @@ namespace RISCVFeatures { -// Validates if the given combination of features are valid for the target -// triple. Exits with report_fatal_error if not. -void validate(const Triple &TT, const FeatureBitset &FeatureBits); - llvm::Expected> parseFeatureBits(bool IsRV64, const FeatureBitset &FeatureBits); diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp @@ -94,15 +94,6 @@ namespace RISCVFeatures { -void validate(const Triple &TT, const FeatureBitset &FeatureBits) { - if (TT.isArch64Bit() && !FeatureBits[RISCV::Feature64Bit]) - report_fatal_error("RV64 target requires an RV64 CPU"); - if (!TT.isArch64Bit() && FeatureBits[RISCV::Feature64Bit]) - report_fatal_error("RV32 target requires an RV32 CPU"); - if (TT.isArch64Bit() && FeatureBits[RISCV::FeatureRV32E]) - report_fatal_error("RV32E can't be enabled for an RV64 target"); -} - llvm::Expected> parseFeatureBits(bool IsRV64, const FeatureBitset &FeatureBits) { unsigned XLen = IsRV64 ? 64 : 32; diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.cpp b/llvm/lib/Target/RISCV/RISCVSubtarget.cpp --- a/llvm/lib/Target/RISCV/RISCVSubtarget.cpp +++ b/llvm/lib/Target/RISCV/RISCVSubtarget.cpp @@ -85,7 +85,6 @@ } TargetABI = RISCVABI::computeTargetABI(TT, getFeatureBits(), ABIName); - RISCVFeatures::validate(TT, getFeatureBits()); return *this; }