[llvm] CodeGen: Keep reference to TargetRegisterInfo in TargetInstrInfo (PR #158224)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 19:49:12 PDT 2025


================
@@ -1070,8 +1070,8 @@ void InstrInfoEmitter::run(raw_ostream &OS) {
   OS << "namespace llvm {\n";
   OS << "struct " << ClassName << " : public TargetInstrInfo {\n"
      << "  explicit " << ClassName
-     << "(const TargetSubtargetInfo &STI, unsigned CFSetupOpcode = ~0u, "
-        "unsigned CFDestroyOpcode = ~0u, "
+     << "(const TargetSubtargetInfo &STI, const TargetRegisterInfo &TRI, "
----------------
arsenm wrote:

If TRI is just a member in TargetInstrInfo, the derived TargetInstrInfo class uses don't obviously know that TRI is the appropriate target one 

https://github.com/llvm/llvm-project/pull/158224


More information about the llvm-commits mailing list