[PATCH] D41226: LiveDebugValues spill recognition expasnsion
Bjorn Pettersson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 7 12:43:14 PST 2018
bjope added inline comments.
Comment at: lib/CodeGen/LiveDebugValues.cpp:443
+ // Check whether next instruction kills the spilled register.
+ auto NextI = std::next(MI.getIterator());
+ // Skip next instruction that points to basic block end iterator.
In case of bundles this will move to the next instruction inside the bundle (unless it is the last instruction in the bundle)?
That seems weird. One reason is that the result would depend on the order of the bundled instructions.
Is perhaps the intent to look at the next BUNDLE instruction in case of MI being inside a bundle?
If so then I guess something like this would do the trick:
auto NextI = std::next(MachineBasicBlock::const_iterator::getAtBundleBegin(MI.getIterator()));
There could ofcourse be parallel uses of "Reg" in the same bundle, and the KILL marking could perhaps be on one of those instructions. So if MI is bundled, perhaps you need to analyse all the parallel instructions (and the instructions in the next bundle)?
The situation when there is another instruction in the same bundle that defines "Reg" is perhaps also interesting when it comes to additional test cases. But in that case I guess there should be a KILL marking for "Reg" already in the spilling store instruction (or in the BUNDLE head).
Some test cases involving bundles would not hurt.
More information about the llvm-commits