This is an archive of the discontinued LLVM Phabricator instance.

Don't skip splitSeparateComponents in eliminateDeadDefs
ClosedPublic

Authored by wmi on Apr 14 2016, 5:49 PM.

Details

Summary

This patch is to fix a bug reported here: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160411/347420.html

Because HoistSpillHelper::hoistAllSpills is called in postOptimization, we don't want LiveRangeEdit::eliminateDeadDefs to generate unassigned new vregs. That is why I set NoSplit flag to early return from LiveRangeEdit::eliminateDeadDefs. However, skipping splitSeparateComponents will make verify-machineinstrs unhappy, so I remove the early return, and use HoistSpillHelper::LRE_DidCloneVirtReg to assign physreg/stackslot for those new vregs. I know those new vregs should have the same physreg/stackslot as the old vreg which new vregs are splitted from.

Some code reorganization to make class HoistSpillHelper private inheriting from LiveRangeEdit::Delegate possible. This is to be consistent with class RAGreedy and class RegisterCoalescer.

Thanks,
Wei.

Diff Detail

Repository
rL LLVM

Event Timeline

wmi updated this revision to Diff 53823.Apr 14 2016, 5:49 PM
wmi retitled this revision from to Don't skip splitSeparateComponents in eliminateDeadDefs.
wmi updated this object.
wmi added a reviewer: qcolombet.
wmi set the repository for this revision to rL LLVM.
wmi added subscribers: llvm-commits, davidxl.

The problem I saw on my out-of-tree target seems to be fixed with this patch and so far I haven't seen any new problems.

I'll run some more tests during the day.

I haven't seen any new problems on my out-of-tree target with this patch.

wmi added a subscriber: wmi.Apr 15 2016, 9:32 AM

Mikael, thank you for trying this patch.

Wei.

qcolombet accepted this revision.Apr 15 2016, 3:30 PM
qcolombet edited edge metadata.
This revision is now accepted and ready to land.Apr 15 2016, 3:30 PM
This revision was automatically updated to reflect the committed changes.