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: [PATCH] reload: Try alternative with swapped operands before going to the next


Uros Bizjak wrote:

> I don't have any problems with proposed order, but in my failed
> attempt to convert x86 to post-reload compare elimination,
> constrain_operands failed to recognize generated combined add+compare
> pattern, when commutative matched operands were swapped (e.g. the
> perfectly valid x86 add pattern above). constrain_operands was called
> from the call to validate_change (please see compare-elim.c) when
> flags clobber was substituted with compare.

I would consider the pattern you mention above:

> >> (set (reg: ax) (plus (reg: bx)(reg: ax)))

"perfectly valid" only *before* reload, but invalid after reload.

It does not directly match an insn pattern, but it can be modified
(by reload) so that after that modification it does match.

Swapping operands is one of the many operations reload may do
in order to make instructions strictly match insn patterns;
it is not something that any other pass will do on its own ...

In particular, constrain_operands does not (and is not supposed to)
perform any modification of the input pattern, it just checks whether
the pattern as-is validly matches an alternative.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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