[llvm] [RISCV] Place mergeable small read only data into srodata section (PR #82214)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 18 22:50:41 PST 2024


================
@@ -126,8 +136,20 @@ bool RISCVELFTargetObjectFile::isConstantInSmallSection(
 MCSection *RISCVELFTargetObjectFile::getSectionForConstant(
     const DataLayout &DL, SectionKind Kind, const Constant *C,
     Align &Alignment) const {
-  if (isConstantInSmallSection(DL, C))
-    return SmallDataSection;
+  if (isConstantInSmallSection(DL, C)) {
+    if (Kind.isMergeableConst4())
+      return SmallROData4Section;
+    else if (Kind.isMergeableConst8())
----------------
topperc wrote:

No else after return

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


More information about the llvm-commits mailing list