CodeGen RegisterCoalescer

Hi Jonas,

These operands are not supposed to be around… they are added a bit later in the method.

I’m not quite sure what you mean here?

I think that assertion is there to catch the case where a rematerialized instruction is implicitly clobbering the flags register, which is fairly common. I don’t think the coalescer knows how to deal with implicit operands in general.

Are you able to tell us anything about the nature of the instruction (and implicit use) that you’re trying to rematerialize?

Cheers,
Lang.

Hi Jonas,

Hi Jonas,

These operands are not supposed to be around… they are added a bit later in the method.

I’m not quite sure what you mean here?

I think that assertion is there to catch the case where a rematerialized instruction is implicitly clobbering the flags register, which is fairly common. I don’t think the coalescer knows how to deal with implicit operands in general.

Are you able to tell us anything about the nature of the instruction (and implicit use) that you’re trying to rematerialize?

Cheers,
Lang.

This method only handles trivial def. I.e., instructions that do not have any actual uses.

If you have implicit use operands, then the rematerialization may be wrong.
E.g…

v1 = remat_inst
R3 =
<— If you rematerialize here you will use of different value of R3 and that may change the value of v1.

If the value of the implicit uses do not change the value of the def, I guess you shouldn’t specify them in the first place.
An alternative in that case is to use a pseudo instruction that you will lower with the implicit use later (though I do not see why you would need it if they do not change the result).

The bottom line is if you have registers uses (implicit or not), then you cannot trivially rematerialize this instruction.

Cheers,
-Quentin