[LLVMdev] Does block order matter?

Duncan Sands baldrick at free.fr
Wed Feb 27 00:59:40 PST 2013


Hi,

On 27/02/13 07:32, edA-qa mort-ora-y wrote:
> In my generator I find it convenient to just attach blocks as I create
> them, rather than try and maintain some kind of forward flowing order.
> Does this hinder the optimizers in any way, or will generally any order
> be okay?

I think pretty much everyone does the same as you.  I've got to admit that
basic block order can matter, though it's not really supposed to.  That's
the kind of thing that optimizers exist for, so if you find an egregious
example of basic block ordering making a difference, I suggest you open a
bug report asking for it to be fixed by having the optimizers reorder the
basic blocks better.

Ciao, Duncan.




More information about the llvm-dev mailing list