<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
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;}
--></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="#0563C1" vlink="#954F72">
<p class="msipheadera92e061b" align="Left" style="margin:0"><span style="font-size:10.0pt;font-family:Arial;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]</span></p>
<br>
<div class="WordSection1">
<p class="MsoNormal">Hi ,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">There seems to be some issue with attributor, exactly in File Attributor.cpp, Function
<span style="color:black">Attributor::rewriteFunctionSignatures(), Line No: 1600 (approrimate).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:black">The llvm source code at above address is as follows:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"> // Eliminate the instructions *after* we visited all of them.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"> for (auto &CallSitePair : CallSitePairs) {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"> CallBase &OldCB = *CallSitePair.first;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"> CallBase &NewCB = *CallSitePair.second;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"> ModifiedFns.insert(OldCB.getFunction());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"> CGUpdater.replaceCallSite(OldCB, NewCB);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"> OldCB.replaceAllUsesWith(&NewCB);
</span><span style="font-family:Wingdings;color:black">ß</span><span style="color:black">-------------------------------------- Failing location<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"> OldCB.eraseFromParent();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Failure symptom:
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Assertion failed: New->getType() == getType() && "replaceAllUses of value with new value of different type!"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Snaps for IR from failing llvm IR and debug info while debugging is as follows:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Sample situation1:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Original code in IR -- %133 = call i32 (i32, ...) bitcast (void (i32)* @set_yydebug to i32 (i32, ...)*)(i32 1) #21<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Attribute info ---- attributes #21 = { nounwind }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Debug info:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">OldCB-------------------- %133 = call i32 (i32, ...) bitcast (void (i32)* @0 to i32 (i32, ...)*)(i32 1) #27<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">NewCB-------------------- call void @set_yydebug() #27<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">OldCB.replaceAllUsesWith(&NewCB); fails because of a type mismatch b/w OldCB (i32) and NewCB (void) .<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">------------------------------------------------------------------------------------------------------------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Sample situation 2:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Original code in IR -- %63 = tail call %struct.cv* bitcast (%struct.cv.231* (i8, i64, i32*)* @Perl_find_runcv_where to %struct.cv* (i8, i64, i32*)*)(i8 zeroext 1, i64 %62, i32* null)
#14<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Attribute info ---- attributes #14 = { nounwind }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Debug info:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">OldCB ---</span>
<span style="color:black">%63 = tail call %struct.cv.231* @Perl_find_runcv_where(i8 zeroext 1, i64 %62) #14<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">NewCB ---%64 = tail call %struct.cv* bitcast (%struct.cv.231* (i8, i64, i32*)* @15 to %struct.cv* (i8, i64, i32*)*)(i8 zeroext 1, i64 %62, i32* noalias align 536870912 null) #14<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">And hence OldCB.replaceAllUsesWith(&NewCB); fails<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">------------------------------------------------------------------------------------------------------------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">The complete IR file is very huge, and had no luck in getting a reduced test case.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">Thanks<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black">M Suresh<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>