<html xmlns:v="urn:schemas-microsoft-com:vml" 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=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@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.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:327443415;
        mso-list-type:hybrid;
        mso-list-template-ids:2040852850 1510257608 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.5in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi all,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I would like to create a variable that aliases a field in a struct like :<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>%struct._dpowk_16 = type < { [32 x [32 x double]], [32 x [32 x double]], [32 x [32 x i64]] } ><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>@_dpowk_16 = common addrspace(1) global %struct._dpowk_16  zeroinitializer, align 16<o:p></o:p></p><p class=MsoNormal>@r_d_alias = alias [32 x [32 x double]] addrspace(1) * bitcast (i8 addrspace(1) * getelementptr (i8 addrspace(1) * bitcast (%struct._dpowk_16 addrspace(1)* @_dpowk_16 to i8 addrspace(1) *), i64 8192) to [32 x [32 x double]] addrspace(1) * )<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When I use opt I got following message :<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Aliasee should be either GlobalValue or bitcast of GlobalValue<o:p></o:p></p><p class=MsoNormal>[32 x [32 x double]] addrspace(1)* @r_d_alias<o:p></o:p></p><p class=MsoNormal>Broken module found, compilation aborted!<o:p></o:p></p><p class=MsoNormal>0  opt             0x00000000010e3abf<o:p></o:p></p><p class=MsoNormal>1  opt             0x00000000010e5a22<o:p></o:p></p><p class=MsoNormal>2  libpthread.so.0 0x0000003dd0a0f710<o:p></o:p></p><p class=MsoNormal>3  libc.so.6       0x0000003dd0232925 gsignal + 53<o:p></o:p></p><p class=MsoNormal>4  libc.so.6       0x0000003dd0234105 abort + 373<o:p></o:p></p><p class=MsoNormal>5  opt             0x00000000010a3e8a<o:p></o:p></p><p class=MsoNormal>6  opt             0x000000000107c654 llvm::FPPassManager::doFinalization(llvm::Module&) + 84<o:p></o:p></p><p class=MsoNormal>7  opt             0x000000000107df79 llvm::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 105<o:p></o:p></p><p class=MsoNormal>8  opt             0x000000000053b25d main + 6829<o:p></o:p></p><p class=MsoNormal>9  libc.so.6       0x0000003dd021ed1d __libc_start_main + 253<o:p></o:p></p><p class=MsoNormal>10 opt             0x000000000052c5c9<o:p></o:p></p><p class=MsoNormal>Stack dump:<o:p></o:p></p><p class=MsoListParagraph style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='mso-list:Ignore'>0.<span style='font:7.0pt "Times New Roman"'>                </span></span><![endif]>Program arguments: opt -O2 -S gblmod.ll -o gblmod.opt.ll<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Is there a way to have a global value that reflects a field in a struct ?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for your answers<o:p></o:p></p><p class=MsoNormal>Seb<o:p></o:p></p></div>
<DIV>
<HR>
</DIV>
<DIV>This email message is for the sole use of the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure 
or distribution is prohibited.  If you are not the intended recipient, 
please contact the sender by reply email and destroy all copies of the original 
message. </DIV>
<DIV>
<HR>
</DIV>
</body></html>