This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fix an assertion for pre-index generation with unscaled loads/stores.
ClosedPublic

Authored by mcrosier on Aug 2 2017, 3:53 PM.

Details

Summary

This looks to be as simple as we were missing the necessary opcodes from the switch statement. In trying to write IR test cases I found that ISel kept generating the pre-inc forms during lower, so I ended up writing all the tests in MIR. I suspect this is also the reason why this bug existed for so long without being discovered.

I didn't add the cases to the pre-index forms because the main loops skip this optimization for unscaled loads/stores. I'm not sure why this is the case, but perhaps that justs a missed opportunities to be addressed by a later patch (and if so the missing pre-index cases can be added then).

This should fix PR34035.

Chad

Diff Detail

Repository
rL LLVM

Event Timeline

mcrosier created this revision.Aug 2 2017, 3:53 PM
junbuml edited edge metadata.Aug 3 2017, 8:18 AM

LGTM.
It seems that those are simply missing opcodes in the switch.

It might be good to add FIXME in getPreIndexedOpcode explaining unscaled loads/stores are intentionally not added for now.

mcrosier accepted this revision.Aug 3 2017, 10:30 AM

Approved, per Jun.

This revision is now accepted and ready to land.Aug 3 2017, 10:30 AM

It might be good to add FIXME in getPreIndexedOpcode explaining unscaled loads/stores are intentionally not added for now.

Yes, I'll add the FIXME before committing. Thanks, Jun.

This revision was automatically updated to reflect the committed changes.