Does inst_iterator (http://llvm.org/docs/ProgrammersManual.html#iterating-over-the-instruction-in-a-function) guarantee that the iterated instructions are in program order: the order of instructions printed by llvm-dis? Thanks in advance, Anirudh
It will iterate over the instructions in the order that they are stored in the module/function/basicblock that they belong to. And that SHOULD, assuming llvm-dis does what it is expected to do, be the same order. -- Mats On 15 June 2015 at 18:10, Anirudh Sivaraman <sk.anirudh at gmail.com> wrote:> Does inst_iterator > ( > http://llvm.org/docs/ProgrammersManual.html#iterating-over-the-instruction-in-a-function > ) > guarantee that the iterated instructions are in program order: the > order of instructions printed by llvm-dis? > > Thanks in advance, > Anirudh > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150615/eecfc596/attachment.html>
On Mon, Jun 15, 2015 at 10:50 AM, mats petersson <mats at planetcatfish.com> wrote:> It will iterate over the instructions in the order that they are stored in > the module/function/basicblock that they belong to. And that SHOULD, > assuming llvm-dis does what it is expected to do, be the same order. >Thanks for the reply. What about instruction ordering across basic blocks? Let's say instructions IA and IB belong to basic blocks BBa and BBb, where BBa is before BBb in program order. Then, will IA be printed before IB? Anirudh> -- > Mats > > On 15 June 2015 at 18:10, Anirudh Sivaraman <sk.anirudh at gmail.com> wrote: >> >> Does inst_iterator >> >> (http://llvm.org/docs/ProgrammersManual.html#iterating-over-the-instruction-in-a-function) >> guarantee that the iterated instructions are in program order: the >> order of instructions printed by llvm-dis? >> >> Thanks in advance, >> Anirudh >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >