This didn't work at all before, and would assert on any frame
index. Also copy the other fields, which I believe should cover
everything. There are a few that are untested since MIR serialization
is apparently still missing them.
Details
Diff Detail
Event Timeline
wdyt about testing MF cloning directly rather than indirectly via llvm-reduce? perhaps via unit tests?
Unit tests are more work. It's easier to have a standalone MIR test input. The only problem there is the remaining pieces which MIR serialization doesn't cover
I fear that having the cloning code in tools/llvm-reduce makes it easy for people to miss when they add new fields to MachineFrameInfo. Have you considered adding a MachineFrameInfo::clone(...) method instead so the code lives closer to the rest of MachineFrameInfo? (same comment probably applies to more of the machine function cloning code, so we can move the code around in an independent commit or another time...)
Either way LGTM
llvm/tools/llvm-reduce/ReducerWorkItem.cpp | ||
---|---|---|
81–82 | Maybe this should just be announced in the commit message. Having a FIXME comment here feels slightly off to me since we're not gonna add a test into this particular file or at this line. | |
98–99 | ||
111 | as above | |
130 |
Yes. The ugly point on that is you still need something to map between the new and old function block references, which feels like an llvm-reduce specific piece you can't avoid. I guess it could use the original blocks and llvm-reduce can post-process them
Maybe this should just be announced in the commit message. Having a FIXME comment here feels slightly off to me since we're not gonna add a test into this particular file or at this line.