regalloc2
regalloc2 copied to clipboard
Conflict between Stack and Reg uses of the same vreg
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?
This was not caught by the fuzzer because it never generates OperandConstraint::Stack.
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?