This is an archive of the discontinued LLVM Phabricator instance.

Place the lowered phi instruction(s) before the DEBUG_VALUE entry
ClosedPublic

Authored by keith.walker.arm on Aug 21 2016, 7:42 AM.

Details

Summary

When a phi node is finally lowered to a machine instruction it is
important that the lowered "load" instruction is placed before the
associated DEBUG_VALUE entry describing the value loaded.

Renamed the existing SkipPHIsAndLabels to SkipPHIsLabelsAndDebug to
more fully describe that it also skips debug entries. The used the
"new" function SkipPHIsAndLabels when the debug information should not
be skipped when placing the lowered "load" instructions so that it is
placed before the debug entries.

Diff Detail

Repository
rL LLVM

Event Timeline

keith.walker.arm retitled this revision from to Place the lowered phi instruction(s) before the DEBUG_VALUE entry.
keith.walker.arm updated this object.
dblaikie edited edge metadata.Aug 22 2016, 11:06 AM

Looks pretty reasonable - but, again, I'll punt to Adrian for final sign off due to better familiarity with the debug value/variable tracking code.

(minor wonder whether it'd be easy enough for you to take a quick look at other targets to see if they need a similar treatment to PPCEarlyReturn.cpp)

aprantl accepted this revision.Aug 22 2016, 1:17 PM
aprantl edited edge metadata.

Looks reasonable to me. Thanks!

include/llvm/CodeGen/MachineBasicBlock.h
463 ↗(On Diff #68815)

or debug intrinsic. (?)
Sounds marginally better to my ears ;-)

This revision is now accepted and ready to land.Aug 22 2016, 1:17 PM
This revision was automatically updated to reflect the committed changes.