[llvm] [RISCV] Flatten the ImpliedExts table in RISCVISAInfo.cpp (PR #89975)

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 19:51:44 PDT 2024


================
@@ -880,17 +886,17 @@ void RISCVISAInfo::updateImplication() {
 
   while (!WorkList.empty()) {
     StringRef ExtName = WorkList.pop_back_val();
-    auto I = llvm::lower_bound(ImpliedExts, ExtName);
-    if (I != std::end(ImpliedExts) && I->Name == ExtName) {
-      for (const char *ImpliedExt : I->Exts) {
-        if (WorkList.count(ImpliedExt))
-          continue;
-        if (Exts.count(ImpliedExt))
-          continue;
-        auto Version = findDefaultVersion(ImpliedExt);
-        addExtension(ImpliedExt, Version.value());
-        WorkList.insert(ImpliedExt);
-      }
+    auto Range = std::equal_range(std::begin(ImpliedExts),
----------------
wangpc-pp wrote:

We don't have `llvm::equal_range` wrapper? Maybe we should add it.

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


More information about the llvm-commits mailing list