[llvm] CodeGen: Add RegisterClass by HwMode (PR #158269)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 04:46:00 PDT 2025


================
@@ -940,9 +943,66 @@ void DecoderEmitter::emitPredicateFunction(formatted_raw_ostream &OS,
   OS << "}\n\n";
 }
 
+static std::pair<std::string, bool>
+findOperandDecoderMethod(const CodeGenTarget &Target, const Record *Record);
+
+/// Emit a default implementation of a decoder for all RegClassByHwModes which
+/// do not have an explicit DecoderMethodSet, which dispatches over the decoder
+/// methods for the member classes.
+void DecoderEmitter::emitRegClassByHwModeDecoders(
+    formatted_raw_ostream &OS) const {
+  const CodeGenHwModes &CGH = Target.getHwModes();
+  if (CGH.getNumModeIds() == 1)
+    return;
+
+  ArrayRef<const Record *> RegClassByHwMode = Target.getAllRegClassByHwMode();
----------------
arsenm wrote:

I don't think so, or it would at least need to work fundamentally differently. That seems to be looking for modes that are used for the encoding function, not specific use contexts 

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


More information about the llvm-commits mailing list