regalloc2 icon indicating copy to clipboard operation
regalloc2 copied to clipboard

Conflict between Stack and Reg uses of the same vreg

Open Amanieu opened this issue 4 years ago • 2 comments

Two uses of the same vreg on the same instruction causes an assertion failure if one of them is Stack and the other is Reg or FixedReg since it results in a minimal bundle that cannot be split.

We already handle the case of multiple conflicting FixedReg constraints, should we extend this to also cover the case of Stack/Reg conflicts?

Amanieu avatar Sep 16 '21 11:09 Amanieu

This was not caught by the fuzzer because it never generates OperandConstraint::Stack.

Amanieu avatar Sep 16 '21 11:09 Amanieu

Hmm, yes, right now specifying both is sort of a "user error", which is why the fuzzer doesn't generate that case.

I had created the Stack constraint basically with GC/stackmaps in mind, and the current design suits that, but I agree that making Stack more general (for explicit stack slots) means that we should probably support the multi-constraint case.

I'm happy to review a patch that does something like what we do for multi-fixed-regs, as you suggest; perhaps we can just rename the mechanism to "multi-constraints" or somesuch?

cfallin avatar Sep 16 '21 15:09 cfallin