the eliminatable-copy? word is the fix. the previous code only checked
that the registers had the same register class, but you also need to
check that they dont have the same representation size. because a copy
from double-rep -> double-2-rep is not eliminatable
{ $description "Delete follower's class, and set leaders's class to merged." } ;
-HELP: coalesce-insn
+HELP: coalesce-now
{ $values { "insn" insn } }
-{ $description "Generic word supposed to be called in a " { $link make } " context which generates a list of eliminatable vreg copies. The word either eliminates copies immediately in case of " { $link ##phi } " and " { $link ##tagged>integer } " instructions or appends copies to the make sequence so that they are handled later by " { $link coalesce-cfg } "." } ;
+{ $description "Generic word which finds copy pairs in instructions and tries to eliminate them directly." }
+{ $see-also coalesce-later } ;
+
+HELP: coalesce-later
+{ $values { "insn" insn } }
+{ $description "Generic word supposed to be called in a " { $link make } " context which generates a list of eliminatable vreg copies. The copies are batched up and then eliminated by " { $link try-eliminate-copies } "." } ;
+{ $description "Determines if a vreg copy can be eliminated. It can be eliminated if the vregs have the same register class and same representation size." } ;
{ $description "Tries to eliminate a vreg copy from 'leader' to 'follower'. If 'must?' is " { $link t } " then a " { $link vregs-shouldn't-interfere } " error is thrown if the vregs interfere." }
+"This compiler pass eliminates redundant vreg copies. Coalescing occurs in two steps. First all redundant copies in all " { $link ##tagged>integer } " and " { $link ##phi } " instructions are handled. Then those in other instructions like " { $link vreg-insn } ", " { $link ##copy } " and " { $link ##parallel-copy } "."