[PATCH] D67852: [Alignment] Get DataLayout::StackAlignment as Align

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 02:29:52 PDT 2019


gchatelet added a comment.

In D67852#1678482 <https://reviews.llvm.org/D67852#1678482>, @courbet wrote:

> Can you please explain why the switch from `MaybeAlign` to `Align` is fine ? `ARMTargetLowering::getABIAlignmentForCallingConv` can switch from non-zero to 0 it seems.
>
> I see another call in the WebAsm backend.


TL;DR: call sites use `std::min` between two alignments which wouldn't make sense in case one of the two alignments is `0` or undefined.

Careful inspection of all call sites (including the one in WebAssembly) expect an alignment of at least `1`.
Tests are still passing with this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67852





More information about the llvm-commits mailing list