[PATCH] D153097: [RISCV] Make linker-relaxable instructions terminate MCDataFragment

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 22:15:43 PDT 2023


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: llvm/lib/MC/MCELFStreamer.cpp:634
+    DF->setLinkerRelaxable();
   DF->getContents().append(Code.begin(), Code.end());
 
----------------
barannikov88 wrote:
> * Maybe add a new fixup flag to `MCFixupKindInfo.h` and check if it is set?
> * Can Fixups contain more than one element? If it can, why are you checking only the last one?
> 
Linker-relaxable instructions have two relocations and the second (last) one is `R_RISCV_RELAX`. There is just one relocation type, so adding a `FixupKindFlags` flag appears to be overkill. In addition, calling `getFixupKindInfo` adds some overhead to non-RISCV targets.

The current way causes the least overhead to non-RISCV targets.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153097



More information about the llvm-commits mailing list