[lld] [llvm] [RISCV] Support RISCV Atomics ABI attributes (PR #84597)

Paul Kirth via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 15:29:12 PDT 2024


================
@@ -1084,10 +1084,63 @@ static void mergeArch(RISCVISAInfo::OrderedExtensionMap &mergedExts,
   }
 }
 
+static void mergeAtomic(DenseMap<unsigned, unsigned> &intAttr,
+                        const InputSectionBase *oldSection,
+                        const InputSectionBase *newSection, unsigned int oldTag,
+                        unsigned int newTag) {
+  using RISCVAttrs::RISCVAtomicAbiTag::AtomicABI;
+  // Same tags stay the same, and UNKNOWN is compatible with anything
+  if (oldTag == newTag || newTag == AtomicABI::UNKNOWN)
+    return;
+
+  auto attr = RISCVAttrs::ATOMIC_ABI;
+  switch (oldTag) {
+  case AtomicABI::UNKNOWN:
+    intAttr[attr] = newTag;
----------------
ilovepi wrote:

done.

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


More information about the llvm-commits mailing list