[LLVMdev] Incorrect loop optimization when building the Linux kernel

Tim Northover t.p.northover at gmail.com
Sun Dec 7 21:05:09 PST 2014


> Could anyone explain why this is unhappening and how to avoid it.

It's difficult to say without a full example, but I'm very suspicious
of those global declarations. I think the compiler would be entirely
justified in assuming you could *never* get from __start_builtin_fw to
__end_builtin_fw, let alone on the first iteration: they're distinct
array objects and by definition (within C99) can't overlap.

Trouble is, any perturbation of that code would change things so
drastically that it's going to be difficult to prove that's the cause
without digging into the exact LLVM pass that does the transformation
to see what it's basing the decision on.

Cheers.

Tim.



More information about the llvm-dev mailing list