<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">It checks for both OS=Win32 and Environment=MSVC, so that wouldn't cover other COFF environments. wbs (Martin Storsjo) mentioned on IRC that MinGW adds an aligncomm directive to specify alignment for common symbols, so perhaps that's part
 of it?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">"Keane, Erich" <erich.keane@intel.com><br>
<b>Date: </b>Tuesday, January 8, 2019 at 1:04 PM<br>
<b>To: </b>Shoaib Meenai <smeenai@fb.com>, "cfe-commits@lists.llvm.org" <cfe-commits@lists.llvm.org>, David Majnemer <david.majnemer@gmail.com><br>
<b>Subject: </b>RE: r350643 - Limit COFF 'common' emission to <=32 alignment types.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="margin-left:.5in"><span style="color:#1F497D">Yep, exactly.  I looked, and isKnownWindowsMSVCEnvironment checks for OS=Win32, which I believe would be different for other architectures.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><a name="_____replyseparator"></a><b>From:</b> Shoaib Meenai [mailto:smeenai@fb.com]
<br>
<b>Sent:</b> Tuesday, January 8, 2019 12:41 PM<br>
<b>To:</b> Keane, Erich <erich.keane@intel.com>; cfe-commits@lists.llvm.org; David Majnemer <david.majnemer@gmail.com><br>
<b>Subject:</b> Re: r350643 - Limit COFF 'common' emission to <=32 alignment types.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">Ah, looks like you were originally checking for COFF, and then David suggested checking for MSVC instead? I'm curious about why, although I'm sure the suggestion is legit :)<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:1.0in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">cfe-commits <<a href="mailto:cfe-commits-bounces@lists.llvm.org">cfe-commits-bounces@lists.llvm.org</a>> on behalf of Shoaib Meenai via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>><br>
<b>Reply-To: </b>Shoaib Meenai <<a href="mailto:smeenai@fb.com">smeenai@fb.com</a>><br>
<b>Date: </b>Tuesday, January 8, 2019 at 12:39 PM<br>
<b>To: </b>Erich Keane <<a href="mailto:erich.keane@intel.com">erich.keane@intel.com</a>>, "<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>" <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>><br>
<b>Subject: </b>Re: r350643 - Limit COFF 'common' emission to <=32 alignment types.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.0in"> <o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-left:1.0in">Why does this check for isKnownWindowsMSVCEnvironment specifically? Wouldn't any COFF target (windows-cygnus, windows-gnu, windows-itanium, etc.) have the same limitation, since it's an object file format issue
 and not an ABI issue?<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:1.0in"> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:1.5in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">cfe-commits <<a href="mailto:cfe-commits-bounces@lists.llvm.org">cfe-commits-bounces@lists.llvm.org</a>> on behalf of Erich Keane via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>><br>
<b>Reply-To: </b>Erich Keane <<a href="mailto:erich.keane@intel.com">erich.keane@intel.com</a>><br>
<b>Date: </b>Tuesday, January 8, 2019 at 10:48 AM<br>
<b>To: </b>"<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>" <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>><br>
<b>Subject: </b>r350643 - Limit COFF 'common' emission to <=32 alignment types.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Author: erichkeane<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Date: Tue Jan  8 10:44:22 2019<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">New Revision: 350643<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D350643-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=Ph9GOtRaQERmqyeJeAJTFwV3sg3q8fE05FlJ3qwNx4I&e=">
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D350643-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=Ph9GOtRaQERmqyeJeAJTFwV3sg3q8fE05FlJ3qwNx4I&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Log:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Limit COFF 'common' emission to <=32 alignment types.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">As reported in PR33035, LLVM crashes if given a common object with an<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">alignment of greater than 32 bits. This is because the COFF file format<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">does not support these alignments, so emitting them is broken anyway.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">This patch changes any global definitions greater than 32 bit alignment<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">to no longer be in 'common'.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.llvm.org_show-5Fbug.cgi-3Fid-3D33035&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=ac1NEHuvztd6jSTCsOUJajkklfeyqdzW-xqtddJ-hvM&e=">https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.llvm.org_show-5Fbug.cgi-3Fid-3D33035&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=ac1NEHuvztd6jSTCsOUJajkklfeyqdzW-xqtddJ-hvM&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Differential Revision: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D56391&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=AucP9Sp-DYHSaOP-sPfpAOrww3xwdh8FjQkHrLZhhyo&e=">
https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D56391&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=AucP9Sp-DYHSaOP-sPfpAOrww3xwdh8FjQkHrLZhhyo&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Change-Id: I48609289753b7f3b58c5e2bc1712756750fbd45a<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Added:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">    cfe/trunk/test/CodeGen/microsoft-no-common-align.c<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Modified:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">    cfe/trunk/lib/CodeGen/CodeGenModule.cpp<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_CodeGen_CodeGenModule.cpp-3Frev-3D350643-26r1-3D350642-26r2-3D350643-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=gmTnEmW03ruG8LbJluf5Z4yQcxM64QP7Ce1VTnVqvPo&e=">
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_CodeGen_CodeGenModule.cpp-3Frev-3D350643-26r1-3D350642-26r2-3D350643-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=gmTnEmW03ruG8LbJluf5Z4yQcxM64QP7Ce1VTnVqvPo&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">==============================================================================<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Jan  8 10:44:22 2019<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">@@ -3761,6 +3761,11 @@ static bool isVarDeclStrongDefinition(co<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">       }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">     }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">   }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+  // COFF doesn't support alignments greater than 32, so these cannot be<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+  // in common.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+  if (Context.getTargetInfo().getTriple().isKnownWindowsMSVCEnvironment() &&<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+      Context.getTypeAlignIfKnown(D->getType()) > 32)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+    return true;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">   return false;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">Added: cfe/trunk/test/CodeGen/microsoft-no-common-align.c<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_test_CodeGen_microsoft-2Dno-2Dcommon-2Dalign.c-3Frev-3D350643-26view-3Dauto&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=hzPmmVFbvg4OTEVpnQ5pIfy295Ne0-xAsctZs00WZgY&e=">
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_test_CodeGen_microsoft-2Dno-2Dcommon-2Dalign.c-3Frev-3D350643-26view-3Dauto&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=hzPmmVFbvg4OTEVpnQ5pIfy295Ne0-xAsctZs00WZgY&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">==============================================================================<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">--- cfe/trunk/test/CodeGen/microsoft-no-common-align.c (added)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+++ cfe/trunk/test/CodeGen/microsoft-no-common-align.c Tue Jan  8 10:44:22 2019<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">@@ -0,0 +1,8 @@<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -o - %s | FileCheck %s<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+typedef float TooLargeAlignment __attribute__((__vector_size__(64)));<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+typedef float NormalAlignment __attribute__((__vector_size__(4)));<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+TooLargeAlignment TooBig;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+// CHECK: @TooBig = dso_local global <16 x float>  zeroinitializer, align 64<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+NormalAlignment JustRight;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">+// CHECK: @JustRight = common dso_local global <1 x float>  zeroinitializer, align 4<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">_______________________________________________<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in">cfe-commits mailing list<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"><a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=Myn7SZhcOe32EZiKZr4ByJAZOoFl5aIfmWV9555Vh9A&e=">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=RNVKy_b0_Wgp_PTFDpvQXETsZdWubmT5SGnGz3GigS0&s=Myn7SZhcOe32EZiKZr4ByJAZOoFl5aIfmWV9555Vh9A&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:1.5in"> <o:p></o:p></p>
</div>
</div>
</body>
</html>