MIRParserImpl::computeFunctionProperties uses MRI.getNumVirtRegs() to
set the NoVReg property. By adding a bunch of registers to the MIR test
cases, the NoVReg property is not set when importing the MIR. Otherwise
NoVReg is set after instruction selection while the machine instructions
still contain virtual registers, causing expensive checks to fail.
Details
Diff Detail
Event Timeline
BTW: mir has a feature nowadays, where you can say %0 : gprnopc the first time a vreg is used instead of declaring it in the registers list. Unfortunately the dumper doesn't know about it yet. You may want to switch to that style, though this is fine too.
I just realized the vregs aren't even used, why are you adding 14 of them then and not just 1? This also seems odd enough that it warrants a comment in the .mir files.
The fix is also strange; I think what we really need here is a -start-after or -start-before llc argument so it starts at a later pass which doesn't create new vregs anymore. Maybe adrian remembers what -stop-after line he used to create them so we can use the same for start-after?
Agreed, in hindsight the current solution is quite heavy-handed. 1 register
@efriedma -start-after=livedebugvalues works for me only for test/DebugInfo/MIR/ARM/split-superreg-complex.mir, for the other 2 FileCheck fails, I think because the check patterns are stronger. I'll have another look tomorrow.
Using -start-before=livedebugvalues . I had to adjust the offset, but I don't think the exact offset is crucial for the test case. Maybe @aprantl can confirm that?
@MatzeB are you happy with the change too? It appears you have to remove your 'This revision now requires changes to proceed.' setting before Phab will mark this patch as accepted.