Re: RTL CSE picking simpler but more expensive expressions (re: PR 65932)

2016-01-14 Thread Jeff Law
On 01/14/2016 03:15 AM, Kyrill Tkachov wrote: There are cases where calls to fold_rtx with a non-NULL insn don't end up modifying src, ending up in src to not be always equal to src_folded (I added an assert to that effect and saw it trigger). It seems that fold_rtx is not *guaranteed* to modify

Re: RTL CSE picking simpler but more expensive expressions (re: PR 65932)

2016-01-14 Thread Kyrill Tkachov
Hi Jeff, On 13/01/16 19:28, Jeff Law wrote: On 01/13/2016 04:33 AM, Kyrill Tkachov wrote: I've been able to get it to do the right thing by changing the line where it initially folds the source of the SET. That is line 4639 in cse.c: /* Simplify and foldable subexpressions in SRC. Then get th

Re: RTL CSE picking simpler but more expensive expressions (re: PR 65932)

2016-01-13 Thread Jeff Law
On 01/13/2016 04:33 AM, Kyrill Tkachov wrote: I've been able to get it to do the right thing by changing the line where it initially folds the source of the SET. That is line 4639 in cse.c: /* Simplify and foldable subexpressions in SRC. Then get the fully- simplified result, which may not nece

RTL CSE picking simpler but more expensive expressions (re: PR 65932)

2016-01-13 Thread Kyrill Tkachov
Hi all, I'm looking at mitigating some of the codegen regressions on arm that come from a proposed fix to PR 65932 and I believe RTL CSE is getting in the way. The problematic sequences involve sign-extending loads and sign-extending multiplies. From the gcc.target/arm/wmul-1.c case we have: (