Seb
2011-Dec-09 09:03 UTC
[LLVMdev] Adding option to LLVM opt to disable a specific pass from command line
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>
Joerg Sonnenberger
2011-Dec-09 12:22 UTC
[LLVMdev] Adding option to LLVM opt to disable a specific pass from command line
On Fri, Dec 09, 2011 at 10:03:37AM +0100, Seb wrote:> 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]; > }Do you really want to assign result[0] to everything? I wonder how much work it is to each the loop-idiom pass to handle this and the case of reverse indices correctly, if result is char *. E.g. create either memset or memmove... Joerg
Seb
2011-Dec-09 13:23 UTC
[LLVMdev] Adding option to LLVM opt to disable a specific pass from command line
2011/12/9 Joerg Sonnenberger <joerg at britannica.bec.de>> On Fri, Dec 09, 2011 at 10:03:37AM +0100, Seb wrote: > > 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]; > > } > > Do you really want to assign result[0] to everything? > > I wonder how much work it is to each the loop-idiom pass to handle this > and the case of reverse indices correctly, if result is char *. E.g. > create either memset or memmove... > > Joerg >This thread is not to discuss how relevant this example is. I just would like to know: a) If people think that adding an option to disable a specific pass is useful. b) To discuss implementation details (disable all pass invocations, what to do when there are dependencies between passes invocations). c) If I implement it, what's the process to get my change merge with trunk. Now for my own purpose, I commented out loop-idiom invocation in LLVM 2.9 sources and it worked well. I just wanted to develop something generic that could benefit LLVM community. Best Regards Seb -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111209/41c6f085/attachment.html>
Reasonably Related Threads
- [LLVMdev] Adding option to LLVM opt to disable a specific pass from command line
- [LLVMdev] Adding option to LLVM opt to disable a specific pass from command line
- [LLVMdev] Adding option to LLVM opt to disable a specific pass from command line
- [LLVMdev] Adding option to LLVM opt to disable a specific pass from command line
- [LLVMdev] Any way to disable a specific optimization on 'opt' command line