[PATCH] D104080: [LLD][LLVM] CG Graph profile using relocations

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 15:51:15 PDT 2021


MaskRay added inline comments.


================
Comment at: lld/ELF/Driver.cpp:870
+      const Elf_CGProfile_Impl<ELFT> &cgpe = obj->cgProfile[i];
+      auto fromIndex = getIndex(obj, i * 2);
+      auto toIndex = getIndex(obj, i * 2 + 1);
----------------
uint32_t


================
Comment at: lld/ELF/Driver.cpp:871
+      auto fromIndex = getIndex(obj, i * 2);
+      auto toIndex = getIndex(obj, i * 2 + 1);
+      auto *fromSym = dyn_cast<Defined>(&obj->getSymbol(fromIndex));
----------------
uint32_t


================
Comment at: lld/ELF/InputFiles.cpp:674
+      if (sec.sh_info == cgProfileSectionIndex) {
+        cgProfileRela = CHECK(getObj().relas(sec), this);
+      }
----------------
remove braces around one-line simple statement


================
Comment at: llvm/lib/MC/MCELFStreamer.cpp:498
+  MCObjectStreamer::emitRelocDirective(
+      *MCOffset, getAssembler().getBackend().getNoneRelcationName(), SRE,
+      SRE->getLoc(), *getContext().getSubtargetInfo());
----------------
it's ugly, but you can use `.reloc xxx, BFD_RELOC_NONE, sym`


================
Comment at: llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h:53
+    llvm_unreachable("getNoneRelcationName() unimplemented");
+    return "";
+  }
----------------
unreachable doesn't need `return`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104080



More information about the llvm-commits mailing list