================ @@ -1136,11 +1136,35 @@ static void mergeAtomic(DenseMap<unsigned, unsigned> &intAttr, }; } +static void mergeX3RegUse(DenseMap<unsigned, unsigned> &intAttr, + 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; + auto attr = RISCVAttrs::X3_REG_USAGE; + if (newTag == X3RegUsage::UNKNOWN) + return; + if (oldTag == X3RegUsage::UNKNOWN) { + intAttr[attr] = newTag; ---------------- topperc wrote:
Can we use the iterator from try_emplace instead of a second map lookup? 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