<div dir="ltr"><div><br></div><div>Hi All,</div><div><br></div><div>During the opt phase the following mismatch is spitted from the verifier.cpp for the llvm-39</div><div><br></div><div><span id="gmail-docs-internal-guid-181a0bdb-15b4-34b1-66a4-ccfefd5e45b8"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Fom the llvm-39 run</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:13.3333px;font-family:"source code pro";color:rgb(255,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Call parameter type does not match function signature</span><span style="font-size:13.3333px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">!</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:13.3333px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">i8* getelementptr inbounds ([46 x i8], [46 x i8]* @instrname, i32 0, i32 0)</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:13.3333px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">i8*  %injectError = call i32 @myReferenceFunc(i32 %11, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @instrname, i32 0, i32 0), i32 -1)</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">As the snippet shows, it is issuing a function signature mismatch error.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Below is a corresponding snippet of a run from llvm-38 run</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:13.3333px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">%injectError = call i32 @myReferenceFunc(i32 %4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @instrname, i32 0, i32 0), i32 -1)</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">In the </span><span style="font-size:14.6667px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">llvm-39</span><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">, it infers the return to be of type char pointer somehow unlike in </span><span style="font-size:14.6667px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">llvm-38</span><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">The original function definition hasn't changed though.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">We are using the current trunk of llvm.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Is there any related issue in the current trunk of llvm or if you could point us to something that has changed in llvm-39 that might be causing this difference ?</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Note: For making our previous versions of passes compatible to llvm-39, we have replaced all the calls of </span><span style="font-size:14.6667px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">getGlobalContext() </span><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">by </span><span style="font-size:14.6667px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">*unwrap(LLVMGetGlobalContext()).</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">We did try out a separate version modifying the llvm code to introduce the </span><span style="font-size:14.6667px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">getGlobalContext()</span><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> function as was available earlier to return the </span><span style="font-size:14.6667px;font-family:"source code pro";color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent">*GlobalContext.</span><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> Even with that we are seeing the same log.</span><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;font-family:arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><br></span></p><p style="margin-top:0pt;margin-bottom:0pt"><font color="#000000" face="arial"><span style="font-size:14.6667px;line-height:20.24px;white-space:pre-wrap">Regards,</span></font></p><p style="margin-top:0pt;margin-bottom:0pt"><font color="#000000" face="arial"><span style="font-size:14.6667px;line-height:20.24px;white-space:pre-wrap">Arnab Das</span></font></p></span></div></div>