[PATCH] D70157: Align branches within 32-Byte boundary

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 4 18:05:57 PST 2019


MaskRay added inline comments.


================
Comment at: llvm/lib/MC/MCAssembler.cpp:1014
+  unsigned EndAddr = StartAddr + Size;
+  return StartAddr / BoundarySize != ((EndAddr - 1) / BoundarySize);
+}
----------------
Division is slow. Pass in the power of 2 and use right shift instead.

You may change `MCMachineDependentFragment::AlignBoundarySize` (a power of 2) to a power.


================
Comment at: llvm/lib/MC/MCAssembler.cpp:1022
+  unsigned EndAddr = StartAddr + Size;
+  return EndAddr % BoundarySize == 0;
+}
----------------
Ditto.


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

https://reviews.llvm.org/D70157





More information about the cfe-commits mailing list