[PATCH] D138550: [ELF] Combine .riscv.attributes

Kito Cheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 4 19:30:42 PST 2022


kito-cheng accepted this revision.
kito-cheng added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/ELF/Arch/RISCV.cpp:865-872
+    for (const auto &ext : info.getExtensions()) {
+      if (auto it = mergedExts.find(ext.first); it != mergedExts.end()) {
+        if (std::tie(it->second.MajorVersion, it->second.MinorVersion) >=
+            std::tie(ext.second.MajorVersion, ext.second.MinorVersion))
+          continue;
+      }
+      mergedExts[ext.first] = ext.second;
----------------
IIUC that's handle different version like `I 2.0` + `I 2.1`, but RISCVISAInfo::parseArchString don't have capability to parse/accept unsupported version yet, we might need to extend that to made it able to accept any extension version even not supported.

But that should be a separated patch I think, so I am OK with this for now, but maybe we should add TODO or FIXME in mergeArch to mention this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138550/new/

https://reviews.llvm.org/D138550



More information about the llvm-commits mailing list