Shrink wrapping should ignore DBG_VALUEs referring to frame indices, since the presence of debug information must not affect code generation.
Details
Diff Detail
Event Timeline
llvm/trunk/lib/CodeGen/ShrinkWrap.cpp | ||
---|---|---|
244 ↗ | (On Diff #126794) | Should probably do MO.isDef() || MO.readsReg() below instead of this check. |
llvm/trunk/lib/CodeGen/ShrinkWrap.cpp | ||
---|---|---|
244 ↗ | (On Diff #126794) | That would do it for register operands, but seems that DBG_VALUE instructions also have FrameIndex operands. Is MI.isDebugValue() not enough here? |
llvm/trunk/lib/CodeGen/ShrinkWrap.cpp | ||
---|---|---|
244 ↗ | (On Diff #126794) | the operands of DBG_VALUE have MachineOperand::isDebug() set, so readsReg() will always return false for them. The good thing about MachineOperand::readsReg() is that it also checks some other conditions that are often forgotten (such as undef operands or internals reads in bundles, which both are forgotten here as well it seems). |
llvm/trunk/lib/CodeGen/ShrinkWrap.cpp | ||
---|---|---|
244 ↗ | (On Diff #126794) | And you are right you probably need an extra MO.isDebugValue() check for the frame index case, didn't realize the code was checking MachineOperand::isFI() here. But in this case I'd move the isDebugValue() check closer to the isFI() check. |