discouraging register use
DJ Delorie
dj@redhat.com
Tue Jan 4 20:39:00 GMT 2005
> If the read-modify-write operand has double cost for the memory
> access, it should be more like:
Oh, right. Good idea. Thanks!
> To allow realod inheritance to work where the same value happens to lie around in a 'c'
> class register, you also have to extend all the 'm' alternatives with a 'c':
> [(set (match_operand:SI 0 "" "c,c,??mc,??mc")
How does this related to Richard's comment that this denigrates the "c" class also?
> (plus:SI (match_operand:SI 1 "" "0,0,0,0")
> (match_operand:SI 1 "" "c,?mc,c,?mc")))]
> and make sure the union of the two classes is a register class.
What about when there are three classes, say c, d, and m - do I need
cm, dm, and cdm unions, or just cm and dm?
> Another thing to consider is if you want register class preferencing to ignore or further
> penalize the 'm' class.
> E.g. this would triple the penalty for register preferencing:
> [(set (match_operand:SI 0 "" "c,c,??mc#????,??mc#????")
Ok, someone needs to write a book about all this ;-)
> You might also consider making your addsi commutative, i.e. adding a '%' constraint modifier.
Yeah, the real code has that.
More information about the Gcc
mailing list