<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 19, 2017, at 8:41 AM, SANJAY SRIVALLABH SINGAPURAM via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="gmail_msg">Hello,<br class="gmail_msg"></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>I
need to strip a Module of all debug information before sending it to
verifyModule</div></div></div></div></div></div></blockquote><div><br class=""></div><div>It is not clear to me why?</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"> (This is a Module meant for NVPTX code). I've been using llvm::StripDebugInfo, but it doesn't strip
some of the debug information. Following is an output from
Verifier::visitInstruction,<br class="gmail_msg"><br class="gmail_msg"><font class="gmail_msg" size="4"><span style="font-family:monospace" class="gmail_msg">Cannot invoke an intrinsic other than donothing, patchpoint, statepoint, coro_resume or coro_destroy<br class="gmail_msg">
store void (metadata, i64, metadata, metadata)* @llvm.dbg.value, void
(metadata, i64, metadata, metadata)** %polly_launch_0_param_7, align 8</span></font><br class="gmail_msg"></div></div></div></div></div></div></blockquote><div><br class=""></div><div>This is not a debug info, this is a buggy IR!</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">Will the following change to <font class="gmail_msg" size="4"><span style="font-family:monospace" class="gmail_msg">lib/IR/DebugInfo.cpp</span></font> help resolve the problem ?<font class="gmail_msg" size="4"><span style="font-family:monospace" class="gmail_msg"><br class="gmail_msg"></span></font></div></div></div></div></div></div></blockquote><div><br class=""></div><div>It would resolve your problem, but this is not a correct solution I believe. So we should rather understand where this store comes from and fix the code that creates it.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><font class="gmail_msg" size="4"><span style="font-family:monospace" class="gmail_msg">@@ -312,7 +312,7 @@ bool llvm::StripDebugInfo(Module &M) {<br class="gmail_msg"> <br class="gmail_msg"> // We're stripping debug info, and without them, coverage information<br class="gmail_msg"> // doesn't quite make sense.<br class="gmail_msg">- if (NMD->getName().startswith("llvm.dbg.") ||<br class="gmail_msg">+ if (NMD->getName().contains("llvm.dbg.") ||<br class="gmail_msg"> NMD->getName() == "llvm.gcov") {<br class="gmail_msg"> NMD->eraseFromParent();<br class="gmail_msg"> Changed = true</span></font><br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I'm not sure if NamedMDNodes are going to include instructions.<br class=""><br class="">Although llvm::stripDebugInfo(Function &F) (called through StripDebugInfo on Functions present in the Module) removes DbgInfoIntrinsic instructions, it seems to miss this store instruction. Does this store to a @llvm.dbg.value count as a DbgInfoIntrinsic instruction ?<br class=""></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg">Please suggest a function to strip even this instruction.<br class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">Also, what does storing something at a place pointed by a function pointer mean in the context of a debug intrinsic ?<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thank You,<br class="gmail_msg"></div><div class="gmail_msg">Sanjay<br class="gmail_msg"></div></div></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>