This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Handle DBG_VALUE instructions in two places in backend
ClosedPublic

Authored by jonpa on Jan 22 2019, 4:54 AM.

Details

Reviewers
uweigand
Summary

Two backend optimizations failed to handle cases when compiled with -g, due to failing to consider DBG_VALUE instructions. This was in SystemZTargetLowering::emitSelect() and SystemZElimCompare::getRegReferences().

This patch makes sure that DBG_VALUEs are recognized so that they do not affect these optimizers.

Tests for branch-on-count, load-and-trap and consecutive selects.

Diff Detail

Event Timeline

jonpa created this revision.Jan 22 2019, 4:54 AM

What's the reason for using SkipPHIsLabelsAndDebug instead of, say, skipDebugInstructionsForward? It's not obvious to me that skipping PHIs and labels is safe at all those places ...

Otherwise, this looks good to me.

jonpa updated this revision to Diff 182911.Jan 22 2019, 7:18 AM

What's the reason for using SkipPHIsLabelsAndDebug instead of, say, skipDebugInstructionsForward? It's not obvious to me that skipping PHIs and labels is safe at all those places ...

No reason in particular, and I agree that skipDebugInstructionsForward() seems like a better choice. Patch updated.

uweigand accepted this revision.Jan 22 2019, 7:24 AM

LGTM, thanks!

This revision is now accepted and ready to land.Jan 22 2019, 7:24 AM
jonpa closed this revision.Jan 22 2019, 11:49 PM

Thanks for review. r351928.