Vlad Dov vdovleka via llvm-dev
2017-Jul-31 23:20 UTC
[llvm-dev] AsmPrinter.cpp: emitting trailing padding for global data array in emitGlobalConstantDataSequential
Hello all, Looking at the emitGlobalConstantDataSequential function in lib/CodeGen/AsmPrinter/AsmPrinter.cpp there is a code there responsible for emitting of the potential trailing padding for the global array. Is there an example ( preferably C code ) that triggers this code? AFAIU no trailing padding should be generated for global data arrays. Thanks Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170801/73c8e960/attachment.html>
Friedman, Eli via llvm-dev
2017-Jul-31 23:39 UTC
[llvm-dev] AsmPrinter.cpp: emitting trailing padding for global data array in emitGlobalConstantDataSequential
On 7/31/2017 4:20 PM, Vlad Dov vdovleka via llvm-dev wrote:> Hello all, > > Looking at the emitGlobalConstantDataSequential function in > lib/CodeGen/AsmPrinter/AsmPrinter.cpp there is a code there > responsible for emitting of the potential trailing padding for the > global array. > > Is there an example ( preferably C code ) that triggers this code? > AFAIU no trailing padding should be generated for global data arrays.You're right, no trailing padding will be generated for arrays: the alignment of an array is the same as the alignment of its element type. We can end up with trailing padding for vectors, though. For example: typedef float float3 __attribute((ext_vector_type(3))); float3 x = {1,2,3}; -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project