On 09/15/2015 05:25 PM, Jeff Law wrote: > On 09/15/2015 06:11 AM, Robin Dapp wrote: >> Hi, >> >> recently, I came across a problem that keeps a load instruction in a >> loop although it is loop-invariant. [..] > You might want to check your costing model -- cprop is supposed to look > at costs to help determine when propagations are useful. > > jeff >
I had a look at cprop and did not find any immediate references to cost structures or functions. When or how is cprop supposed to decide when to take action? Currently, it looks to me as if it would always try to propagate without checking costs. Recently, I found this https://gcc.gnu.org/ml/gcc-patches/2014-06/msg01321.html where Zhenqiang Chen introduces a cost check in cprop to prevent it from undoing invariant motion's work. AFAIK it has never gone upstream. Something similar might also help here. I'll try to adapt it to my problem and report back. Regards Robin