[LLVMdev] Adding option to LLVM opt to disable a specific pass from command line

Seb babslachem at gmail.com
Fri Dec 9 01:03:37 PST 2011


David,

I think my explanation is not clear, my front-end did NOTt generate
'llvm.memcpy' it generate LL code that after use of LLVM 'opt' get
transformed by 'loop-idom' pass into an 'llvm.memcpy' for an overlapping
loop:

static void
t0(int n)
{
    int i;
    for (i=0; i<n; i++)
    result[i+1] = result[i];
}

Then 'llc' expanded llvm.memcpy into a sequence of load/store that where
performed out-of-order and thus the final code was incorrect.
So to sumarize, BUG was not in my front-end, it was in LLVM 'opt' loop-idom
pass, it seems now fixed into 3.0. However I think I would be a good idea
to add more control from command line on pass we want to disable.

Best Regards
Seb

2011/12/8 David Blaikie <dblaikie at gmail.com>

> > For instance, I figured out that loop-idiom pass has a BUG in
> > LLVM 2.9, a llvm.memcpy is generated for an overlapping memory region and
> > then x86 backend reorder loads/store thus generating a BUG.
>
> Just for the record it seems this is a bug in your frontend, not in
> the LLVM backend. The memcpy intrinsic, like the standard memcpy
> function, requires that the regions be non-overlapping:
> http://llvm.org/docs/LangRef.html#int_memcpy By violating this
> contract it's possible you'll encounter all sorts of issues in other
> passes too.
>
> - David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111209/9a35522e/attachment.html>


More information about the llvm-dev mailing list