[PATCH] D86790: [FE] Use preferred alignment instead of ABI alignment for complete object when applicable

Xiangling Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 22 06:45:04 PDT 2020


Xiangling_L added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:4539
     CharUnits CCAlign = getParamTypeAlignment(Ty);
     CharUnits TyAlign = getContext().getTypeAlignInChars(Ty);
 
----------------
jasonliu wrote:
> Question: 
> It looks like getNaturalAlignIndirect and getTypeAlignInChars here are all returning ABI alignment.
> But according to the comments, we should use a preferred alignment when it's a complete object. Isn't this complete object? Or I'm missing something?
@jyknight Could you shine a light on this? Personally, I would agree that we have complete objects here, so preferred alignment should be used. And if that is true, changes should be applied on all other target within this file?


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

https://reviews.llvm.org/D86790



More information about the cfe-commits mailing list