<div dir="ltr">Hi Michael,<div>This patch solves this issue for us. Thank you for quick answer.</div><div>We don't have commit rights.</div><div><br></div><div>Rafael, could you please help with commit?<br></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/13 Michael Kruse <span dir="ltr"><<a href="mailto:llvm-commits@meinersbur.de" target="_blank">llvm-commits@meinersbur.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Quick fix patch<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/13 Michael Kruse <span dir="ltr"><<a href="mailto:llvm-commits@meinersbur.de" target="_blank">llvm-commits@meinersbur.de</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi Ilia,<br><br></div>you are right, verifying the whole module when only verification of the Module is requested is not desirable. My path however prevented crashing the verifier in presence of debug infos, even less desirable. Given that Verifier is a FunctionPass, letting it do module-level verification seems counter-intuitive. I suggest the following solutions:<br>



<br></div>1. Quick fix: Remove the call to doFinalization in verifyFunction(), keep the doInitialization.Skips most of the module-level verifications.<br><br></div>2. Better: Introduce a new ModuleVerifier pass and move the module-level verifications there.<br>



<br></div>Michael<br><div><div><div><br><br><br><br><div><br></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/13 Dmitry Babokin <span dir="ltr"><<a href="mailto:babokin@gmail.com" target="_blank">babokin@gmail.com</a>></span><br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Adding llvm-commits alias.<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 12, 2013 at 2:05 PM, Ilia Filippov <span dir="ltr"><<a href="mailto:ili.filippov@gmail.com" target="_blank">ili.filippov@gmail.com</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Michael,<br><br>Looks like your recent commit (r193719) has undesired / not intended side effect. Doing *function* verification we end up verifying module's global values.<br>





Here's a call stack, which leads to such behavior:<br>
<br><div>#0  ::Verifier::doFinalization (this=0x490c110, M=...) at lib/IR/Verifier.cpp:199<br>#1  llvm::FPPassManager::doFinalization (this=0x490bf60, M=...) at lib/IR/LegacyPassManager.cpp:1576<br>#2  llvm::legacy::FunctionPassManagerImpl::doFinalization (this=0x490bc60, M=...) at lib/IR/LegacyPassManager.cpp:1448<br>






#3  llvm::legacy::FunctionPassManager::doFinalization (this=0x7fffffffd100) at lib/IR/LegacyPassManager.cpp:1420<br>#4  llvm::verifyFunction (f=..., action=llvm::ReturnStatusAction) at lib/IR/Verifier.cpp:2405<br><br>Where #4 is in the function verifyFunction, that you've modified, and #0 contains the loop over all module global values:<br>






<br>    bool doFinalization(Module &M) {<br>      // Scan through, checking all of the external function's linkage now...<br>      for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {<br>        visitGlobalValue(*I);<div>






        <...><br><br>So you call a part of whole module verification inside function verification routine. This seems to be incorrect first of all (and leads to fails in our project based on LLVM, for example) and also inefficient (doing the same module walk for each function).<br>






</div></div><div><br></div><div>Any thoughts how to fix it?</div><div><br></div><div>Thanks!</div><span><font color="#888888"><div><br></div><div>Ilia.</div></font></span></div>
</blockquote></div><br></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>