[PATCH] D58191: [DebugInfo] Make postra sinking of DBG_VALUEs safe in the presence of subregisters
Jeremy Morse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 13 09:20:58 PST 2019
jmorse created this revision.
jmorse added reviewers: aprantl, bjope, vsk.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.
Currently the machine instruction sinker identifies DBG_VALUE insts that also need to sink by comparing register numbers. Unfortunately this isn't safe, because (after register allocation) a DBG_VALUE may read a register that aliases what's being sunk. To fix this, identify the DBG_VALUEs that need to sink by recording & examining their register units. Register units gives us the following guarantee:
"Two registers overlap if and only if they have a common register unit" [MCRegisterInfo.h]
Thus we can always identify aliasing DBG_VALUEs if the set of register units read by the DBG_VALUE, and the register units of the instruction being sunk, intersect. (MachineSink already uses classes like "LiveRegUnits" for determining sinking validity anyway).
The test added checks for super and subregister DBG_VALUE reads of a sunk copy being sunk as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 8027 bytes
Desc: not available
More information about the llvm-commits