[PATCH] D130879: [AsmPrinter] Emit PCs into requested PCSections

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 01:13:12 PDT 2022


dvyukov added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/AsmPrinter.h:195
+  /// List of symbols to be inserted into PC sections.
+  DenseMap<const MDNode *, SmallVector<const MCSymbol *, 8>> PCSectionsSymbols;
+
----------------
If metadata is used, is the SmallVector actually expected to be small (<=8)?
I assume that SmallVector<8> will allocate space for 8 statically and then waste it if the vector is larger.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1439
+      (CM == CodeModel::Medium || CM == CodeModel::Large) ? getPointerSize()
+                                                          : 4;
+
----------------
Can the other models have pointer size 8?
I assume something like Tiny/Small can have pointer size <4 (?).
Maybe it makes sense to just use getPointerSize() always?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130879



More information about the llvm-commits mailing list