Page MenuHomePhabricator

[DebugInfo] Don't insert DEBUG_VALUE after terminators
ClosedPublic

Authored by smaksimovic on Feb 1 2018, 8:26 AM.

Details

Summary

r314974 introduced insertion of DEBUG_VALUEs after
each redefinition of debug value register in the slot index range.

In case the instruction redefining the debug value register
was a terminator, machine verifier would complain since it
enforces the rule of no non-terminator instructions
following the first terminator.

Diff Detail

Repository
rL LLVM

Event Timeline

smaksimovic created this revision.Feb 1 2018, 8:26 AM

The change LGTM, but I'm not sure if I'm allowed to set "ready to land". I would prefer if Adrian Prantl or Reid Kleckner also reviewed this change (both now added as reviewers).

Ping.
As I said before the change LGTM, but I would prefer if someone else also reviewed this change.

Change LGTM with minor comment on possible readability improvement.

lib/CodeGen/LiveDebugVariables.cpp
1103 ↗(On Diff #132405)

The change makes perfect sense. From a readability point of view, I'd perhaps prefer to express this concept in the while condition, or else have a separate if statement for it, i.e. either

while (I != MBB->end() && !I->isTerminator())

or

while (I != MBB->end()) {

if (I->isTerminator())
  break;
if (!LIS.....
smaksimovic marked an inline comment as done.
wolfgangp accepted this revision.Feb 8 2018, 8:51 AM

LGTM.

This revision is now accepted and ready to land.Feb 8 2018, 8:51 AM
This revision was automatically updated to reflect the committed changes.