This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fold more spilled/refilled COPYs.
ClosedPublic

Authored by gberry on Nov 30 2016, 10:09 AM.

Details

Summary

Make AArch64InstrInfo::foldMemoryOperandImpl more general by folding all
full COPYs between register classes of the same size that are either
spilled or refilled.

Diff Detail

Repository
rL LLVM

Event Timeline

gberry updated this revision to Diff 79778.Nov 30 2016, 10:09 AM
gberry retitled this revision from to [AArch64] Fold more spilled/refilled COPYs..
gberry updated this object.
gberry added reviewers: MatzeB, qcolombet.
gberry added a subscriber: llvm-commits.
qcolombet accepted this revision.Nov 30 2016, 1:56 PM
qcolombet edited edge metadata.

LGTM with one nitpick.

Thanks,
Q.

lib/Target/AArch64/AArch64InstrInfo.cpp
2645 ↗(On Diff #79778)

Could you add a message in the assert please?

This revision is now accepted and ready to land.Nov 30 2016, 1:56 PM
MatzeB accepted this revision.Nov 30 2016, 2:03 PM
MatzeB edited edge metadata.

LGTM as well. Two comments:

lib/Target/AArch64/AArch64InstrInfo.cpp
2636 ↗(On Diff #79778)

I always have a bad feeling about performance when getMinimalPhysRegClass() is used because that function does a linear search through the register classes. However looking around I couldn't find any better way to do what you want to do here. So I'm fine with it for now.

2645 ↗(On Diff #79778)

I would make this an actual check instead of an assert. While I have never seen it in practice, I think in theory we could have implicit defs/uses to the COPY instruction at later positions.

This revision was automatically updated to reflect the committed changes.