Sebastian Blessing via llvm-dev
2015-Sep-11 11:37 UTC
[llvm-dev] Optimizer issues on Windows
Dear Community, The ponyc<https://github.com/CausalityLtd/ponyc/tree/llvm37> (llvm37 branch) project is facing an issue on Windows: When optimizations are turned on (llvm 3.7.0-final and more specifically<https://github.com/CausalityLtd/ponyc/blob/llvm37/src/libponyc/codegen/genopt.cc>, opt-level 3, BBVectorize, LoopVectorize, SLPVectorize, RerollLoops, LoadCombine + a custom heap to stack pass) writing an object file aborts (on Windows only) with the following fatal error: “Starting a function before ending the previous one!” at MCStreamer.cpp:407 during LLVMTargetMachineEmitToFile. Verifying the IR with llc raises no errors. What exact problem is being detected here and how can we get more details on the location in the IR that is causing the problem? Turning off optimizations successfully writes the object file. This only occurs on Windows, writing object files works fine on Linux and OS X. Is this a know issue with LLVM 3.7.0-final and how can this be fixed? Is a patch required? This might be related to https://llvm.org/bugs/show_bug.cgi?id=24374. Kind regards Sebastian -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150911/c46b5d8b/attachment.html>
Martin J. O'Riordan via llvm-dev
2015-Sep-11 13:11 UTC
[llvm-dev] Optimizer issues on Windows
I have found that failures such as this (especially given the nature of diagnostic, and the fact that it only crashes on Windows), have often had to do with the a bug in using the C++ Standard collections and iterators. It is worth building this in Debug mode using MSVC++ and using the debug instrumented STL collections and iterators. The implementation of these in MSVC++ is more rigorous than the version provided with G++ and using this in debug mode often diagnoses an iteration error in the code that appears to be harmless in the G++ implementation, but which represents a logical failure in the code that is still wrong, but does not crash. MartinO From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Sebastian Blessing via llvm-dev Sent: 11 September 2015 12:38 To: llvm-dev at lists.llvm.org Subject: [llvm-dev] Optimizer issues on Windows Dear Community, The ponyc <https://github.com/CausalityLtd/ponyc/tree/llvm37> (llvm37 branch) project is facing an issue on Windows: When optimizations are turned on (llvm 3.7.0-final and more specifically <https://github.com/CausalityLtd/ponyc/blob/llvm37/src/libponyc/codegen/genopt.cc> , opt-level 3, BBVectorize, LoopVectorize, SLPVectorize, RerollLoops, LoadCombine + a custom heap to stack pass) writing an object file aborts (on Windows only) with the following fatal error: “Starting a function before ending the previous one!” at MCStreamer.cpp:407 during LLVMTargetMachineEmitToFile. Verifying the IR with llc raises no errors. What exact problem is being detected here and how can we get more details on the location in the IR that is causing the problem? Turning off optimizations successfully writes the object file. This only occurs on Windows, writing object files works fine on Linux and OS X. Is this a know issue with LLVM 3.7.0-final and how can this be fixed? Is a patch required? This might be related to https://llvm.org/bugs/show_bug.cgi?id=24374. Kind regards Sebastian -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150911/2e73cf3b/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 332 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150911/2e73cf3b/attachment.jpg>
The bug https://llvm.org/bugs/show_bug.cgi?id=24374 has to do with exceptions on Windows, so it is unrelated unless you are using them. On Fri, Sep 11, 2015 at 4:37 AM, Sebastian Blessing via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Dear Community, > > The ponyc <https://github.com/CausalityLtd/ponyc/tree/llvm37> (llvm37 > branch) project is facing an issue on Windows: > > When optimizations are turned on (llvm 3.7.0-final and more specifically > <https://github.com/CausalityLtd/ponyc/blob/llvm37/src/libponyc/codegen/genopt.cc>, > opt-level 3, BBVectorize, LoopVectorize, SLPVectorize, RerollLoops, > LoadCombine + a custom heap to stack pass) writing an object file aborts > (on Windows only) with the following fatal error: > > “Starting a function before ending the previous one!” at > MCStreamer.cpp:407 during LLVMTargetMachineEmitToFile. Verifying the IR > with llc raises no errors. > > What exact problem is being detected here and how can we get more details > on the location in the IR that is causing the problem? > > Turning off optimizations successfully writes the object file. This only > occurs on Windows, writing object files works fine on Linux and OS X. > > Is this a know issue with LLVM 3.7.0-final and how can this be fixed? Is a > patch required? > > This might be related to https://llvm.org/bugs/show_bug.cgi?id=24374. > > Kind regards > Sebastian > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150911/33e68252/attachment-0001.html>
PR24374 has been fixed on trunk (r247435). On Fri, Sep 11, 2015 at 8:07 AM, Reid Kleckner via llvm-dev < llvm-dev at lists.llvm.org> wrote:> The bug https://llvm.org/bugs/show_bug.cgi?id=24374 has to do with > exceptions on Windows, so it is unrelated unless you are using them. > > On Fri, Sep 11, 2015 at 4:37 AM, Sebastian Blessing via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Dear Community, >> >> The ponyc <https://github.com/CausalityLtd/ponyc/tree/llvm37> (llvm37 >> branch) project is facing an issue on Windows: >> >> When optimizations are turned on (llvm 3.7.0-final and more specifically >> <https://github.com/CausalityLtd/ponyc/blob/llvm37/src/libponyc/codegen/genopt.cc>, >> opt-level 3, BBVectorize, LoopVectorize, SLPVectorize, RerollLoops, >> LoadCombine + a custom heap to stack pass) writing an object file aborts >> (on Windows only) with the following fatal error: >> >> “Starting a function before ending the previous one!” at >> MCStreamer.cpp:407 during LLVMTargetMachineEmitToFile. Verifying the IR >> with llc raises no errors. >> >> What exact problem is being detected here and how can we get more details >> on the location in the IR that is causing the problem? >> >> Turning off optimizations successfully writes the object file. This only >> occurs on Windows, writing object files works fine on Linux and OS X. >> >> Is this a know issue with LLVM 3.7.0-final and how can this be fixed? Is >> a patch required? >> >> This might be related to https://llvm.org/bugs/show_bug.cgi?id=24374. >> >> Kind regards >> Sebastian >> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >> > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150911/ee6c3efb/attachment.html>
Nicholas Chapman via llvm-dev
2015-Sep-11 19:13 UTC
[llvm-dev] Optimizer issues on Windows
I wouldn't use BBVectorize: http://forwardscattering.org/post/23 Cheers, nick On 11/09/2015 12:37, Sebastian Blessing via llvm-dev wrote:> Dear Community, > > The ponyc <https://github.com/CausalityLtd/ponyc/tree/llvm37> (llvm37 > branch) project is facing an issue on Windows: > > When optimizations are turned on (llvm 3.7.0-final and more > specifically > <https://github.com/CausalityLtd/ponyc/blob/llvm37/src/libponyc/codegen/genopt.cc>, > opt-level 3, BBVectorize, LoopVectorize, SLPVectorize, RerollLoops, > LoadCombine + a custom heap to stack pass) writing an object file > aborts (on Windows only) with the following fatal error: > > “Starting a function before ending the previous one!” at > MCStreamer.cpp:407 during LLVMTargetMachineEmitToFile. Verifying the > IR with llc raises no errors. > > What exact problem is being detected here and how can we get more > details on the location in the IR that is causing the problem? > > Turning off optimizations successfully writes the object file. This > only occurs on Windows, writing object files works fine on Linux and OS X. > > Is this a know issue with LLVM 3.7.0-final and how can this be fixed? > Is a patch required? > > This might be related to https://llvm.org/bugs/show_bug.cgi?id=24374. > > Kind regards > Sebastian > > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150911/9f842b8f/attachment.html>
Sebastian Blessing via llvm-dev
2015-Sep-12 13:07 UTC
[llvm-dev] Optimizer issues on Windows
Thanks, we are using exceptions so this might be a problem. Lets see whether the patch that is fixing said bug report fixes our issue! From: Reid Kleckner Date: Friday 11 September 2015 17:07 To: Sebastian Blessing Cc: "llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>" Subject: Re: [llvm-dev] Optimizer issues on Windows The bug https://llvm.org/bugs/show_bug.cgi?id=24374 has to do with exceptions on Windows, so it is unrelated unless you are using them. On Fri, Sep 11, 2015 at 4:37 AM, Sebastian Blessing via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: Dear Community, The ponyc<https://github.com/CausalityLtd/ponyc/tree/llvm37> (llvm37 branch) project is facing an issue on Windows: When optimizations are turned on (llvm 3.7.0-final and more specifically<https://github.com/CausalityLtd/ponyc/blob/llvm37/src/libponyc/codegen/genopt.cc>, opt-level 3, BBVectorize, LoopVectorize, SLPVectorize, RerollLoops, LoadCombine + a custom heap to stack pass) writing an object file aborts (on Windows only) with the following fatal error: “Starting a function before ending the previous one!” at MCStreamer.cpp:407 during LLVMTargetMachineEmitToFile. Verifying the IR with llc raises no errors. What exact problem is being detected here and how can we get more details on the location in the IR that is causing the problem? Turning off optimizations successfully writes the object file. This only occurs on Windows, writing object files works fine on Linux and OS X. Is this a know issue with LLVM 3.7.0-final and how can this be fixed? Is a patch required? This might be related to https://llvm.org/bugs/show_bug.cgi?id=24374. Kind regards Sebastian _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150912/dddd1812/attachment.html>
Sebastian Blessing via llvm-dev
2015-Sep-12 13:39 UTC
[llvm-dev] Optimizer issues on Windows
This got me into thinking. Indeed the problem is related to Windows exceptions, so I am not sure whether the bug reported<https://llvm.org/bugs/show_bug.cgi?id=24374> is actually fixed. Compiling Pony code (helloworld) that includes no exceptions does work fine (with optimizations). As soon as exceptions on windows come into play, writing the object file dies with the mentioned error in MCStreamer.cpp. Here<http://releases.ponylang.org/winexcept/> are two minimal IR examples (helloworld.ll works, try.ll doesn’t - both verify with llc). The relevant method is @Main_create. Can anyone of you guys confirm the issue with llvm 3.7.0–final, or whether said bug has actually been fixed? From: Reid Kleckner Date: Friday 11 September 2015 17:07 To: Sebastian Blessing Cc: "llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>" Subject: Re: [llvm-dev] Optimizer issues on Windows The bug https://llvm.org/bugs/show_bug.cgi?id=24374 has to do with exceptions on Windows, so it is unrelated unless you are using them. On Fri, Sep 11, 2015 at 4:37 AM, Sebastian Blessing via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: Dear Community, The ponyc<https://github.com/CausalityLtd/ponyc/tree/llvm37> (llvm37 branch) project is facing an issue on Windows: When optimizations are turned on (llvm 3.7.0-final and more specifically<https://github.com/CausalityLtd/ponyc/blob/llvm37/src/libponyc/codegen/genopt.cc>, opt-level 3, BBVectorize, LoopVectorize, SLPVectorize, RerollLoops, LoadCombine + a custom heap to stack pass) writing an object file aborts (on Windows only) with the following fatal error: “Starting a function before ending the previous one!” at MCStreamer.cpp:407 during LLVMTargetMachineEmitToFile. Verifying the IR with llc raises no errors. What exact problem is being detected here and how can we get more details on the location in the IR that is causing the problem? Turning off optimizations successfully writes the object file. This only occurs on Windows, writing object files works fine on Linux and OS X. Is this a know issue with LLVM 3.7.0-final and how can this be fixed? Is a patch required? This might be related to https://llvm.org/bugs/show_bug.cgi?id=24374. Kind regards Sebastian _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150912/a29102a1/attachment.html>