This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CSE pass prevents loop-invariant motion


On 09/24/2015 12:29 AM, Robin Dapp wrote:
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.
That patch was picked up by Kugan and a variant thereof installed back in June on the trunk. See cprop.c::try_replace_reg.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]