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: RFA: patch to fix a bad code generation for PR64110 -- new constraints addition


On 01/24/15 04:29, Richard Sandiford wrote:

Yeah.  I expect in practice most people who used "?" and "!" attached
them to a particular operand for a reason.  From a quick scan through
386.exp it looked like almost all uses would either want this behaviour
or wouldn't care.  An interesting exception is:

(define_insn "extendsidi2_1"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=*A,r,?r,?*o")
	(sign_extend:DI (match_operand:SI 1 "register_operand" "0,0,r,r")))
    (clobber (reg:CC FLAGS_REG))
    (clobber (match_scratch:SI 2 "=X,X,X,&r"))]
   "!TARGET_64BIT"
   "#")

I don't know how effective the third alternative is with LRA.  Surely
a "r<-0" alternative is by definition a case where "r<-r" is possible
only with a "?"-cost reload?  Seems to me we could just delete it.
But assuming it does some good, I suppose the "?" really does apply to
the alternative as a whole.  If we had to reload operand 1 or operand 0,
there's an extra cost if it can't use the same register as the other
operand.

Wouldn't it be better to make "?" and "!" behave the new way and only
add new constraints if it turns out that the old behaviour really is
useful in some cases?

Maybe stage 4 isn't the time to be making that kind of change.
Still, it'd be great if someone who's set up do x86_64 benchmarking
could measure the effect of making "?" and "!" behave like the
new constraints.
My worry isn't the x86_64 port, but all the others that folks don't test as regularly.

I'd rather go the other direction, have folks familiar with the port go through it changing the constraints where it makes sense. That just seems a hell of a lot safer.

A port maintainer could certainly hack something together for testing purposes to guide them as to whether or not there's something to be gained by converting many/most of the ?! to the new constraints.

jeff


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