[LLVMdev] Incorrect loop optimization when building the Linux kernel

Joerg Sonnenberger joerg at britannica.bec.de
Mon Dec 8 12:28:03 PST 2014


On Mon, Dec 08, 2014 at 10:32:52AM -0800, Reid Kleckner wrote:
> We need a way to express iteration over the concatenated contents of a
> section in LLVM IR that has a logical lowering from C. We should either
> adopt the GNU binutils convention of special __start_* / __end_* symbols,
> or invent a new representation that is compelling.

The problem is that the interface depends on aliasing symbols. The
interface should provide pointers to the first and the last (or
the one-beyond-last) element. That would be semantically fine for C.

That can also be expressed already e.g. like

extern char __start_my_ptr_section, __end_my_ptr_section;
void *__start = &__start_my_ptr_section, *end =
&__end_my_ptr_section;

and "only" depending on the inability to compute the pointer value at
compile time.

Joerg



More information about the llvm-dev mailing list