<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p><font face="Hack Nerd Font Mono">Hi Suresh,</font></p>
<p><font face="Hack Nerd Font Mono"><br>
</font></p>
<p><font face="Hack Nerd Font Mono">thanks for reporting this!</font></p>
<p><font face="Hack Nerd Font Mono">I thought I fixed this with </font><font
face="Hack Nerd Font Mono"><font face="Hack Nerd Font Mono">8d94d3c3b44c3a27a69b153cef9be4b8e481150e.</font></font></p>
<p><font face="Hack Nerd Font Mono"><font face="Hack Nerd Font Mono">Did
you run before or after that commit?</font></font></p>
<p><font face="Hack Nerd Font Mono"><font face="Hack Nerd Font Mono"><br>
</font></font></p>
<p><font face="Hack Nerd Font Mono"><font face="Hack Nerd Font Mono">Cheers,</font></font></p>
<p><font face="Hack Nerd Font Mono"><font face="Hack Nerd Font Mono">
Johannes<br>
</font></font></p>
<p><font face="Hack Nerd Font Mono"></font><br>
</p>
<div class="moz-cite-prefix">On 5/15/20 7:17 AM, Mani, Suresh via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:DM6PR12MB39963EDEBEAD013C34EE5D16F2BD0@DM6PR12MB3996.namprd12.prod.outlook.com">
<pre class="moz-quote-pre" wrap="">[AMD Public Use]
Hi ,
Please ignore the earlier header of Internal and Official use only.
Thanks
M Suresh
From: llvm-dev <a class="moz-txt-link-rfc2396E" href="mailto:llvm-dev-bounces@lists.llvm.org"><llvm-dev-bounces@lists.llvm.org></a> On Behalf Of Mani, Suresh via llvm-dev
Sent: Friday, May 15, 2020 4:37 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
Subject: [llvm-dev] Issues with new Attributor (replaceAllUses fails with type mismatch)
[CAUTION: External Email]
[AMD Official Use Only - Internal Distribution Only]
Hi ,
There seems to be some issue with attributor, exactly in File Attributor.cpp, Function Attributor::rewriteFunctionSignatures(), Line No: 1600 (approrimate).
The llvm source code at above address is as follows:
// Eliminate the instructions *after* we visited all of them.
for (auto &CallSitePair : CallSitePairs) {
CallBase &OldCB = *CallSitePair.first;
CallBase &NewCB = *CallSitePair.second;
ModifiedFns.insert(OldCB.getFunction());
CGUpdater.replaceCallSite(OldCB, NewCB);
OldCB.replaceAllUsesWith(&NewCB); <---------------------------------------- Failing location
OldCB.eraseFromParent();
}
Failure symptom:
Assertion failed: New->getType() == getType() && "replaceAllUses of value with new value of different type!"
Snaps for IR from failing llvm IR and debug info while debugging is as follows:
Sample situation1:
Original code in IR -- %133 = call i32 (i32, ...) bitcast (void (i32)* @set_yydebug to i32 (i32, ...)*)(i32 1) #21
Attribute info ---- attributes #21 = { nounwind }
Debug info:
OldCB-------------------- %133 = call i32 (i32, ...) bitcast (void (i32)* @0 to i32 (i32, ...)*)(i32 1) #27
NewCB-------------------- call void @set_yydebug() #27
OldCB.replaceAllUsesWith(&NewCB); fails because of a type mismatch b/w OldCB (i32) and NewCB (void) .
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sample situation 2:
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
Attribute info ---- attributes #14 = { nounwind }
Debug info:
OldCB --- %63 = tail call %struct.cv.231* @Perl_find_runcv_where(i8 zeroext 1, i64 %62) #14
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
And hence OldCB.replaceAllUsesWith(&NewCB); fails
------------------------------------------------------------------------------------------------------------------------------------------------------------------
The complete IR file is very huge, and had no luck in getting a reduced test case.
Thanks
M Suresh
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</body>
</html>