This is an archive of the discontinued LLVM Phabricator instance.

[Stack Slot Coloring] Skip pseudo debug instructions in removing dead stores
ClosedPublic

Authored by sgundapa on Nov 14 2016, 9:07 AM.

Details

Summary

In the below scenario, we must be able to skip the a DBG_VALUE instruction and
remove the dead store.

%vreg0<def> = L2_loadri_io <fi#15>, 0; mem:LD4[%dataF](align=4)
DBG_VALUE %vreg0, %noreg, !"dataF", <!184>; IntRegs:%vreg0
S2_storeri_io <fi#15>, 0, %vreg0; mem:ST4[%dataF]

In reality, this kind of stores are eliminated before Stack Slot Coloring pass,
possibly in instruction lowering

Diff Detail

Repository
rL LLVM

Event Timeline

sgundapa updated this revision to Diff 77823.Nov 14 2016, 9:07 AM
sgundapa retitled this revision from to [Stack Slot Coloring] Skip pseudo debug instructions in removing dead stores.
sgundapa updated this object.
sgundapa added reviewers: kparzysz, bcahoon.

I find it hard to come up with a unit test for this scenario. I would really appreciate if some one from community can help me in this regard.
I tried to play with mir code but in-vain.

sgundapa updated this revision to Diff 77834.Nov 14 2016, 10:34 AM
kparzysz set the repository for this revision to rL LLVM.Nov 15 2016, 6:53 AM
kparzysz added a subscriber: llvm-commits.
kparzysz accepted this revision.Nov 18 2016, 7:05 AM
kparzysz edited edge metadata.

LGTM with a few minor comments.

lib/CodeGen/StackSlotColoring.cpp
400 ↗(On Diff #77834)

I suggest changing it to "... debug pseudo instructions ...". Also, add a period at the end of the sentence.

401 ↗(On Diff #77834)

The parentheses around != are not necessary.

403 ↗(On Diff #77834)

The indent it too large: should be 2 columns.

This revision is now accepted and ready to land.Nov 18 2016, 7:05 AM
sgundapa closed this revision.Jan 9 2017, 9:33 AM

This patch was merged on 11/14/2016

sgundapa reopened this revision.Jan 9 2017, 9:36 AM

This was not merged yet.

This revision is now accepted and ready to land.Jan 9 2017, 9:36 AM
This revision was automatically updated to reflect the committed changes.