[PATCH] D70157: Align branches within 32-Byte boundary(NOP padding)

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 19 21:46:33 PST 2019


MaskRay added inline comments.


================
Comment at: llvm/lib/MC/MCAssembler.cpp:993
+                                     MCBoundaryAlignFragment &BF) {
+  // The MCBoundaryAlignFragment that doesn't emit NOP should not relax.
+  if (!BF.canEmitNops())
----------------
be relaxed


================
Comment at: llvm/lib/MC/MCAssembler.cpp:997
+
+  auto AlignedOffset = Layout.getFragmentOffset(BF.getNextNode());
+  uint64_t AlignedSize = 0;
----------------
uint64_t


================
Comment at: llvm/lib/MC/MCAssembler.cpp:999
+  uint64_t AlignedSize = 0;
+  auto *F = BF.getNextNode();
+  // If the branch is unfused, it is emitted into one fragment, otherwise it is
----------------
`auto` -> `MCFragment`


================
Comment at: llvm/lib/MC/MCAssembler.cpp:1003
+  // exists) also marks the end of the branch.
+  for (auto i = 0U, N = BF.isFused() ? 2U : 1U;
+       i != N && !isa<MCBoundaryAlignFragment>(F); ++i, F = F->getNextNode()) {
----------------
unsigned -> int


================
Comment at: llvm/lib/MC/MCAssembler.cpp:1007
+  }
+  auto OldSize = BF.getSize();
+  AlignedOffset -= OldSize;
----------------
uint64_t


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

https://reviews.llvm.org/D70157





More information about the cfe-commits mailing list