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

Sergei Barannikov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Sep 12 03:01:29 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, "
----------------
s-barannikov wrote:

Thas sounds reasonable, but in this case (and in the one I suggested above as I just realized) TRI calls won't be devirtualized, right?
I guess I can be convinced if TRI virtual calls show up in the profile.


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


More information about the llvm-branch-commits mailing list