[PATCH] D110105: [MachineInstr] Move MIParser's DBG_VALUE RegState::Debug invariant into MachineInstr::addOperand
Stephen Tozer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 28 05:59:37 PDT 2021
StephenTozer added a comment.
This looks like a strict improvement, since the new location for calling `setIsDebug` will catch all the old cases and more. There is one gap though - `MachineOperand->ChangeToRegister(0, false)` can be called on an operand for a `DBG_VALUE` (and is in multiple places), which sounds like it could cause the same problem you've observed; plugging this gap may require adding a similar block to that function.
This could probably do with a test - `isDebug` isn't printed to MIR, and it sounds like the issue only appears on a backend that isn't in LLVM, so a lit test probably isn't feasible. A simple unit test could work though: possibly a test in MachineInstrTest that creates a MachineInstr, adds MachineOperands, and confirms that they're debug registers.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110105/new/
https://reviews.llvm.org/D110105
More information about the llvm-commits
mailing list