================
@@ -1135,11 +1135,34 @@ static void mergeAtomic(DenseMap<unsigned, 
unsigned>::iterator it,
   };
 }
 
+static void mergeX3RegUse(DenseMap<unsigned, unsigned>::iterator it,
+                          const InputSectionBase *oldSection,
+                          const InputSectionBase *newSection,
+                          unsigned int oldTag, unsigned int newTag) {
+  // X3/GP register usage ar incompatible and cannot be merged, with the
+  // exception of the UNKNOWN or 0 value
+  using RISCVAttrs::RISCVX3RegUse::X3RegUsage;
+  if (newTag == X3RegUsage::UNKNOWN)
+    return;
+  if (oldTag == X3RegUsage::UNKNOWN) {
+    it->getSecond() = newTag;
+    return;
+  }
+  if (oldTag != newTag) {
+    errorOrWarn(toString(oldSection) + " has x3_reg_usage=" + Twine(oldTag) +
----------------
MaskRay wrote:

We seem to use errors for parsing errors. This is probably a warning.

https://github.com/llvm/llvm-project/pull/84598
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to