Possible problem with loop-unrolling, templates and optimisation

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible problem with loop-unrolling, templates and optimisation

Artem Dergachev via cfe-dev

Hi CFE-Devs,

 

I am investigating a number of regressions in my out-of-tree target since I migrated from LLVM v4 to v5.  They have been there a while, but waiting for me to have time to analyse.  In all cases the enabling of the loop-unroller seems to cause the problem.

 

There are 14 failures are in ‘tests/std/containers/unord/unord[multimap]’ and 1 other ‘tests/src/utilities/exchange/exchange.pass.cpp’.  All appear to be to do with the list constructors and the list iteration.  I can’t see any particular issue with my backend, except that it is for non-interlocked VLIW so scheduling tends to be more sensitive to tiny differences in dependencies than for more traditional targets.

 

Disabling unrolling, or disabling function inlining seems to fix the problem.

 

Before I go digging deeper, has anybody else come across issues with the loop-unroller and these tests in their targets using the v5.0.0 sources?

 

I am emailing CFE rather than LLVM, because on the surface it looks like an IR emission issue from CLang, but I won’t know for sure until I start digging deeper.  If it transpires that it is not CLang, I will start a new conversation on LLVM-Dev.

 

Thanks,

 

            MartinO

 


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with loop-unrolling, templates and optimisation

Artem Dergachev via cfe-dev

There are 14 failures are in ‘tests/std/containers/unord/unord[multimap]’ and 1 other ‘tests/src/utilities/exchange/exchange.pass.cpp’.  All appear to be to do with the list constructors and the list iteration.  I can’t see any particular issue with my backend, except that it is for non-interlocked VLIW so scheduling tends to be more sensitive to tiny differences in dependencies than for more traditional targets.


​Does Hexagon pass those cases?​

--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with loop-unrolling, templates and optimisation

Artem Dergachev via cfe-dev

I don’t have a Hexagon test environment, and don’t know how to access the BuildBot results for Hexagon.

 

Thanks,

 

            MartinO

 

From: 陳韋任 [mailto:[hidden email]]
Sent: 30 January 2018 14:38
To: Martin J. O'Riordan <[hidden email]>
Cc: clang developer list <[hidden email]>
Subject: Re: [cfe-dev] Possible problem with loop-unrolling, templates and optimisation

 

 

There are 14 failures are in ‘tests/std/containers/unord/unord[multimap]’ and 1 other ‘tests/src/utilities/exchange/exchange.pass.cpp’.  All appear to be to do with the list constructors and the list iteration.  I can’t see any particular issue with my backend, except that it is for non-interlocked VLIW so scheduling tends to be more sensitive to tiny differences in dependencies than for more traditional targets.

 

​Does Hexagon pass those cases?​

 

--

Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with loop-unrolling, templates and optimisation

Artem Dergachev via cfe-dev
In reply to this post by Artem Dergachev via cfe-dev
On 1/30/2018 6:26 AM, Martin J. O'Riordan via cfe-dev wrote:

Hi CFE-Devs,

 

I am investigating a number of regressions in my out-of-tree target since I migrated from LLVM v4 to v5.  They have been there a while, but waiting for me to have time to analyse.  In all cases the enabling of the loop-unroller seems to cause the problem.

 

There are 14 failures are in ‘tests/std/containers/unord/unord[multimap]’ and 1 other ‘tests/src/utilities/exchange/exchange.pass.cpp’.  All appear to be to do with the list constructors and the list iteration.  I can’t see any particular issue with my backend, except that it is for non-interlocked VLIW so scheduling tends to be more sensitive to tiny differences in dependencies than for more traditional targets.

 

Disabling unrolling, or disabling function inlining seems to fix the problem.

 


I would generally assume this indicates an optimization bug.  (That isn't always true; the source code could have undefined behavior.   But if the test doesn't have any asan or ubsan failures, there isn't any good way to track down undefined behavior anyway.)

You probably want to start with https://llvm.org/docs/OptBisect.html.

-Eli
-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with loop-unrolling, templates and optimisation

Artem Dergachev via cfe-dev

Thanks Eli,

 

I didn’t know about this document, and it looks like it has good guidance for other types of debugging too.

 

            MartinO

 

From: Friedman, Eli [mailto:[hidden email]]
Sent: 30 January 2018 18:36
To: Martin J. O'Riordan <[hidden email]>; 'clang developer list' <[hidden email]>
Subject: Re: [cfe-dev] Possible problem with loop-unrolling, templates and optimisation

 

On 1/30/2018 6:26 AM, Martin J. O'Riordan via cfe-dev wrote:

Hi CFE-Devs,

 

I am investigating a number of regressions in my out-of-tree target since I migrated from LLVM v4 to v5.  They have been there a while, but waiting for me to have time to analyse.  In all cases the enabling of the loop-unroller seems to cause the problem.

 

There are 14 failures are in ‘tests/std/containers/unord/unord[multimap]’ and 1 other ‘tests/src/utilities/exchange/exchange.pass.cpp’.  All appear to be to do with the list constructors and the list iteration.  I can’t see any particular issue with my backend, except that it is for non-interlocked VLIW so scheduling tends to be more sensitive to tiny differences in dependencies than for more traditional targets.

 

Disabling unrolling, or disabling function inlining seems to fix the problem.

 


I would generally assume this indicates an optimization bug.  (That isn't always true; the source code could have undefined behavior.   But if the test doesn't have any asan or ubsan failures, there isn't any good way to track down undefined behavior anyway.)

You probably want to start with https://llvm.org/docs/OptBisect.html.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev