achieveartificialintelligence created this revision. achieveartificialintelligence added reviewers: grosbach, Eugene.Zelenko, asb, jrtc27, craig.topper. Herald added subscribers: ayermolo, sdasgup3, wenzhicui, wrengr, Chia-hungDuan, dcaballe, cota, teijeong, frasercrmck, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, csigg, antiagainst, shauheen, rriddle, mehdi_amini, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, gbedwell, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya. Herald added a reviewer: andreadb. Herald added a reviewer: bondhugula. Herald added a reviewer: rafauler. Herald added a reviewer: Amir. Herald added a reviewer: maksfb. achieveartificialintelligence requested review of this revision. Herald added subscribers: llvm-commits, cfe-commits, pcwang-thead, yota9, stephenneuendorffer, nicolasvasilache, MaskRay. Herald added a reviewer: herhut. Herald added projects: clang, MLIR, LLVM.
For ten years, it seems that `MCRegisterInfo` is not used by any target. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D119846 Files: bolt/include/bolt/Core/BinaryContext.h bolt/lib/Core/BinaryContext.cpp clang/tools/driver/cc1as_main.cpp llvm/include/llvm/MC/TargetRegistry.h llvm/lib/CodeGen/LLVMTargetMachine.cpp llvm/lib/DWARFLinker/DWARFStreamer.cpp llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h llvm/lib/Target/X86/X86AsmPrinter.cpp llvm/tools/llvm-dwp/llvm-dwp.cpp llvm/tools/llvm-exegesis/lib/LlvmState.cpp llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp llvm/tools/llvm-mc/llvm-mc.cpp llvm/tools/llvm-mca/llvm-mca.cpp llvm/tools/llvm-ml/llvm-ml.cpp llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp llvm/unittests/MC/DwarfLineTableHeaders.cpp mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
Index: mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp =================================================================== --- mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp +++ mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp @@ -376,7 +376,7 @@ std::unique_ptr<llvm::MCStreamer> mcStreamer; std::unique_ptr<llvm::MCInstrInfo> mcii(target->createMCInstrInfo()); - llvm::MCCodeEmitter *ce = target->createMCCodeEmitter(*mcii, *mri, ctx); + llvm::MCCodeEmitter *ce = target->createMCCodeEmitter(*mcii, ctx); llvm::MCAsmBackend *mab = target->createMCAsmBackend(*sti, *mri, mcOptions); mcStreamer.reset(target->createMCObjectStreamer( triple, ctx, std::unique_ptr<llvm::MCAsmBackend>(mab), Index: llvm/unittests/MC/DwarfLineTableHeaders.cpp =================================================================== --- llvm/unittests/MC/DwarfLineTableHeaders.cpp +++ llvm/unittests/MC/DwarfLineTableHeaders.cpp @@ -77,8 +77,7 @@ Res.Ctx->setObjectFileInfo(Res.MOFI.get()); Res.MII.reset(TheTarget->createMCInstrInfo()); - MCCodeEmitter *MCE = - TheTarget->createMCCodeEmitter(*Res.MII, *MRI, *Res.Ctx); + MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*Res.MII, *Res.Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCTargetOptions()); std::unique_ptr<MCObjectWriter> OW = MAB->createObjectWriter(OS); Index: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp =================================================================== --- llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp +++ llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp @@ -464,7 +464,7 @@ TLOF->Initialize(*MC, *TM); MC->setObjectFileInfo(TLOF); - MCE = TheTarget->createMCCodeEmitter(*MII, *MRI, *MC); + MCE = TheTarget->createMCCodeEmitter(*MII, *MC); if (!MCE) return make_error<StringError>("no code emitter for target " + TripleName, inconvertibleErrorCode()); Index: llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp =================================================================== --- llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp +++ llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp @@ -106,7 +106,7 @@ Res.Ctx->setObjectFileInfo(Res.MOFI.get()); Res.MII.reset(TheTarget->createMCInstrInfo()); - MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*Res.MII, *MRI, *Res.Ctx); + MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*Res.MII, *Res.Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCTargetOptions()); std::unique_ptr<MCObjectWriter> OW = MAB->createObjectWriter(OS); Index: llvm/tools/llvm-ml/llvm-ml.cpp =================================================================== --- llvm/tools/llvm-ml/llvm-ml.cpp +++ llvm/tools/llvm-ml/llvm-ml.cpp @@ -377,7 +377,7 @@ // Set up the AsmStreamer. std::unique_ptr<MCCodeEmitter> CE; if (InputArgs.hasArg(OPT_show_encoding)) - CE.reset(TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + CE.reset(TheTarget->createMCCodeEmitter(*MCII, Ctx)); std::unique_ptr<MCAsmBackend> MAB( TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); @@ -395,7 +395,7 @@ OS = BOS.get(); } - MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx); + MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions); Str.reset(TheTarget->createMCObjectStreamer( TheTriple, Ctx, std::unique_ptr<MCAsmBackend>(MAB), Index: llvm/tools/llvm-mca/llvm-mca.cpp =================================================================== --- llvm/tools/llvm-mca/llvm-mca.cpp +++ llvm/tools/llvm-mca/llvm-mca.cpp @@ -479,7 +479,7 @@ unsigned RegionIdx = 0; std::unique_ptr<MCCodeEmitter> MCE( - TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + TheTarget->createMCCodeEmitter(*MCII, Ctx)); assert(MCE && "Unable to create code emitter!"); std::unique_ptr<MCAsmBackend> MAB(TheTarget->createMCAsmBackend( Index: llvm/tools/llvm-mc/llvm-mc.cpp =================================================================== --- llvm/tools/llvm-mc/llvm-mc.cpp +++ llvm/tools/llvm-mc/llvm-mc.cpp @@ -541,7 +541,7 @@ // Set up the AsmStreamer. std::unique_ptr<MCCodeEmitter> CE; if (ShowEncoding) - CE.reset(TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + CE.reset(TheTarget->createMCCodeEmitter(*MCII, Ctx)); std::unique_ptr<MCAsmBackend> MAB( TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); @@ -561,7 +561,7 @@ OS = BOS.get(); } - MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx); + MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions); Str.reset(TheTarget->createMCObjectStreamer( TheTriple, Ctx, std::unique_ptr<MCAsmBackend>(MAB), Index: llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp =================================================================== --- llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp +++ llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp @@ -229,7 +229,7 @@ OS = BOS.get(); } - MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx); + MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions); Str.reset(TheTarget->createMCObjectStreamer( TheTriple, Ctx, std::unique_ptr<MCAsmBackend>(MAB), Index: llvm/tools/llvm-exegesis/lib/LlvmState.cpp =================================================================== --- llvm/tools/llvm-exegesis/lib/LlvmState.cpp +++ llvm/tools/llvm-exegesis/lib/LlvmState.cpp @@ -67,8 +67,7 @@ TheTargetMachine->getMCSubtargetInfo()); std::unique_ptr<const MCCodeEmitter> CodeEmitter( TheTargetMachine->getTarget().createMCCodeEmitter( - *TheTargetMachine->getMCInstrInfo(), *TheTargetMachine->getMCRegisterInfo(), - Context)); + *TheTargetMachine->getMCInstrInfo(), Context)); assert(CodeEmitter && "unable to create code emitter"); SmallVector<char, 16> Tmp; raw_svector_ostream OS(Tmp); Index: llvm/tools/llvm-dwp/llvm-dwp.cpp =================================================================== --- llvm/tools/llvm-dwp/llvm-dwp.cpp +++ llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -165,7 +165,7 @@ if (!MII) return error("no instr info info for target " + TripleName, Context); - MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*MII, *MRI, MC); + MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*MII, MC); if (!MCE) return error("no code emitter for target " + TripleName, Context); Index: llvm/lib/Target/X86/X86AsmPrinter.cpp =================================================================== --- llvm/lib/Target/X86/X86AsmPrinter.cpp +++ llvm/lib/Target/X86/X86AsmPrinter.cpp @@ -60,8 +60,7 @@ SMShadowTracker.startFunction(MF); CodeEmitter.reset(TM.getTarget().createMCCodeEmitter( - *Subtarget->getInstrInfo(), *Subtarget->getRegisterInfo(), - MF.getContext())); + *Subtarget->getInstrInfo(), MF.getContext())); EmitFPOData = Subtarget->isTargetWin32() && MF.getMMI().getModule()->getCodeViewFlag(); Index: llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h =================================================================== --- llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h +++ llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h @@ -70,7 +70,6 @@ } MCCodeEmitter *createX86MCCodeEmitter(const MCInstrInfo &MCII, - const MCRegisterInfo &MRI, MCContext &Ctx); MCAsmBackend *createX86_32AsmBackend(const Target &T, Index: llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp =================================================================== --- llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp +++ llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp @@ -1843,7 +1843,6 @@ } MCCodeEmitter *llvm::createX86MCCodeEmitter(const MCInstrInfo &MCII, - const MCRegisterInfo &MRI, MCContext &Ctx) { return new X86MCCodeEmitter(MCII, Ctx); } Index: llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h =================================================================== --- llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h +++ llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h @@ -29,7 +29,6 @@ class Target; MCCodeEmitter *createRISCVMCCodeEmitter(const MCInstrInfo &MCII, - const MCRegisterInfo &MRI, MCContext &Ctx); MCAsmBackend *createRISCVAsmBackend(const Target &T, const MCSubtargetInfo &STI, Index: llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp =================================================================== --- llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp +++ llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp @@ -94,7 +94,6 @@ } // end anonymous namespace MCCodeEmitter *llvm::createRISCVMCCodeEmitter(const MCInstrInfo &MCII, - const MCRegisterInfo &MRI, MCContext &Ctx) { return new RISCVMCCodeEmitter(Ctx, MCII); } Index: llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp =================================================================== --- llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp +++ llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp @@ -304,7 +304,6 @@ llvm::MCCodeEmitter * llvm::createLanaiMCCodeEmitter(const MCInstrInfo &InstrInfo, - const MCRegisterInfo & /*MRI*/, MCContext &context) { return new LanaiMCCodeEmitter(InstrInfo, context); } Index: llvm/lib/DWARFLinker/DWARFStreamer.cpp =================================================================== --- llvm/lib/DWARFLinker/DWARFStreamer.cpp +++ llvm/lib/DWARFLinker/DWARFStreamer.cpp @@ -68,7 +68,7 @@ if (!MII) return error("no instr info info for target " + TripleName, Context), false; - MCE = TheTarget->createMCCodeEmitter(*MII, *MRI, *MC); + MCE = TheTarget->createMCCodeEmitter(*MII, *MC); if (!MCE) return error("no code emitter for target " + TripleName, Context), false; Index: llvm/lib/CodeGen/LLVMTargetMachine.cpp =================================================================== --- llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -165,7 +165,7 @@ // Create a code emitter if asked to show the encoding. std::unique_ptr<MCCodeEmitter> MCE; if (Options.MCOptions.ShowMCEncoding) - MCE.reset(getTarget().createMCCodeEmitter(MII, MRI, Context)); + MCE.reset(getTarget().createMCCodeEmitter(MII, Context)); std::unique_ptr<MCAsmBackend> MAB( getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions)); @@ -180,7 +180,7 @@ case CGFT_ObjectFile: { // Create the code emitter for the target if it exists. If not, .o file // emission fails. - MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(MII, MRI, Context); + MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(MII, Context); if (!MCE) return make_error<StringError>("createMCCodeEmitter failed", inconvertibleErrorCode()); @@ -260,8 +260,7 @@ // emission fails. const MCSubtargetInfo &STI = *getMCSubtargetInfo(); const MCRegisterInfo &MRI = *getMCRegisterInfo(); - MCCodeEmitter *MCE = - getTarget().createMCCodeEmitter(*getMCInstrInfo(), MRI, *Ctx); + MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(*getMCInstrInfo(), *Ctx); MCAsmBackend *MAB = getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions); if (!MCE || !MAB) Index: llvm/include/llvm/MC/TargetRegistry.h =================================================================== --- llvm/include/llvm/MC/TargetRegistry.h +++ llvm/include/llvm/MC/TargetRegistry.h @@ -175,7 +175,6 @@ const MCInstrInfo &MII, const MCRegisterInfo &MRI); using MCCodeEmitterCtorTy = MCCodeEmitter *(*)(const MCInstrInfo &II, - const MCRegisterInfo &MRI, MCContext &Ctx); using ELFStreamerCtorTy = MCStreamer *(*)(const Triple &T, MCContext &Ctx, @@ -506,11 +505,10 @@ /// createMCCodeEmitter - Create a target specific code emitter. MCCodeEmitter *createMCCodeEmitter(const MCInstrInfo &II, - const MCRegisterInfo &MRI, MCContext &Ctx) const { if (!MCCodeEmitterCtorFn) return nullptr; - return MCCodeEmitterCtorFn(II, MRI, Ctx); + return MCCodeEmitterCtorFn(II, Ctx); } /// Create a target specific MCStreamer. @@ -1360,7 +1358,6 @@ private: static MCCodeEmitter *Allocator(const MCInstrInfo & /*II*/, - const MCRegisterInfo & /*MRI*/, MCContext & /*Ctx*/) { return new MCCodeEmitterImpl(); } Index: clang/tools/driver/cc1as_main.cpp =================================================================== --- clang/tools/driver/cc1as_main.cpp +++ clang/tools/driver/cc1as_main.cpp @@ -455,7 +455,7 @@ std::unique_ptr<MCCodeEmitter> CE; if (Opts.ShowEncoding) - CE.reset(TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + CE.reset(TheTarget->createMCCodeEmitter(*MCII, Ctx)); std::unique_ptr<MCAsmBackend> MAB( TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); @@ -475,7 +475,7 @@ } std::unique_ptr<MCCodeEmitter> CE( - TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx)); + TheTarget->createMCCodeEmitter(*MCII, Ctx)); std::unique_ptr<MCAsmBackend> MAB( TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions)); assert(MAB && "Unable to create asm backend!"); Index: bolt/lib/Core/BinaryContext.cpp =================================================================== --- bolt/lib/Core/BinaryContext.cpp +++ bolt/lib/Core/BinaryContext.cpp @@ -223,7 +223,7 @@ InstructionPrinter->setPrintImmHex(true); std::unique_ptr<MCCodeEmitter> MCE( - TheTarget->createMCCodeEmitter(*MII, *MRI, *Ctx)); + TheTarget->createMCCodeEmitter(*MII, *Ctx)); // Make sure we don't miss any output on core dumps. outs().SetUnbuffered(); Index: bolt/include/bolt/Core/BinaryContext.h =================================================================== --- bolt/include/bolt/Core/BinaryContext.h +++ bolt/include/bolt/Core/BinaryContext.h @@ -1192,14 +1192,14 @@ /*PIC=*/!HasFixedLoadAddress)); MCEInstance.LocalCtx->setObjectFileInfo(MCEInstance.LocalMOFI.get()); MCEInstance.MCE.reset( - TheTarget->createMCCodeEmitter(*MII, *MRI, *MCEInstance.LocalCtx)); + TheTarget->createMCCodeEmitter(*MII, *MCEInstance.LocalCtx)); return MCEInstance; } /// Creating MCStreamer instance. std::unique_ptr<MCStreamer> createStreamer(llvm::raw_pwrite_stream &OS) const { - MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*MII, *MRI, *Ctx); + MCCodeEmitter *MCE = TheTarget->createMCCodeEmitter(*MII, *Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCTargetOptions()); std::unique_ptr<MCObjectWriter> OW = MAB->createObjectWriter(OS);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits