[llvm] [RISCV]Add support for resolving encoding conflicts among vendor specific CSRs (PR #96174)

Garvit Gupta via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 01:00:16 PDT 2024


================
@@ -426,16 +428,25 @@ void SearchableTableEmitter::emitLookupFunction(const GenericTable &Table,
     OS << "    return nullptr;\n\n";
   }
 
-  OS << "  struct KeyType {\n";
-  for (const auto &Field : Index.Fields) {
-    OS << "    " << searchableFieldType(Table, Index, Field, TypeInTempStruct)
-       << " " << Field.Name << ";\n";
+  bool ShouldReturnRange = Index.ReturnRange;
+  if (ShouldReturnRange)
----------------
quic-garvgupt wrote:

IIUC your comment - `ShouldReturnRange` can be `true` irrespective of `IsPrimary` is true or not. 
`ShouldReturnRange` is populated by the `ReturnRange` field of `SearchIndex`. So if `ReturnRange` is set to true for a non-primary function, then also `ShouldReturnRange` will hold true. An example to illustrate the same is already added in `ReturnRange.td` file.

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


More information about the llvm-commits mailing list