[PATCH] D134600: [RISCV][LLD] Add RISCV zcmt optimise in linker relaxation

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 1 00:03:04 PDT 2022


MaskRay added inline comments.


================
Comment at: lld/ELF/Options.td:320
 
+def riscv_tbljal: F<"riscv-tbljal">,
+  HelpText<"(RISCV only) Enable table jump instructions from the Zce extension">;
----------------
`FF`: we require that new options must start with `--`, not `-`


================
Comment at: lld/ELF/SyntheticSections.cpp:1164
 
+TableJumpSection::TableJumpSection()
+    : SyntheticSection(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS,
----------------
The implementation should be moved to Arch/RISCV.cpp to avoid redundant virtual functions in TargetInfo.


================
Comment at: lld/ELF/SyntheticSections.h:31
 #include "llvm/Support/Threading.h"
+#include <map>
 
----------------
This is inefficient. If DenseMap<CachedStringRef, ...> works, prefer it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134600



More information about the llvm-commits mailing list