<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:st1="urn:schemas-microsoft-com:office:smarttags" 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 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple style='word-wrap: break-word;
-webkit-nbsp-mode: space;-webkit-line-break: after-white-space'>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>This isn’t running in a child
process, but this is a win32 machine.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The problem I’m having is LegalizeOp
is recursively calling itself 6 times, followed by 3 calls to
ExpandEXTRACT_VECTOR_ELT, with each LegalizeOp pushing 20KBof data onto the
stack and Expand pushing 800B of data on the stack. So that is 9 function calls
pushing ~140KB of data onto the stack. This set of 9 function calls repeats
itself 25 times, pushing almost 3.5 MB of data onto the stack.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>This is occurring with v16i32 data type
being converted to v4i32. If any larger vector integer data type was used, the stack
usage would probably be even more extreme.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Micah<o:p></o:p></span></font></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Evan Cheng<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, March 11, 2009
9:46 AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">LLVM
 Developers Mailing List</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [LLVMdev] Stack
overflow in Legalize Op</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Are you running with restricted stack size, e.g. in a pthread process?<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Evan<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Mar 10, 2009, at 5:16 PM, Villmow, Micah wrote:<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<o:p></o:p></span></font></p>

<u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="address">

<div link=blue vlink=purple>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I’m hitting an issue where legalizeOp is overflowing
the stack. Are there any recommended ways of getting around this?<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><u1:p> </u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The bitcode that causes this issue is attached. <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><u1:p> </u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks,<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Micah Villmow<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Systems Engineer<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Advanced Technology & Performance<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Advanced Micro Devices Inc.<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><ns0:street u2:insauthor="Micah Villmow" u2:insdate="2009-03-10T16:57:00Z" u2:endinsauthor="Micah Villmow" u2:endinsdate="2009-03-10T16:57:00Z"><ns0:address u2:insauthor="Micah Villmow" u2:insdate="2009-03-10T16:57:00Z" u2:endinsauthor="Micah Villmow" u2:endinsdate="2009-03-10T16:57:00Z">S1-609
One AMD Place</ns0:address></ns0:street></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal><ns0:place u2:insauthor="Micah Villmow" u2:insdate="2009-03-10T16:57:00Z" u2:endinsauthor="Micah Villmow" u2:endinsdate="2009-03-10T16:57:00Z"><ns0:city u2:insauthor="Micah Villmow" u2:insdate="2009-03-10T16:57:00Z" u2:endinsauthor="Micah Villmow" u2:endinsdate="2009-03-10T16:57:00Z"><st1:city u2:st="on"><st1:place u2:st="on"><st1:City
w:st="on"><st1:place w:st="on"><font size=2 face=Arial><span style='font-size:
  10.0pt;font-family:Arial'>Sunnyvale</st1:place></st1:city></ns0:city></ns0:place></span></font></st1:place></st1:City><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>, CA. 94085</span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>P: 408-749-3966</span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<u1:p></u1:p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><u1:p> </u1:p><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><transpose-opt.bc>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>
        <a
href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
<o:p></o:p></span></font></p>

</div>

</u1:smarttagtype></u1:smarttagtype></u1:smarttagtype>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

</div>

</div>

</body>

</html>