[llvm] [LLVM-Tablegen] Pretty Printing Arguments in LLVM Intrinsics (PR #162629)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 3 11:01:15 PST 2025


================
@@ -805,6 +815,72 @@ AttributeSet Intrinsic::getFnAttributes(LLVMContext &C, ID id) {{
                 NoFunctionAttrsID);
 }
 
+void IntrinsicEmitter::EmitIntrinsicToPrettyPrintTable(
+    const CodeGenIntrinsicTable &Ints, raw_ostream &OS) {
+  OS << R"(// Intrinsic ID to pretty print bitset.
+)"
+        R"(#ifdef GET_INTRINSIC_PRETTY_PRINT_TABLE
+static constexpr uint8_t PPTable[] = {
+  0
+  )";
+  int CountPerLine = 0;
----------------
jurahul wrote:

Q: Can you follow the same style as used in EmitIntrinsicToOverloadTable? In fact, we can create a helper function  like:

```
void EmitIntrinsicBitTable(const CodeGenIntrinsicTable &Ints, raw_ostream &OS, StringRef Guard, function_ref<bool(const CodeGenIntrinsic &Int)> GetProperty) {
}
```

and call it twice, once for ovcerload bitset and once for pretty print bitset.

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


More information about the llvm-commits mailing list