<div dir="ltr">nvm. ValueSymbolTable uses this blocklen a lot.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 26, 2020 at 8:35 PM Stephan Z <<a href="mailto:stephan.yichao.zhao@gmail.com">stephan.yichao.zhao@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font color="#000000" face="arial, sans-serif">Hi,</font><div><font color="#000000" face="arial, sans-serif"><br></font></div><div><div><font color="#000000" face="arial, sans-serif"><a href="https://llvm.org/docs/BitCodeFormat.html#enter-subblock-encoding" target="_blank">https://llvm.org/docs/BitCodeFormat.html#enter-subblock-encoding</a><br></font></div><div><font color="#000000" face="arial, sans-serif">"The <code><span>blocklen</span></code> value is a 32-bit aligned value that specifies the size of the subblock in 32-bit words. This value allows the reader to skip over the entire block in one jump."</font></div></div><div><font color="#000000" face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><font color="#000000">In the code base, the parsing function of BitstreamCursor::<span style="background-color:rgb(251,252,253);white-space:pre-wrap"><a href="https://llvm.org/doxygen/BitstreamReader_8h_source.html#l00498" target="_blank">EnterSubBlock</a> has an optional argument to return </span></font>blocklen. </font><span style="font-family:arial,sans-serif">The </span><a href="https://llvm.org/doxygen/BitcodeAnalyzer_8cpp_source.html#I00759" style="font-family:arial,sans-serif" target="_blank">code</a><span style="font-family:arial,sans-serif"> at BitcodeAnalyzer is the only one that uses this argument. But it simply prints its value. </span><span style="font-family:arial,sans-serif">I did not find any code that uses the value to skip reading bitcode files.</span></div><div><font color="#000000" face="arial, sans-serif"><br></font></div><div><font color="#000000" face="arial, sans-serif">Does anyone know if any clients use blocklen?</font></div><div><a href="https://llvm.org/doxygen/BitstreamReader_8h_source.html#l00498" target="_blank"><font color="#000000" face="arial, sans-serif"></font></a><br></div><div>I am interested in this because Bitcode Writer cannot flush memory because it needs to <a href="https://llvm.org/doxygen/BitstreamWriter_8h_source.html#l00242" target="_blank">backfill</a> until the end of a block. At the very-top level, there is such a <a href="https://llvm.org/doxygen/BitcodeWriter_8cpp_source.html#I04328" target="_blank">block</a>: MODULE_BLOCK. So the entire bitcode contents cannot be flushed. </div><div><br></div><div>Thank you,</div></div>
</blockquote></div>