[PATCH] D138653: [Alignment][NFC] Use the Align type in MCSection

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 24 04:31:12 PST 2022


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


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:256-257
   Streamer.emitValueToAlignment(64, 0, 1, 0);
-  if (ReadOnlySection.getAlignment() < 64)
+  if (ReadOnlySection.getAlign() < 64)
     ReadOnlySection.setAlignment(Align(64));
 
----------------
foad wrote:
> The change is fine of course but there ought to be a neater way of writing this using some kind of "max" operation.
If you had access to the variable itself you could do `Alignment = std::max(Alignment, Align(64))`. But it's currently a private variable.
We could add a `clampAlignment(Align MaxAlignment)` function to `MCSection` though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138653



More information about the llvm-commits mailing list