[PATCH] D138778: Output alignment in zerofill and comm only if needed

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 01:56:35 PST 2022


gchatelet added a comment.

In D138778#3952734 <https://reviews.llvm.org/D138778#3952734>, @courbet wrote:

> This seems to imply that the directives generated by LLVM are incorrect, as we're emitting log2 values rather than alignment values. What did I miss ?

AFAIU (I'm no expert here), we write log2 values only if `getCOMMDirectiveAlignmentIsInBytes()` returns `false`.
I found the following instances :

- llvm/lib/MC/MCAsmInfoCOFF.cpp <https://github.com/llvm/llvm-project/blob/99c47d9e3113a917ea2f84f27e57f2ea3da4fc8c/llvm/lib/MC/MCAsmInfoCOFF.cpp#L22-L24> : logic seems to depend on MinGW's version
- llvm/lib/MC/MCAsmInfoDarwin.cpp:66 <https://github.com/llvm/llvm-project/blob/99c47d9e3113a917ea2f84f27e57f2ea3da4fc8c/llvm/lib/MC/MCAsmInfoDarwin.cpp#L66> : unconditionally set to `false` for Darwin
- llvm/lib/MC/MCAsmInfoXCOFF.cpp:52 <https://github.com/llvm/llvm-project/blob/99c47d9e3113a917ea2f84f27e57f2ea3da4fc8c/llvm/lib/MC/MCAsmInfoXCOFF.cpp#L52> : unconditionally set to `false` for XCOFF
- llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp:39 <https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp#L39> : unconditionally set to `false` for AMDGPU
- llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp:43 <https://github.com/llvm/llvm-project/blob/99c47d9e3113a917ea2f84f27e57f2ea3da4fc8c/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp#L43> : unconditionally set to `false` for WebAssembly

@MaskRay WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138778



More information about the llvm-commits mailing list